Skip to content

Instantly share code, notes, and snippets.

View Ruzzz's full-sized avatar

Ruslan Zaporojets Ruzzz

View GitHub Profile
Ruzzz /
Last active March 25, 2021 16:31
  • Shell form: exec param
  • Exec form: ["exec", "param"]
No CMD error /bin sh -c e0 p0 e0 p0
CMD ["e1", "p1"] e1 p1 /bin sh -c e0 p0 e0 p0 e1 p1
CMD ["p1", "p2"] p1 p2 /bin sh -c e0 p0 e0 p0 p1 p2
CMD e1 p1 /bin sh -c e1 p1 /bin sh -c e0 p0 e0 p0 /bin sh -c e1 p1
Ruzzz /
Last active February 1, 2023 23:36
gnupg directory permissions
chmod 700 ~/.gnupg
chmod 600 ~/.gnupg/*
find ~/.gnupg -type f -exec chmod 600 {}
find ~/.gnupg -type d -exec chmod 700 {}
Ruzzz /
Last active September 28, 2020 11:48
ssh directory permissions
chmod 700 ~/.ssh
chmod 644 ~/.ssh/*
chmod 600 ~/.ssh/id_rsa
Ruzzz /
Last active February 24, 2020 17:45
postgres 11 hints

Pre-installation cleanup

dpkg -l | grep postgres
sudo apt-get purge postgresql*  # or
sudo apt-get --purge remove postgresql\*

sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/
Ruzzz /
Last active October 14, 2021 21:30
Build Python on Ubuntu

Python-3.7.0 - Ubuntu ??

sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential libbz2-dev libdb5.3-dev libexpat1-dev libffi-dev libgdbm-dev liblzma-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libssl-dev tcl-dev tk-dev zlib1g-dev tk openssl

cd /opt
sudo curl -sL | sudo tar xJ

cd Python-3.7.0
# On remote host do:
# ------------------
# Add user
sudo adduser <USER> sudo
# Or:
sudo adduser <USER>
sudo usermod -a -G sudo <USER>
# Change ssh configuration
sudo apt install openvpn
# Download and apply configuration file
sudo cp ~/Download/NNN.ovpn /etc/openvpn/work.conf
rm ~/Download/NNN.ovpn
# Optional
sudo nano /etc/openvpn/work.pass
# Add password of private certificate
sudo chmod 600 /etc/openvpn/work.pass
Ruzzz /
Created July 16, 2018 06:49
Enable SSH on Windows Subsystem for Linux (WSL)
sudo apt-get update
sudo apt-get upgrade
sudo nano /etc/ssh/sshd_config
# PasswordAuthentication yes
# UsePrivilegeSeparation no
sudo service ssh start
pip3 install virtualenv
# mkdir project & cd project
virtualenv venv
virtualenv venv -p python3
source venv/bin/activate # linux
venv\Scripts\activate # windows
pip install Flask
pip install Flask==0.9
pip install --upgrade Flask
pip freeze > requirements.txt
# sudo apt-get install p7zip-full