golb

Useful commands

Grep everything

grep -rni "pandoc" *
grep -rni "pandoc" ./**/Makefile # in specific file

systemctl and journalctl

SERVICE=service_name.service
systemctl start $SERVICE
journalctl -u $SERVICE -f

tar && zip

# create
# -c create -v verbose -z gzip -f archivename
tar -cvzf archive.tar.gz directory
zip -r archivename.zip directory

# extract
# -x extract -v verbose -f archivename -C directory
tar -xvf archive.tar.gz -C extracted
unzip archivename.zip -d extracted

Swap

# Turn swap off
sudo swapoff -a

# Create an empty swapfile 10GB
sudo dd if=/dev/zero of=/swapfile bs=1G count=10

sudo chmod 0600 /swapfile
sudo mkswap /swapfile  # Set up a Linux swap area
sudo swapon /swapfile  # Turn the swap on

https://askubuntu.com/a/1177939

One-liner favicon.ico generator

TO_ICONIFY=IMAGE.png
for i in 48 96 144 192; do convert $TO_ICONIFY -resize ${i}x${i} favicon-${i}x${i}.png; done; convert favicon-* favicon.ico