You are here

linux

Stopping apparmor blocking firefox from reading local files in /var/www/

After a recent OS upgrade I was trying to upload a patch to an issue on drupal.org and encountered a strange error message.

It was very similar to this one on a vanilla Drupal 7 install:


An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (100 MB) that this server supports.

Tags: 

DNS entries for local development using dnsmasq

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

It can be a bit of pain though having to set one - or sometimes more - of these up for every new site you work on.

How to reset the password for an lxc container

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:

/var/lib/lxc/$container_name/rootfs/etc

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.:

ubuntu::16372:0:99999:7:::
Tags: 

increase the memory allocated to jmeter in ubuntu linux

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.

comparison of compression methods for database dumps

I like to have automated daily database backups set up on my servers - for those hosting relatively small sites, the database dumps can usually be compressed down small enough to be sent as an e-mail attachment by the cron script which does the database dump. This is a really simple and cost-effective way of having offsite backups which provide daily snapshots of sites which are easy to access if anything goes wrong.

installing subversion and vim on a shared host

I haven't used shared hosting for quite a while, but for a few sites I've worked on recently an account on a shared host seemed the best choice in terms of how much disk space and bandwidth they'd get for a very small cost.

One obvious problem with shared hosting though is the lack of control; I was careful to choose a package which provided up-to-date versions of apache, php and mysql but subversion was not installed, and the version of vim on the server didn't have support for some basic things like syntax highlighting.

installing PECL upload progress on ubuntu server

Some of Drupal's CCK modules such as filefield and imagefield have support for a neat Upload Progress meter.

You may have seen a message in the status report of your Drupal site saying something like... "Upload progress not enabled - Your server is capable of displaying file upload progress, but does not have the required libraries. It is recommended to install the PECL uploadprogress library (prefered) or to install APC."

handy bash, vim and screen configurations

Here are some useful configurations for bash, vim and screen. Every time I have to set myself up on a new machine, I end up copying these files from a machine where I've already got an account. I thought perhaps it'd be easier to put the settings on a webpage. If anyone else finds these useful, that's a bonus.

~/.bashrc

(snippet, not the whole file)

one liner using xargs to automate a repetitive task

This article illustrates using the *nix commandline to chain several commands together to automate a repetitive task - in this case preparing some drupal modules into neatly labelled directories.

The example here covers quite a few different useful commands and commandline techniques, which we can't really hope to cover in exhaustive detail; there's plenty of good documentation out there for everthing we mention.

running herbert under wine on linux

After a while using hddtool to manage our Philips HDD120 audio player, I discovered herbert. This is an open-source application written in C#. It's usually run in windows using the .NET framework. I wanted to be able to manage the player from linux - I've now found a way to do this, and I'll explain how.

Subscribe to RSS - linux