Drew Webber (mcdruid) is a UK Drupal developer, PHP programmer and linux sysadmin. This is his website.
Sometimes it's handy to have local DNS entries, for example when you're working on a copy of a site on your local machine - perhaps via a VM, vagrant, lxc or docker. A simple way of doing this is to add entries to your hosts file e.g.:
# local site 127.0.0.1 dev.mcdruid.co.uk
If you find yourself stuck trying to login to an lxc container because you've forgotten the password, here's a simple fix.
With the container stopped, on the host machine (assuming it's ubuntu - other linux flavours may vary slightly), navigate as root to:
Then edit the shadow file (perhaps make a backup first), and remove the hash which corresponds to the user's password, leaving the separating colons in place e.g.:
This is a simple trick which (unless my googlefu simply failed me) I didn't find described anywhere when I had a quick look:
$ drush ev '$file = file_load(21749); var_dump(file_delete($file, TRUE));' bool(true)
I have an Ultrasport NavRun 500 which is quite a decent GPS watch for running, but has a couple of software limitations - especially from the point of view of a linux (or mac) user. It uses a proprietary tkl file format which doesn't seem to be natively supported by GPSBabel.
Cache invalidation is known as one of the very few hard things in computer science.
It seems to be a common misconception that Drupal's cache_get checks whether a given cache entry has expired, and won't return a stale result. In fact, in Drupal this is not always the case.
Quite some time ago I wrote a post about how patching makes you feel good in which I talked about the motivations for, and benefits of submitting patches on drupal.org (d.o). I concluded by suggesting that project maintainers should be generous in recognising the efforts of those who submit patches.
I was struggling with jmeter running out of memory when doing some load testing, and almost all of the instructions I found about how to increase the java heap size and give jmeter more memory were for windows, and talked about editing a jmeter.bat file which I do not have on my ubuntu (10.04 LTS) machine.
Other posts suggested setting various environment variables (e.g. HEAP or JVM_ARGS), but these didn't seem to work for me.
I was using the brilliant context module in a project recently. The fact that it uses ctools means it has a few characteristics reminiscent of views (and panels). One of these is the import / export functionality, and the distinction between the different types of storage for the contexts you've set up - i.e.
In general I'm a happy vim user, but now and again I am asked why I'm using such an antiquated environment. Editor preference is of course a topic over which many long and pointless arguments have been waged - often from intractable dug-in positions of dogma. I think it's good to poke your head above the trench occasionally and see what else is available.
There are some great articles and resources out there on the interweb about using font stacks in your CSS to ensure your site has the best chance of working well and looking as it's intended to on any combination of browser and operating system / device you can throw at it.
However, a site I worked on recently used the font all designers love to hate: Comic Sans. Almost all of the advice I could find about this font went along the lines of "it's rubbish - don't use it" (that's the polite version, obviously).