Skip to content

Instantly share code, notes, and snippets.

@xsenechal
Last active January 18, 2019 09:48
Show Gist options
  • Save xsenechal/a84c8fab164f75af9027 to your computer and use it in GitHub Desktop.
Save xsenechal/a84c8fab164f75af9027 to your computer and use it in GitHub Desktop.
Linux stuff
#keyboard layout
dpkg-reconfigure keyboard-configuration
#change user password
sudo passwd user
#install xorg & dwm (a dynamic window manager for Xorg)
wget http://dwm.suckless.org/ **tar.gz
tar -xvf *.tar.gz
apt-get -y install gcc make xorg xterm libx11-dev libxinerama-dev
make # pour le compiler
# et ensuite tu mets ton .xinitrc dans ton $HOME avec ça dedans :
xrdb -merge ~/.Xresources # pour la config de xterm
xrandr --size 1280x800 # pour changer la resolution de l’écran
exec ~/dwm/dwm # le path de l’exécutable de dwm
startx
#configure vbaddons (full screen)
sudo apt-get remove dkms build-essential linux-headers-*
sudo apt-get install dkms build-essential linux-headers-$(uname -r)
mount /dev/sr0 /media/cdrom
sudo ./media/cdrom/VBoxLinuxAdditions.run
# config screen size: add in .xinitrc:
xrandr --newmode "1680x1050" 147.14 1680 1784 1968 2256 1050 1051 1054 1087 -HSync +Vsync
xrandr --addmode VGA-0 1680x1050
xrandr --size 1680x1050
# mount share folder on virtual box (auto)
# add mount -t vboxsf x_sen /mnt/x_sen to /etc/rc.local
# set date using http through proxy
sudo date -s "$(curl -sD - google.com | grep ^Date: | cut -d' ' -f3-6)Z"
# get date in a specified format
DATE=`date +%Y.%m.%d-%H.%M.%S`
# rename multiple file (remove first 25 chars)
for f in *.xml; do mv "$f" "`echo $f | cut -c25-`"; done
# extract string using regex group (sed)
cat "pom.xml" | sed -n 's/.*<version>\(.*\)-SNAPSHOT<\/version>.*/\1/p' | head -1
# rename multiple files using sed pattern
for f in *.pdf; do cp "$f" "`echo $f | sed s/xavier/albert/`"; done
# check loadbalancing request HEADER (netscaler cookie insert in this case)
for n in {1..20}; do curl -Is https://example.com/ | grep NSC; done | cut -c 1-100 | sort | uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment