Skip to content

Instantly share code, notes, and snippets.

@jfeilbach
jfeilbach / update_passkey.sh
Last active December 3, 2024 20:52
update_passkey.sh
#!/bin/bash
# only needed on transmission-daemon < version 4
key="<key>"
host="localhost:9091"
total=$(transmission-remote ${host} -l | tail -n 2 | head -n 1 | awk '{ print $1 }')
echo -e "Found ${total} torrents...\n"
echo -e "Inserting ${key} ...\n"
for i in $(seq 1 $total) ; do
id=$(transmission-remote ${host} -t ${i} -it | grep 'Tracker' | head -n 1 | awk '{ print $3 }')
if [ "$id" = "https://example.com:443" ]; then
@jfeilbach
jfeilbach / zerotier.md
Last active November 7, 2024 21:31
Compile/setup zerotier on Ubuntu 24.04

Usually this works for most people, but never does for me on Ubuntu.

curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/main/doc/contact%40zerotier.com.gpg' | gpg --import && \ if z=$(curl -s 'https://install.zerotier.com/' | gpg); then echo "$z" | sudo bash; fi

  • The minimum compiler versions required are GCC/G++ 8.x or CLANG/CLANG++ 5.x.
  • Linux makefiles automatically detect and prefer clang/clang++ if present as it produces smaller and slightly faster binaries in most cases. You can override by supplying CC and CXX variables on the make command line.
  • Rust for x86_64 and ARM64 targets if SSO is enabled in the build.
@jfeilbach
jfeilbach / ubuntu_24.04_annoyances.md
Last active November 7, 2024 21:12
Ubuntu desktop 24.04 Annoyances

Ubuntu desktop 24.04 Annoyances

This is a collection of annoyances that I have had to fix for myself while using the Ubuntu 24.04 desktop. Snaps are obviously the most annoying thing that Ubuntu does. Especially for Firefox. If you need to use smart cards or other tools with Firefox you may consider removing the snap version. I don't know the steps to completely remove snapd from a desktop system and retain all the functionality provided by those snap applications. I update this doc when I can remember.

Set vim as default editor

The Ubuntu install defaults to some weird text editor called nano. I have no idea how it works. I think it is new. You can change the default text editor.

sudo update-alternatives --config editor

You may need to install a more complete vim editor instead of the tiny vim that is installed by default.

@jfeilbach
jfeilbach / firefox_snap.md
Last active November 7, 2024 21:15
Ubuntu 24.04 remove Firefox snap and install .deb version

Ubuntu 24.04 Firefox snap replacement

I need a proper Firefox installation and not the snap version. The snap version does not work properly with Smart Cards. Although it seems to be possible to get it to work with smart cards it is extremely difficult and I don't care to try and make it work. This is not a tutorial on how to get your PIV or CAC to work. Also snaps suck. Canonical will heopfully abandon snaps in the future.

Remove Snap Firefox

sudo snap disable firefox
sudo snap remove --purge firefox
error: cannot perform the following tasks:
- Remove data for snap "firefox" (1943) (unlinkat /var/snap/firefox/common/host-hunspell/en_ZA.dic: read-only file system)
@jfeilbach
jfeilbach / .bash_aliases
Created August 18, 2024 01:31
Recent .bash_aliases for Ubuntu server 24.04 on Mac terminal
alias glances='glances --disable-autodiscover --fahrenheit --disable-webui'
alias rr='if [ -f /var/run/reboot-required ]; then echo "reboot required"; else echo "No reboot needed"; fi'
alias t-start='sudo service transmission-daemon start'
alias t-stop='sudo service transmission-daemon stop'
alias t-reload='sudo service transmission-daemon reload'
alias t-list='transmission-remote -n 'transmission:transmission' -l'
alias t-basicstats='transmission-remote -n 'transmission:transmission' -st'
alias t-fullstats='transmission-remote -n 'transmission:transmission' -si'
alias dl='header=$(df -hTP | head -n 1) ; echo "${header}" ; df -hTP | grep /dl_'
@jfeilbach
jfeilbach / .bashrc
Created August 18, 2024 01:30
recent .bashrc for Mac terminal on Ubuntu 24.04 server
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@jfeilbach
jfeilbach / bluey.md
Last active August 23, 2023 18:06
Fixing Season 2 of Bluey

Bluey Season 2

Fixing Bluey Season 2 to conform to the TVDB order. This fixes the giant mess displayed in Plex. Otherwise titles, descriptions. and other metadata will not match to the correct file.

Reorder

Move the incorrect episode number to the correct episode number temporarily. This avoids overwriting needed files.

mv -v Bluey\ \(2018\).S02E01.Dance\ Mode.WEBDL-1080p.h264.EAC3.mkv Bluey\ \(2018\).S02E02.Hammerbarn.WEBDL-1080p.h264.EAC3.mkv-tmp
mv -v Bluey\ \(2018\).S02E02.Hammerbarn.WEBDL-1080p.h264.EAC3.mkv 'Bluey (2018).S02E03.Featherwand.WEBDL-1080p.h264.EAC3.mkv-tmp'
mv -v Bluey\ \(2018\).S02E03.Featherwand.WEBDL-1080p.h264.EAC3.mkv Bluey\ \(2018\).S02E01.Dance\ Mode.WEBDL-1080p.h264.EAC3.mkv-tmp
mv -v Bluey\ \(2018\).S02E05.Hairdressers.WEBDL-1080p.h264.EAC3.mkv Bluey\ \(2018\).S02E11.Charades.WEBDL-1080p.h264.EAC3.mkv-tmp
@jfeilbach
jfeilbach / ubuntu_22.04_motd.md
Last active November 20, 2024 18:10
Make Ubuntu 22.04 less annoying. Remove ESM Ubuntu Advantage

Ubuntu 22.04 Annoyances

Here are a few collected ways I like to customize Ubuntu 22.04 servers. I used to love Ubuntu, but I hate auto updates and snaps. They also put ads and other usless ads diguised as "news" in MOTD. ESM FUD is spread throughout the OS including simple apt functions. You do not need ESM and thus Ubuntu 22.04 has become super annoying. unattended-upgrade is an automatic installation of security (and other) upgrades without user intervention. Consider the ramifications of disabling this service.

Disable unattended upgrades

The Unattended Upgrades feature is enabled by default and it runs at system boot without the user's permission. The configuration is stored in /etc/apt/apt.conf.d/20auto-upgrades

Disable: sudo dpkg-reconfigure unattended-upgrades then a TUI will come up, select "No"

This will not permantently disable the function. After an update it will be enabled. In the file /etc/apt/apt.conf.d/20auto-upgrades change these values from 1 to 0. Even doing this it will

@jfeilbach
jfeilbach / build.sh
Created January 21, 2021 21:12
build netifaces .whl
#!/bin/bash
git clone https://github.com/al45tair/netifaces.git /wheel/netifaces
/opt/python/cp39-cp39/bin/pip wheel /wheel/netifaces -w /tmp
auditwheel repair /tmp/netifaces-0.10.9-cp39-cp39-linux_x86_64.whl -w /output
# docker run -v "$(pwd)":/output quay.io/pypa/manylinux1_x86_64 /output/build.bash && pip install *.whl
@jfeilbach
jfeilbach / transmission-openvpn.sh
Last active April 15, 2023 18:24
docker pull, stop container, rm container, rotate log file, backup config, start new image as container, add dig, check public ip address
#!/bin/bash
host=<>
name=transmission-openvpn
log=transmission-openvpn.log
echo "Stopping ${name}"
/usr/bin/docker stop ${name}
echo "Removing ${name}"
/usr/bin/docker rm ${name}