So, one of my office servers was misbehaving – and random crashes finally tipped me over the edge.
Read on a blurb of text about buying an ancient computer from ebay and some uninteresting pitfalls encountered.
Linux, PHP, geeky stuff … boring man.
So, one of my office servers was misbehaving – and random crashes finally tipped me over the edge.
Read on a blurb of text about buying an ancient computer from ebay and some uninteresting pitfalls encountered.
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 give totally even distribution.
Finally, I discovered ‘shuf’ — usage like :
shuf -i 1-100 -n 1
-i RangeFrom-RangeTo
-n how many
So –
RAND=$(( shuf -i 1-10 -n 1))
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).
Continue reading “ack-grep config – ackrc – adding new file types”
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….
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 of having two monitors to stare at, I thought it was perhaps time to move up to 3 (or more).
Continue reading “More monitors.”
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:
Continue reading “BTRFS gotchas… (balance / scrub / snapshots / quota)”
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 up moving to the latest-and-greatest squid (3.4.9 at the time of writing) and getting that to work. Brief notes follow.
Continue reading “Squid 3.4.x for with transparent ssl proxying/support for Debian Wheezy.”
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]
Continue reading “Postfix – connect from unknown[ip.address]”
Some random useful things for Ansible users:
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. )
Add /etc/profile.d/proxy.sh
containing
export http_proxy=http://192.168.0.1:3128
Add /etc/apt/apt.conf.d/99HttpProxy
containing
Acquire::http::Proxy "http://192.168.0.1:3128";
Edit /etc/wgetrc
and add
http_proxy = http://192.168.0.1:3128
(some system commands rely on wget, and may not otherwise use an environment variable, e.g. debootstrap; the http_proxy setting should be present by default but commented out).
(This is all, in a round about way, relayed to the http proxy security vulnerability announced in July 2016 – see httpoxy.org for more info)