Tag: linux
-
kubectl port-forward and the lost art of bash job control
A really common part of debugging stuff in k8s is to create a port-forward and then open a new shell and do a thing. Which is fine and easy when you’re port-forwarding to the machine you’re actually sat at, but less so when you’re not.
-
Sitecreator
I’ve just spent a few days using up spare holiday, which means I’ve been making things for work that work doesn’t want but I do. This time it’s sitecreator, a tool for configuring websites and all their dependencies (Unix users, databases, ssh keys, DNS records etc.) on servers. Since there’s so many possible things for…
-
Converting from Apache1-style to (Debian-style) Apache2-style vhosts
Yeah, some of us are still doing that migration. Anyway, historically Apache vhosts are all in one file at /etc/apache/httpd.conf or if you’re really lucky something like /etc/apache/vhosts.conf. Apache2 in Debian uses two directories – /etc/apache2/sites-available and /etc/apache2/sites-enabled. sites-available contains one file for each vhost and in order to enable them they’re linked to from…
-
Unattended Virtualmin installs
A while ago I was asked to concoct a fire-and forget script to install Virtualmin without prompting. It’s really easy: #!/bin/bash if [ -z $1 ]; then echo “Usage”; echo ” $0 [hostname]”; echo “”; exit fi wget http://software.virtualmin.com/gpl/scripts/install.sh -O install.sh export VIRTUALMIN_NONINTERACTIVE=”1″ chmod +x install.sh ./install.sh -f -host $1 rm install.sh And then you…
-
Fail2Ban and date formats
Fail2Ban is utterly daft in at least one respect. Here’s me testing a regex on a date format it doesn’t recognise: # fail2ban-regex ‘2010-12-14 15:12:31 – 80.87.131.48’ ‘ – <HOST>$’ Found a match but no valid date/time found for 2010-12-14 15:12:31 – 80.87.131.48. Please contact the author in order to get support for this format…
-
Massive dumps with MySQL
hurr. *insert FLUSH TABLES joke here* I have a 2.5GB sql dump to import to my MySQL server. MySQL doesn’t like me giving it work to do, and the box it’s running on only has 3GB of memory. So, I stumbled across bigdump, which is brilliant. It’s a PHP script that splits massive SQL dumps…
-
Generating Fluxbox menus for VNC (Vinagre) connections
One of the lovely things about Fluxbox is the text-driven menu. One of the nice things about Vinagre (Gnome’s VNC client) is the xml-based bookmarks file. Here’s a handy script to create a Fluxbox submenu out of your Vinagre bookmarks: #! /usr/bin/perl use strict; use warnings; use XML::Simple; my $HOME = $ENV{ HOME }; my…
-
PHP error on fresh install of PHPWiki:
Non-static method _PearDbPassUser::_PearDbPassUser() cannot be called staticallyI’ve just installed PHPWiki 1.3.14-4 from the debian repositories and out of the box I got the following message on trying to log in to it: Fatal error: Non-static method _PearDbPassUser::_PearDbPassUser() cannot be called statically, assuming $this from incompatible context in /usr/share/phpwiki.bak.d/lib/WikiUserNew.php on line 1118 The problem appears to be that, as of PHP 5.something,…
-
Munin plugins are really easy to write
Munin plugins basically need to output variable names and values, and a little bit of config. They’re tremendously easy to write. My plugin is mostly useless – it graphs the value returned by /dev/urandom, and the random constants from debian and dilbert. Current graph is here and the code is as follows: #! /bin/bash case…
-
*buntu 9.10
It’s out! Torrents here and here.
-
Some notes from configuring rTorrent
In anticipation of the new *buntus tomorrow, I’m configuring one of my servers as a torrent node for it, and for reasons unknown I’ve settled on rtorrent which is in the repos. The documentation is a little lacking (but does tell you how to do things like download torrents. Read it), and the most popular…
-
Removing user list on Ubuntu Karmic log-on screen
This doesn’t work any more Install XDM instead. ;) Karmic ships with a new version of GDM (2.28) which is rewritten, and by default presents a list of usernames, in much the same way as XP does by default. Lots of people dislike this. It’s also currently lacking a graphical config tool (it is in…
-
mknod
mknod has eluded me for a while. I’ve had to use it a couple of times, in rushed following of tutorials, and I know it’s used to create the device files under /dev. It’s not the preferred way of doing it (which is mkdev), and it’s not the normal way (udev and/or devfs tend to…
-
Why I use Linux
This is one of those things that’s always difficult to explain. The bits of Linux that I miss on other platforms are not things that you immediately see as being of particular importance. The best example of this is the freedom – why would I care that I’m free to do as I please with…
-
Using Synergy to share a keyboard and mouse across PCs
Synergy is a really neat way of using multiple computers at the same time, like a more convenient KVM switch (you do need to be physically close to all of them). It basically allows you to have a monitor for each PC on your desk, and one keyboard and mouse with which to monitor them.…