Karambir Singh Nain

Simple Linux Tips and Tricks

Published

Using Ubuntu(Pop!_OS) and Arch for a decade and I still forget how to do simple tasks. I am documenting a few here and will keep updating this for future reference.

tar archives

Tar has following options

  • -c is crate archive mode, others are options in that mode
  • -x is extract archive mode
  • -v verbosepopOS
  • -z create gzip
  • -f tar filename

Create and Extract

tar -cvzf test.tar.gz test-dir/
tar -xvzf test.tar.gz /op/test

Split and combine large files

Split command can be used to split large files into many smaller ones:

e.g. split -b 50M thunderbird-profile.tar.gz "profile.tar.gz.part."

Similarly to combine these files again, use cat:

e.g. cat profile.tar.gz.part.* > thunderbird.profile.tar.gz

How to remove password from pdf file

  1. Install pdftk
  2. sudo apt install pdftk
  3. pdftk <path-to-encrypted.pdf> input_pw <password> output <new-file.pdf>

Socks proxy

ssh -D 8123 -f -C -q -N <[email protected]>

I have this setup as my bash alias.

Monitor ongoing tcp traffic

sudo tcpdump -i eth0

List open TCP ports

sudo netstat -plnt

Disable Gnome tracker daemon

It hogs cores when files are changing fast.

From here

tracker daemon -t
cd ~/.config/autostart
cp -v /etc/xdg/autostart/tracker-*.desktop ./
for FILE in tracker-*.desktop; do echo Hidden=true >> $FILE; done
rm -rf ~/.cache/tracker ~/.local/share/tracker

Flatpack nextcloud autostart setup

Flatpack provided nextcloud doesn't do autostart by itself. Create a file at ~/.config/autostart/flatpak-nextcloud.desktop with following content:

[Desktop Entry]
Type=Application
Exec=flatpak run com.nextcloud.desktopclient.nextcloud --background
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_IN]=Nextcloud(flatpak)
Name=Nextcloud(flatpak)
Comment[en_IN]=custom command - flatpak
Comment=custom command - flatpak

Install obs virtual camera

From here

sudo apt install v4l2loopback-dkms