Arbitrary tweets made by TheGingerDog (i.e. David Goodwin) up to 17 August 2012
Continue reading “Automated twitter compilation up to 17 August 2012”
Linux, PHP, geeky stuff … boring man.
Arbitrary tweets made by TheGingerDog (i.e. David Goodwin) up to 17 August 2012
Continue reading “Automated twitter compilation up to 17 August 2012”
I’ve had my Nexus 7 tablet thing for about a week now, here are some of my initial findings :
The BBC has this article today about the value of “facebook likes’ – see http://www.bbc.co.uk/news/technology-18813237
I’m not overly surprised, as :
So, David’s 2p:
However, I suspect if I visited a new website/shop and saw it had N thousand likes, I’d be far more inclined to buy from it than a website with only a handful of likes.
Hmm.
Scenario – one Linux box runs multiple Postfix instances. By default they all log to /var/log/mail.log which makes it difficult to see what’s going on without using grep and so on. The server already uses rsyslog, and Postfix is configured to specify a syslog_name to each instance.
i.e /etc/postfix-blah/main.cf contains “syslog_name = postfix-blah”
rsyslog allows you to specify filters / expressions on what is logged where. This can be done on either the program name (:programname) which corresponds to postfix’s syslog_name, or the contents of the log message (:msg) itself.
So, the easy solution is :
:programname, contains, "postfix-blah" -/var/log/mail-blah.logThe leading : is important in the rsyslog rule.Â
And obviously the ‘-‘ before the file path is useful for performance – so a sync isn’t called after each write.
So, it’s just a case of populating your /etc/rsyslog.d/postfix-domains.conf file with multiple lines looking like the above, but obviously different for each domain.
I had an annoyance where varnish proxy infront of a LAMP server and the LAMP server therefore thought all clients were from the varnish proxy – rather than the client’s real IP address – i.e. $_SERVER[‘REMOTE_ADDR’] was set to the IP address of the Varnish proxy and not that of the client’s actual IP address.
Obviously, Varnish adds the X_HTTP_FORWARDED_FOR HTTP header in when a connection comes through it; so my initial thought was to just overwrite PHP’s $_SERVER[‘REMOTE_ADDR’] setting. A bit of a hack and annoying – as I’d need to fix all sites, or have some sort of global prepend file (which is horrible).
I then discovered something which sorts the problem out  – RPAF
Arbitrary tweets made by TheGingerDog (i.e. David Goodwin) up to 16 June 2012
Continue reading “Automated twitter compilation up to 16 June 2012”
Some random hints :
When looking at the various boxes we have in our office, I found one server had the following (run dumpe2fs /dev/whatever1):
Interestingly when I did run fsck on it, there were no errors. Is perhaps the default ext3 setting of checking every 20-30 mounts too paranoid? Â It’s certainly very painful running fsck on large ‘rotating’ volumes – waiting over an hour for a server to come up is not fun.
Today, my sed kung-foo seemed to be lacking, so I ended up having to split the sed command over a zillion lines…
Normally I’d do something like :
sed 's/foo/bar/g' tmp.txt > tmp2.txt sed 's/fo2/blah/g' tmp2.txt > tmp3.txt
But this obviously gets painful after a time, a different approach would be to use sponge where we can do :
sed 's/foo/bar/g' tmp.txt | sponge tmp.txt sed 's/fo2/blah/g' tmp.txt | sponge tmp.txt
Whereby ‘sponge’ soaks up standard input and when there’s no more, opens the output file. This gets around the obvious problem that :
sed 's/foo/bar/g' tmp.txt > tmp.txt
doesn’t work because the shell opens (and overwrites) tmp.txt  before sed’s had a chance to do anything.
Arbitrary tweets made by TheGingerDog (i.e. David Goodwin) up to 01 June 2012
Continue reading “Automated twitter compilation up to 01 June 2012”
I keep forgetting these one line OpenSSL commands – perhaps if they are here, I’ll remember —