My personal cheatsheet for using the Linux command line.
.tar.bz2
tar -jxvf file.tar.bz2.tar.xz
tar xvfJ file.tar.xz.tar.gz
tar -zxvf file.tar.gz.gz
gunzip file.gzZip something
zip foo foo.zipZip recursively
zip -r file.zip directory/Configure GIT
git config --global user.email "user.name@email.ch"
git config --global user.name "Name Surname"Commit to master
git init
git add README.md
git commit -m "initial commit"
git remote add origin https://github.com/user/repo.git
git push -u origin masterTo add a new Samba user, you first have to create a new Unix user.
sudo useradd --shell /bin/false USER # new unix user
sudo passwd USER # set password
sudo smbpasswd -a USER # create samba userlsblk -l #find the usb drive
umount /dev/sdX
dd bs=4MB if=file.iso of=/dev/sdXCheck for how long your SSL certificate remains valid.
openssl x509 -noout -dates -in /etc/letsencrypt/live/yourdomain.tld/cert.pemNixcraft: How To Compile And Run a C/C++ Code In Linux
Compile a C++ file
g++ CODE.cpp -o BINARY.exeCompile a C file
gcc CODE.c -o BINARY.exeSize of a directory
du -sh DIR/Random Filename argument
echo `ls dir | sort -R | tail -n 1`sudo dpkg -i pack.debnohup command > /dev/null 2>&1SSH tunnel
-D [Bind Port]
-p [Remote Port]
ssh -CnN -D 9999 -p 22 user@server.ch # forwards local port 9999 via ssl tunnelSSH tunnel settings for PuTTY
Connection > SSH > Tunnels :
Source Port: port
☒ Dynamic
☒ Auto
[Add]
Session :
Host Name: server
Port: port
Saved Sessions: name
[Save]
[Load]