Andy Phillips
I recently wanted to use flowtype.js with wordpress to create a liquid layout for the text as well as the images. Integrating it required a bit of research into how to load javascript into wordpress the ‘correct’ way. Here’s how it fits together. flowtype.js (http://simplefocus.com/flowtype/) is a lovely way to scale font size in a responsive way to ensure readable blocks of text. It allows capping of the maximum and minimum font size and allows you to control the steepness of the scaling curve.
2016-03-09
4 min read
We recently upgraded to Zimbra 8.6 from 8.0.7. We hit a problem that not even zimbra support was able to figure out. Perhaps its that our Zimbra instance has been upgraded since version 3 (or 4) but it got into a bad state whenever we tried to update the proxy. Here’s the solution. First the problem; $ zmproxyctl status zmnginxctl is not running $ zmproxyctl restart Stopping nginx...nginx is not running. Starting nginx...nginx: [emerg] invalid port in upstream "mail.
2016-02-29
4 min read
I had high hopes for BTRFS. The brochure was very enticing. Checksums, snapshots, disk management… all good things for someone who fondly remembers the digital advanced file system. Unfortunately the brochure describes something that right now is a construction site. Lately I’ve been getting really disenchanted by it. There are several reasons for that, but the general bugginess and instability is the main reason my enthusiasm is waning. At home I have several filesystems on several hosts that all run BTRFS and filesystem problems are a common occurrence under both light and heavy loads.
2015-01-03
7 min read
So, going back and fixing up auth on our few remaining older systems (centos 5, not internet facing) came across the error below. Solution was beautifully non obvious, so it goes here in the external memory pack. yum --enablerepo=my-repo-x86_64 list updates Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: a.centos.mirror * epel: another.centos.mirror * extras: and.a.further.centos.mirror * updates: centos-updates.co.uk my-repo-x86_64 | 2.9 kB 00:00 my-repo-x86_64/primary_db | 7.1 kB 00:00 http://myreposerver.internal.domain/my-repo/repodata/7d1016c9fcac64ee6c0fe9b5b\ 58ed1e791dae601b1b0be13ea8af523761fbabd-primary.sqlite.bz2: [Errno -3] \ Error performing checksum Trying other mirror.
2014-09-29
1 min read
This caused me to waste 1/2 an hour or so this morning. It also needed some quite precise google-fu to uncover the solution. I’m bound to forget this and am likely to need it again so it’s going here. I’m not sure how most of the zillions of “upload multiple files with php” tutorials out there work, because none of them seem to mention this. I was doing multiple file uploads in php, and finding that although you submit multiple files with a multipart/form-data encoding type (and can see multiple files being submitted in chrome devtools), php was only reporting the last one in the list of uploaded files in $_FILES.
2014-09-08
2 min read
We were tracing a problem with occasional latency spikes on one of our systems the other day. The cause was rather unusual. The write load was not high, being a few megabytes per second at peak on an otherwise completely idle disk. We checked for the usual hardware issues; cache batteries, failing disks as well as other programs writing to that disk, but came up empty. Fairly regularly we saw a write latency of up to 40ms.
2014-09-01
12 min read
In 2011 I put out an example php class that could be used to talk to the LMAX API protocol. It was incomplete and for illustrative purposes only. It remains that way. Over the years however there have been some improvements and it can now be used for placing, closing and cancelling orders. I’ve made the latest version available on github, just in case the handful of people who have contacted me over the years about it find it useful to have the latest version.
2014-05-14
5 min read
I took the time to start using Mike’s HDR histogram port to C the other day. It was pretty painless to use, once I’d overcome a couple of initial problems. One of which is that the C compiler I have on CentOS 6.4 was too old. So I came up with a workaround for older compilers/machines. HDRHistogram is Azul’s high dynamic range histogram. The readme on github explains what it is. Suffice it to say that I’m in the process of dumping the various implementations of histogram code I’ve evolved over the years in favour of this for latency and performance management.
2014-03-26
3 min read
Last week we had several reports of disconnections to some of our haproxy fronted services after we upgraded to a longer/stronger SSL certificate. As the version of haproxy we are running is quite old, we tried an upgrade to the latest (dev21). This fixed the disconnections, but after a few packets, it reliably crashed on the production systems. However we could not repeat the problem on any test or development systems, even through kickstart and puppet ensured they were identical to production.
2014-01-31
9 min read
Some of these are hard to google for and I’ve used more than once now, so to save time I’m bookmarking them here. Setting watch points in gdb Displaying the whole string in gdb Setting gdb to break at a particular file/line Setting the coredump limit of a running process to catch a core None of this is rocket science, but still useful. 1) Watchpoints Setting a watchpoint; (gdb) watch mm_dictionary.mmdict_head->index Hardware watchpoint 3: mm_dictionary.
2013-12-12
2 min read
This should be a simple enough job - after all ‘it works on ubuntu out of the box’ (tm). Take the USB printer and move it onto the home server running Centos 5.9, so that I can share it with the mrs’ macbook and my desktop/laptops etc. Here’s the hurdles encountered and the fixes, so my future self won’t have to waste time on this again. First problem. On Centos, the printer - an Epson SX218 inkjet printer is not recognised.
2013-09-01
4 min read
These are really interesting/useful for explaining how the code that executes isn’t the code you wrote as well as making you think about performance. A good example is the last one. As Mr Sutter explains, the swap from 80’s architectures such as the VAX to modern systems was accompanied by a real change in speed of processor but without a large change in memory latency. As a result “elegant” algorithms that were right for 70s and 80s hardware are totally wrong for modern cache laden systems.
2013-08-04
1 min read
I’ve helped out a friend with their website recently, and it made me realise how difficult technology can still be for people who don’t do this on a daily basis. Even smart people - she has a background as a professional scientist, artist and now successful businesswoman - can still require help with what on the surface appears to be the simple task of moving a website created on her mac using MAMP to the hosting company.
2013-06-15
9 min read
A quick post. We have some home made cheapy frankenstorage, thats based around a low end celeron class desktop CPU. This is fine for moderate raid work, but recently I had to shovel a few terabytes between them, over the network. Making that run quickly enough led to a bit of experimentation with the speeds of the different ciphers. Normally I’d reach for nc at this point and run something like this on the sender
2013-06-15
2 min read
Some times its hard to find a way of explaining to the technically less literate the power that the Unix shell hands you. The original ideas behing the combination wordprocessor and programmers work bench combined with the power of pipes make text processing easy. So to today’s problem - analysing GC logs for latency spikes. As we run the jvm with the following properties; -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -XX:+PrintTenuringDistribution -Xloggc:/path/to/gc.logfile The output looks like this;
2013-04-18
3 min read
I settled on piwigo for a web photo gallery, after the demise of ZangZing. I looked at the others and I’m aware that most people use twitbook for sharing family photos, but I don’t really trust them with my data in the long term. Plus I’m just too much of a DIY dinosaur to use any of the modern trendy sites like candygram or whatever. So here’s a short list of pitfalls I encountered whilst getting piwigo up and running, including video.
2013-02-24
3 min read
Tinola was off the air for a couple of days due to a double fault. By which I mean I lost the primary and backup systems in the same powercut. Arguably they should have been in different datacentres. Nonetheless its unusual to get that unlucky, and now I’m considering how to move forward on the hosting front. The new server is smaller than the old one, and after restoring from backup, getting Zimbra up and running required some manual tweaks.
2012-07-14
2 min read
It is hard to let things go sometimes. Porting Linux to the VAX architecture taught me a lot about the detail of how Linux works, as well as how computer hardware and operating systems interact. It both removed the air of mystery about the kernel, and opened my eyes to the complexity of the GCC compiler and toolchain. The VAX architecture is simple and easy to understand for a beginner - so much so, that when I started there were several good computer science text books which used it as a teaching system/example.
2012-06-04
7 min read
Some aspects of linux have the reputation of being hard. Traffic control via queueing disciplines for bandwidth management for example. Even the title is enough to strike fear into the heart of a seasoned system admin. Which is a pity really, as the things outlined in chapter 9 of the lartc are very useful in practise. The problem is the documentation is very descriptive - which is good once you know roughly what you’re doing - but which has quite a steep learning curve if you don’t.
2012-01-30
11 min read
We had to clean up some left over cgroups after another set of experiments with LXC.The guys doing it encountered problems, as the logic is the opposite of what you expect from your experience on a normal unix filesystem. Specifically the problem happens when you have a nested cgroup - for example /cgroup/foo/bar/ The problem happens because this is a virtual filesystem with its own rules. If you create a cgroup (in this case we’ll just mount the net_cls cgroup because its smaller)
2012-01-19
3 min read
While setting up rhoda’s blog on tinola I came across a couple of hurdles converting from one site to multiple sites. The pivotx manual helps with a section on running multiple websites. But not everything works that smoothly. So, here’s what I needed to do to make it work. Firstly, make the “sites” directories for the current and new blog(s) # go to the pivotx subdirectory of the root of the pivotx installation cd /var/www/blog/pivotx # make the sites directories mkdir -p sites/blog.
2011-12-03
3 min read