Skip to content

Instantly share code, notes, and snippets.

@bongofury
Last active April 15, 2022 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bongofury/a1f35ad5b9da8ead6f39bd0b0268f05b to your computer and use it in GitHub Desktop.
Save bongofury/a1f35ad5b9da8ead6f39bd0b0268f05b to your computer and use it in GitHub Desktop.
Linux commands I always search for
# mount NAS using smb/cifs (needs cifs-utils to be installed)
sudo mount -t cifs -o username=XXX //192.168.1.XXX/edo_backup /mnt/NAS_edo
# list config firewalld (CentOS)
sudo firewall-cmd --list-all-zones
# add port/service firewalld
sudo firewall-cmd --zone=public --add-port=3000/tcp
# make running changes persistent (through reboots)
sudo firewall-cmd --runtime-to-permanent
# use port for HTTP
sudo semanage port -a -t http_port_t -p tcp 3999
# list used ports
sudo semanage port -l
# nginx, edit conf in /etc/nginx/conf.d, then...
# test conf
sudo nginx -t
# apply conf restarting the service
sudo systemctl restart nginx
# show all listening ports
sudo netstat -tulpn | grep LISTEN
# create RSA key pair for JWT signing
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
# restart ksmtuned when it wants to take all the CPU
sudo systemctl restart ksmtuned
# ... or stop it until restart
sudo systemctl stop ksmtuned
sudo systemctl stop ksm
# ... or disable it permanently
sudo systemctl disable ksmtuned
sudo systemctl disable ksm
# reduce video filesize
ffmpeg -i input.MP4 -vcodec libx264 -crf 20 output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment