# Rename a branch and delete remote old branch
git checkout <old_name>
git branch -m <new_name>
git push origin -u <new_name> # If the old branch is on remote
git push origin --delete <old_name> # If the old branch is on remote
# Revert to the state just before the last commit
git reset HEAD^
git reset 'HEAD@{1}' # revert last oneConnect with command line
sudo -i -u postgres # change user
psql # connect to postgresqlCommnands
# List all users# List proccess
ps aux
# journalctl logs
journalctl -u clinic_server.service --since "1 hour ago"
journalctl -u clinic_server.service --since "2 days ago"
# Find text in files in current dir recursively
grep -Ril "a_word" . --include \*.txt --exclude \*.ano --exclude-dir=site-packagessudo apt update
# Install JDK
sudo apt install python-software-properties
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt install openjdk-11-jdk
sudo apt-get update
java -versionsudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce- Install nginx RTMP module
sudo apt install libnginx-mod-rtmp
- Add the following configuration to
/etc/nginx/nginx.conf
rtmp {
server {
listen 1935;
More info here. Ensure you have server blocks for example.com and www.example.com, and that the port 443 is allowed through the firewall.
sudo add-apt-repository ppa:certbot/certbot
sudo apt install python-certbot-nginx
sudo certbot --nginx -d example.com -d www.example.com
*filter
# Drop NULL packets
-A INPUT -p tcp --tcp-flags ALL NONE -j DROP
# Block syn flood attack
-A INPUT -p tcp ! --syn -m state --state NEW -j DROP
# Block XMAS packetsNewerOlder