Category: linux

  • Bash random number generation

    Historically I’ve used $RANDOM as a random number source in bash — a bit like : RAND=$(( $RANDOM % 10 )) when I’ve needed a random number out of 0,1,2,3,4,5,6,7,8 and 9 one problem with this is that $RANDOM itself is populated between 0 and 32767 by the shell – so it’s not going to…

  • ack-grep config – ackrc – adding new file types

    I needed to add some more file types for ack-grep to find / search when I’m looking for PHP code that resides in files with non-standard extensions (e.g. something.def, something.inc etc).

  • MySQL Max_connections stuck on 214 ?

    I found MySQL was being annoying earlier and not ‘accepting’ my max_connections = 450 directive on a Debian Wheezy install, and being seemingly stuck on having 214 connections….

  • More monitors.

    I have an Intel NUC d54250wyk as my work computer (it’s a little dinky thing, which somehow manages to pack a reasonable punch). On board it has a mini-hdmi port, and a mini-display port – which I used for a dual monitor configuration. But two monitors is so last year …. and after 5+ years…

  • BTRFS gotchas… (balance / scrub / snapshots / quota)

    I’ve been using BTRFS for a few weeks now, and some bits are great (filesystem snapshots, dynamic resizing etc). The “Good” and “Bad” things follow:

  • Squid 3.4.x for with transparent ssl proxying/support for Debian Wheezy.

    I needed  a variant of Squid which supported transparent SSL interception (i.e via iptables redirection) so I could log outgoing HTTPS requests without the client being aware. The stock wheezy variant doesn’t support SSL (see : Debian Bug Report). Even after recompiling Wheezy’s squid3 it didn’t seem to work (perhaps my stupidity) so I ended…

  • Postfix – connect from unknown[ip.address]

    One server I poke around on, has a number of postfix instances (see: postmulti). Interestingly, one instance was logging things like : Oct 26 22:02:05 mail postfix-blah/smtpd[59158]: connect from unknown[1.2.3.4] Oct 26 22:02:05 mail postfix-blah/smtpd[59158]: CA9292EE2C0: client=unknown[1.2.3.4]

  • Ansible – some random useful things.

    Some random useful things for Ansible users:

  • Debian http_proxy setting

    Need to set a HTTP proxy within a Debian system ? Assuming your proxy server is on 192.168.0.1 and listening on port 3128, then the below may help … ( If you need authentication you can use username:password@ like you would in an old style web browser – e.g. http://username:password@192.168.0.1:3128. ) /etc/profile.d/proxy.sh Add /etc/profile.d/proxy.sh containing…

  • Installing Debian (Jessie) on an Intel NUC D54250WYK

    Product – D54250WYK / boxd54250wykh3 – via e.g. Ballicom or eBuyer It’s an Intel i5 4250U processor (dual core, laptop processor). Supports up to 16gb of RAM and the Intel 5000 graphics thing in it. The box itself is really small – and silent. A laptop size hard disk can fit into it (2.5″ hdd). Issues : BIOS needs…