Remove git-lfs

commit & push everything remove hooks: git lfs uninstall remove lfs stuff from .gitattributes list lfs files using git lfs ls-files | sed -r 's/^.{13}//' > files.txt into a “files.txt”. run git rm --cached for each file: while read line; do git rm --cached "$line"; done < files.txt run git add for each file while read line; do git add "$line"; done < files.txt commit everything git add .gitattributes git commit -m "unlfs" git push origin check that no lfs files left git lfs ls-files remove junk rm -rf ....

Restore deleted Telegram messages, medias and files from groups

Since there’s not telegram API endpoints for this, we need to call MTProto methods to retrieve messages from the “Recent Actions” (Admin Log) since deleted messages (and medias) gets moved there for 48 hours before the permanent deletion. from telethon import TelegramClient, events, sync from telethon.tl.types import InputChannel, PeerChannel from telethon.tl.types import Channel import time # Get your own api_id and # api_hash from https://my.telegram.org, under API Development. # or from https://tjhorner....

Restore GRUB

Mount the linux partition, chroot to it, run grub-update. Or: fdisk -l list of physical devices (X) and partitions (Y) (or blkid) mount /dev/sdXY /mnt umount /mnt/boot and mount /dev/sdXY /mnt/boot if you have a separate boot partition grub-install --boot-directory=/mnt/boot /dev/sdX (Given you have access to a busybox/linux shell)

SCP through SSH

Here’s how to run scp to copy from machine A to machine R, with R being accessible only from machine G. A -G-> R Set up SSH tunnel: ssh -L 1234:<address of R known to G>:22 <user at G>@<address of G> Adding “cat -” will keep it running while above will get you connected to G: ssh -L 1234:<address of R known to G>:22 <user at G>@<address of G> cat - Either way you run it, open another terminal for next step....

Steam: Source-based games not starting

Confirmed to help with Portal, The Stanley Parable with these errors on start: error while loading shared libraries: libtcmalloc_minimal.so.4: cannot open shared object file: No such file or directory error while loading shared libraries: libtcmalloc_minimal.so.4: wrong ELF class: ELFCLASS64 SDL failed to create GL compatibility profile (whichProfile=0! SDL failed to create GL compatibility profile (whichProfile=0! Be sure to have these libraries installed: libtcmalloc-minimal4:i386 libtxc-dxtn-s2tc0:i386 libstdc++. Rename every occurency of the file libstdc++....

Tracking configuration files

Manually setup a git repo in /etc or take a look at the etckeeper package. Don’t use a public repository, /etc can expose sensitive data such as password hashes or private keys. apt get install etckeeper git incrontab nano /etc/etckeeper/etckeeper.conf , set VCS="git" (comment the other options) and set PUSH_REMOTE="origin". # Go to the configuration directory. cd /etc # Initialize etckeeper. etckeeper init # Add the remote repository. git remote add origin git@HOSTNAME:REPONAME # First commit....

Use Jupyter inside a virtual env

python -m venv projectname source projectname/bin/activate (venv) $ pip install ipykernel (venv) $ ipython kernel install --user --name=projectname