Warning: count(): Parameter must be an array or an object that implements Countable in antispam_user_load() (line 1545 of /var/www/vhosts/cjdmax/web/sites/all/modules/antispam/antispam.module).

cjdmax's blog

Vim conceal passwords

Submitted by cjdmax on Sun, 03/15/2015 - 15:52

A short howto to get Vim to conceal passwords, while still having them selectable and copy-paste-able. You can get the passwords visible by visual-selecting them in Vim.

YMMV how well this works for you and your terminal. Please (auto)encrypt and (auto)versioncontrol your passwordfiles, to prevent mistakes. Please note your passwords may stick in clipboard managers like Klipper.

This solution uses vim modelines, syntax overrides and the conceal function in Vim.

libnss-mysql and segmentation faults

Submitted by cjdmax on Mon, 12/10/2012 - 23:49

If you're using the excellent libnss-mysql (also known as libnss-mysql-bg on Ubuntu) please, please, PLEASE read the documentation provided at their documentation pages.

You'll also note the WHERE clause contains a '%1$s'. This '%1$s' is where the system will insert the username being searched for. For getpwuid, this is a '%1$u' because we're searching based on a number (%1$u) rather than a username/string (%s). It's important to keep these correct, else things will start crashing.

If you were, for instance, to write your own SQL queries for the getpwuid portion of the config, you may make a terrible mistake. I did. You will hate yourself if you don't catch it. Everything will segfault. If you were morally so inclined this could be a 'landmine' you could leave for the next sysadmin. It is truly hell. Your initramfs generation will segfault, your ls -al will segfault... Everthing turns to shit.

Ubuntu 11.10 upgrade and kexec

Submitted by cjdmax on Thu, 04/26/2012 - 16:49

When upgrading Ubuntu (Oneiric Ocelot) 11.10 to (Precise Pangolin) 12.04 DO NOT reboot using kexec; this will lead to slowdown, lag, choppy video, keyboard and mouse movement. Do a complete shutdown -hP now shutdown and cold-boot when the upgrade program tells you to reboot.

Software versions: Kubuntu 11.10 i386 with the KDE 4.8 PPA's, upgrading with console do-release-upgrade -d

Racktables 'Free Whole U' patch

Submitted by cjdmax on Mon, 10/03/2011 - 22:16

Racktables is an old-school datacenter rack visualisation script. Doesn't really look like much, but is the (IMHO) most stable solution out there at the moment. The standard rack overview will return the net capacity of a rack, which is not very helpful; we're more interested in how many servers we can add. This function will render how may totally free U are left. The function is modeled on the standard 'getRSUforRack' in functions.php, and is integrated into the racktables interface.php in the same places.

Firefox addons for the win

Submitted by cjdmax on Tue, 07/19/2011 - 19:22

Firefox still is the best browser for powerusers, hands down.

Why yes, I am one for inflammatory statements.

Check out some of my picks

<3 jquery, autotab between fields

Submitted by cjdmax on Tue, 07/19/2011 - 19:22
$("input.ipaddressparts").keypress(function(evt) {
          if (evt.which == '46' || evt.which == '32') {  // dot or space

This piece of sheer awesomeness will skip to the next input field of a four-input IP address form. The preventDefault() prevents the space or dot from being printed. and the jquery .next command will skip to the next similar input element.

jQuery makes javascript very painless and we love it!

IPv6 on debian

Submitted by cjdmax on Tue, 07/19/2011 - 19:22
Debian syntax for adding ipv6 static addresses to an existing (ipv4) iface (in addition to SLAAC ipv6 adresses (handed out by ICMPv6) which may not be guaranteed to be static). You may not use the eth0:0 alias syntax with ipv6 apparently!
iface eth0 inet static
 # feel free to do a "pre-up modprobe ipv6" if needed
 up /sbin/ip addr add dev $IFACE yyyy:yyyy:yyyy:yyyy:yyyy:yyyy:yyyy:yyyy/zz

Promote js

Submitted by cjdmax on Tue, 07/19/2011 - 19:22
JavaScript Guide

One of the problems with javascript is that most of the web searches for documentation render bad or sub-par websites on (stuff like w3schools or other less ideal pages). PromoteJS is a mechanism (akin to googlebombing) aiming to enhance the search engine results for oft-used searches for stuff like Javascript, Javascript string and other search options.

The observant might spot that this blog entry itself is an example of this campaign...

Subscribe to RSS - cjdmax's blog