Sunday, April 19, 2020

Setup Raspberry PI as rsyslog Server for Hap ac2 Router

1. rsyslog was installed by default.
2. Create your source log configuration file: /etc/rsyslog.d/hapac2.conf
$template NetworkLog, "/var/log/hapac2.log"
:fromhost-ip, isequal, "192.168.3.1" -?NetworkLog
& ~
3. Enable rsyslog to listen to remote request, uncomment below entries in file /etc/rsyslog.conf

module(load="imudp")
input(type="imudp" port="514")

module(load="imtcp")
input(type="imtcp" port="514")
4. Touch /var/log/hapac2.log

5. Restart rsyslog daemon:

service rsyslog restart

Configuration on Hap ac2 router

Login Hap ac2 console, goto System -> Logging -> Actions




Double click on remote to open the entry, then type in the information you get from rsyslog server.




Back to tab Rules, Add rule for firewall, and give a Prefix if you like, and change the Action to remote:



Now, logon rsyslog server, you should be able to see the logs saved in /var/log/hapac2.log

Thursday, April 16, 2020

Kubernetes Online Resources

https://www.openshift.com/blog/guide-to-installing-an-okd-4-4-cluster-on-your-home-lab

Monday, April 13, 2020

ImportError: No module named yaml

https://stackoverflow.com/questions/50868322/importerror-no-module-named-yaml/50868994

Solution 1: install python 3.6 and ln python3 to it
export $PYPATH=`which python3`
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
tar -Jxf Python-3.6.5.tar.xz
cd Python-3.6.5/
./configure && make && make altinstall
rm $PYPATH
ln -s `which python3.6` $PYPATH
python3 -m pip install pyyaml
python3 env/common_config/add_imagepullsecret.py
Solution 2: use virtualenv
pip3 install virtualenv
virtualenv --python=python3 venv
source venv/bin/activate
pip install pyyaml
python env/common_config/add_imagepullsecret.py
Solution 3: use pipenv