Category Archives: Linux

Stuff about the superior OS

Finding duplicate files with Bash

Someone recently asked, in #bash on Freenode, how to find duplicate files with Bash. Several options were suggested, and the user ended up installing and running “fdupes“. However, this sort of thing should be reasonably easy to do using “find” and a few pipes. As a quick overview, what you want to achieve is to […]

Killing a process tree, killing a PID and all children

Here are a couple of useful functions I wrote to kill a process tree. It’s useful when dealing with tcpserver, which refuses to disconnect a client for as long as a process it started, or a child of that process, still runs. It’s also good for tackling runaway unintentional fork bombs, rogue daemons and other […]

Making a telnet server with Bash and tcpserver

Telnet servers are everywhere. They are simple, insecure by nature, outdated, and often badly implemented. Let’s do that, shall we? 🙂 TL;DR: Here’s the library. A simple way to make any command line interface listen to incoming TCP connections is tcpserver, provided as part of the ucspi-tcp or ucspi-tcp-ipv6 package on Debian. Using this, we […]

apt-get reports Packages not found

So.. this shit again. # apt-get update Ign jessie-updates InRelease Ign jessie-updates Release.gpg Ign jessie-updates Release Ign jessie-updates/main Sources/DiffIndex Ign jessie-updates/main i386 Packages/DiffIndex Ign jessie InRelease Ign jessie Release.gpg Ign jessie Release Ign jessie/main Sources/DiffIndex Ign jessie/main i386 Packages/DiffIndex Ign jessie/updates InRelease Ign […]

Duplicate bind mounts with chroots on systemd

When setting up jails, I commonly end up with structures like this in my /etc/fstab: /dev /jail/test/dev auto bind 0 0 /dev/pts /jail/test/dev/pts auto bind 0 0 /dev/shm /jail/test/dev/shm auto bind 0 0 /proc /jail/test/proc auto bind 0 0 /sys /jail/test/sys auto bind 0 0 /dev /jail/test2/dev auto bind 0 0 /dev/pts /jail/test2/dev/pts auto bind […]

W: [pulseaudio] authkey.c: Failed to open cookie file ‘/home/user/.config/pulse/cookie’: No such file or directory

W: [pulseaudio] authkey.c: Failed to open cookie file ‘/home/user/.config/pulse/cookie’: No such file or directory W: [pulseaudio] authkey.c: Failed to load authorization key ‘/home/user/.config/pulse/cookie’: No such file or directory I had this problem on an embedded box, with no X11, or even a screen. Turns out that at least some versions of Debian have an issue […]

My tweaks to Kali Linux (note to self)

Here are some of the things I did to make Kali Linux 2016.1 suit my taste, mostly intended as a note to myself, but posted here in case it helps anyone else. General checklist Install aptitude and update everything Add settings icon to left panel Enable mouse tap to click in “Settings => Mouse & […]

SPF exists for a reason, and postfix makes it ridiculously easy

In the bronze age, messages came in, signed, and you’d simply have to assume they were from the Almighty Bob. Today, email is still technically in the iron age, but at least we have SPF. In a nutshell, when enables SPF for their domain, they can be sure that other people, which mail […]