Tag: linux

A quick shell script for wine prefixes

Wine, the Windows emulator-that's-not-an-emulator for Linux distributions, has a way of maintaining separate Windows systems using the WINEPREFIX and WINEARCH environment variables. While it's a powerful mechanism, it's not so handy to type it all in on the command line over and over. To that end, I have whipped up …

Continue reading

Resilient Ubuntu boot-to-RAM USB stick (Ubun2RAM) - Updated for 13.10

I love my little-engine-that-could media server machine. It runs incredibly well on hardware from at least two generations ago; it is completely headless; the entire system loads itself into RAM in the form of a compressed file system; it all fits onto a bootable USB stick; and I can back …

Continue reading

WordPress plugin minify Makefile

While working on my first commercial WordPress plugin, the need for build automation finally struck me. The environments in which I do my most development are all driven by Linux, and so I wanted to use a tried, true, and ubiquitous build automation mechanism to fulfill my need. As such …

Continue reading

Using cURL for parallel PHP without pcntl_fork

So, you want to do some parallel processing in PHP (alliteration FTW!), but your service provider does not grant you access to the pcntl family of functions*. What do you do? If you're in a *nix environment with access to the curl command line application, then you get creative.

First …

Continue reading

Kill all shared memory segments in Linux

I recently whipped up a shell script to kill all (IPC) shared memory segments in Linux for a client on oDesk.com. He wound up going with another contractor's offer, and so I figured I would post my script here for the benefit of all.

1
ipcs -m | cut -d …
Continue reading

Help! I can't delete phpMyAdmin's setup.php

I've got a VPS server running Debian 5 "lenny" and recently attempted to perform several software upgrades to bring it up to speed (it had been longer than I care to admit). However, the upgrade for the phpMyAdmin package continually failed, stating that it was unable to remove /usr/share …

Continue reading

Backup automation and emailing attachments in Linux

Any programmer who's ever been burned by data loss can tell you—you've got to have backups of your work. If it's code, perhaps they use a version control system such as Subversion. If it's something a little less-readily available, such as a weekly database text file dump, it might …

Continue reading

Linux: Get size of sub-directores in current directory

Edit: Now that I'm more familiar with the Linux command line, I realize that I was trying to reinvent the wheel. I don't know if I missed this part of the du manpage or what, but the functionality I was looking for is baked in:

du -hd 1

The h …

Continue reading