3/6/20

Kubernetes TLS certificate errors


Error:
Unable to connect to the server: x509: certificate signed by unknown authority

Fix:
unset KUBECONFIG
export KUBECONFIG=/etc/kubernetes/admin.conf

mv  $HOME/.kube $HOME/.kube.bak
mkdir $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

Sudo without password in Ubuntu/Debian



sudo visudo
user ALL=(ALL) NOPASSWD:ALL

3/5/20

MacOS Connect to KVM

Install:
brew tap jeffreywildman/homebrew-virt-manager
brew install virt-manager virt-viewer libvirt

Fix error (g-io-error-quark: Error opening file /usr/local/Cellar/libosinfo/1.7.1/share/libosinfo/pci.ids: No such file or directory (1)):

mkdir -p /usr/local/Cellar/libosinfo/1.7.1/share/libosinfo/
cd /usr/local/Cellar/libosinfo/1.7.1/share/libosinfo/
wget https://pci-ids.ucw.cz/v2.2/pci.ids
wget http://www.linux-usb.org/usb.ids

Copy ssh key:
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]_address

Connect:
virt-manager -c 'qemu+ssh://[email protected]_address/system?socket=/var/run/libvirt/libvirt-sock'

9/5/19

Migrating Local Mongo to MongoDB Atlas



Stop database writes
#> mongo --host=localhost --eval "db.fsyncLock()"

Back up the data from the localhost database
#> mongodump --host=localhost --port=27017

Write the data to MongoDB Atlas
#> mongorestore --ssl --host cluster0-shard-00-00-qfovx.mongodb.net --port 27017 -u user -p password dump

6/14/19

uWSGI with Python 3.7 in Ubuntu 18

Packages
sudo apt install python3.7 python3.7-dev uwsgi uwsgi-src uuid-dev libcap-dev libpcre3-dev

Build
cd ~
export PYTHON=python3.7
uwsgi --build-plugin "/usr/src/uwsgi/plugins/python python37"

Install
sudo mv python37_plugin.so /usr/lib/uwsgi/plugins/python37_plugin.so
sudo chmod 644 /usr/lib/uwsgi/plugins/python37_plugin.so

10/16/18

SSLError(SSLError(1, u'[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:661)'),))

pip install pyOpenSSL
pip install ndg-httpsclient
pip install pyasn1

or

easy_install pyOpenSSL
easy_install ndg-httpsclient
easy_install pyasn1

9/28/18

Enable and use the RabbitMQ management console

sudo rabbitmq-plugins enable rabbitmq_management
sudo chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/

sudo rabbitmqctl add_user mqadmin password
sudo rabbitmqctl set_user_tags mqadmin administrator
sudo rabbitmqctl set_permissions -p / mqadmin ".*" ".*" ".*"

http://Server-IP:15672/