Skip to content

Instantly share code, notes, and snippets.

@szabo92
szabo92 / download
Created March 4, 2018 09:49
Download file
wget http://download.host.f/file.tar.gz
# alternatively
curl -o output.file http://download.host.f/file.tar.gz
@szabo92
szabo92 / start i3
Last active March 4, 2018 09:04
Start i3
# in .xinitrc
exec i3
# if it does not exist
touch .xinitrc
# start X
startx
# to automatically start X on login, add to ~/.bashrc the following:
@szabo92
szabo92 / kbmap
Last active March 4, 2018 03:03
Change keyboard layout in X
setxkbmap -layout us,es
setxkbmap -option 'grp:alt_shift_toggle'
# make it permanent in i3, add to .config/i3/config
exec "setxkbmap -layout us,es"
exec "setxkbmap -option 'grp:alt_shift_toggle'"
@szabo92
szabo92 / upgrade
Created March 3, 2018 23:35
Upgrade Debian packages
# list upgradable packages
apt list --upgradable
# upgrade everything
sudo apt full-upgrade
@szabo92
szabo92 / docker_install
Last active March 4, 2018 09:14
Install Docker in Debian
# install the following packages
sudo apt install apt-transport-https ca-certificates curl gnupg2 sofware-properties-common
# $(. /etc/os-release; echo "$ID")
# outputs debian
# add Docker's GPG key
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
@szabo92
szabo92 / version
Created March 3, 2018 22:38
Debian version
lsb-release -da
# if missing
sudo apt install lsb-release
## alternatively
cat /etc/issue
@szabo92
szabo92 / sudoers
Last active March 3, 2018 22:27
Add user to sudoers
sudo adduser username sudo
## alternatively
visudo
# add at the end
username ALL=(ALL:ALL) ALL
@szabo92
szabo92 / vanilla-gnome.sh
Last active January 17, 2018 06:35
Vanilla GNOME in Ubuntu
sudo apt install gnome-session
@szabo92
szabo92 / update_node.sh
Last active December 22, 2017 12:51
Update Nodejs
node --version
sudo npm install npm@latest -g
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
node --version
@szabo92
szabo92 / find_by_hash.sh
Created November 17, 2017 23:08
Find file by hash in a local directory
find /foo/bar | xargs md5sum | grep YOUR_MD5_SUM_HERE