IT
Apache
Reverse proxy
Some apache modules have to be enabled: sudo a2enmod ssl sudo a2enmod proxy sudo a2enmod proxy_ba...
Basic authentication
To protect some directory with basic authentication we have to edit the virtual host file and add...
HTTPS (SSL)
add-apt-repository ppa:certbot/certbot apt install python-certbot-apache certbot --apache -d yo...
Git
http://rogerdudler.github.io/git-guide/ Approve user and set it admin via gitlab-rails root@vp...
Linux Administration
Users and groups
Adding an existing user to an existing group usermod -a -G theExampleGroup theExampleUser Changin...
Passwords
Use pwgen to generate ramdom passwords pwgen will generate easy to remember passwords # pwgen Vi6...
SSH / SCP without known_hosts check
When we want to connect to a remote host using different credentials and we have automatic login ...
Ubuntu startup mode
Show current default target sudo systemctl get-default To start in multi-user mode (text mode) ...
Testing networking services
Netcat Testing networking services to troubleshoot communications can be easily done with netcat ...
Services
Managing services with systemctl Start sudo systemctl start application.service Stop sudo systemc...
Securely delete files and directories
Shred shred -zvu -n 3 fileToDelete Wipe wipe -rfi privateDirectory/* SRM (secure remove) srm -vz ...
rsync
https://serverfault.com/questions/529287/rsync-creates-a-directory-with-the-same-name-inside-of-d...
IPTables
Allow All Incoming HTTP sudo iptables -A INPUT -p tcp --dport 80 -m conntrack --ctstate NEW,ES...
Mounting ISO images under FreeBSD
https://makandracards.com/jan0sch/13431-mounting-iso-images-under-freebsd
Console on serial port
Example using RedHat Linux 6.0 Using lilo bootloader Edit /etc/lilo.conf append="console=tty0 con...
Some useful commands
Here is how to join two files side by side in columns, delimited by ";" paste file1 file2 -d ";"
Ramdisk
Creating a ramdisk for fast read/write and comparing it with HDD/SSD drive using dd: # Creating a...
Swap memory
https://docs.vultr.com/how-to-add-swap-memory-in-ubuntu-24-04
MacOS
Aliases on shell
Since .bashrc is not working, i managed to do some tricks Edit /etc/profile and add the following...
Dealing with ISO Files with hdiutil
Creating an iso file from a directory hdiutil makehybrid -iso -joliet -o output_image.iso input_d...
Writing image to SD card
These are the steps to write an raspberry pi OS image to an SD card on MacOS 1. Insert card on re...
DNS Cache clear
dscacheutil -flushcache sudo killall -HUP mDNSResponder https://www.siteground.com/kb/how_to_cl...
MySQL
Linux auto-login on MySQL
Create file ~/.my.cnf and add the following lines, replace mysqluser and mysqlpass values with th...
Encoding and collation
Changing database encoding and collation ALTER DATABASE `sua_base` CHARSET = Latin1 COLLATE = lat...
Exporting data
To export structure only, use this option on mysqldump: mysqldump [...] --no-data To export comma...
Useful commands
Show status show table status; Purging MySQL Binlog files To show binary logs mysql> SHOW BINA...
Security
Iptables configuration to allow specific host connection to mysql: iptables -A INPUT -i eth0 -p t...