Skip to main content
I'm streaming on Twitch right now. You should stop by. Let's go!

Tagged: shell

  • 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 a simple shell script that handles most of that nasty business for you.  …

  • 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 it up and rebuild it with ease, thanks to the virtualization capability of Oracle's VirtualBox software. This is my recipe (of sorts) for building your very own.  …

  • 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, I wound up going with a Makefile, to be parsed and executed by the GNU make application. The result is an incredibly convenient automated build that minifies my Javascript/CSS (thanks to reducisaurus), and creates a version-appropriate archive of my plugin.  …

  • 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.  …

  • Kill all shared memory segments in Linux


    See update below. 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.  …

  • Send XMPP messages with Perl (from the command line, too!)


    I had been looking for a small, simple utility for Windows that could send XMPP messages from the command line for use in various automated tasks and notification processes. I came across sendxmpp as part of the CygWin installation, but could not successfully install its dependencies with CygWin's CPAN port. I've been playing around with the Net::XMPP Perl library, and in spite of its poor documentation, I decided that I was going to hack away with it until I got something usable. I'm a programmer, after all—if a utility I need doesn't exist, why not make it myself?  …

  • 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/phpmyadmin/scripts/setup.php. The file had apparently been given the file permissions mask of "000", which essentially denies any sort of action being taken against the file. "No problem," I thought, "I'll just chmod it to allow deletion and be on my merry way!" Well… it was a problem.  …

  • 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 take a bit more work.  …

  • 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 flag is for "human-readable format", and d 1 tells the program to go "no deeper than 1 level from the given folder". (With no folder specified, the current directory is used.) The following string of commands can be used to not only list the immediate sub-directories of the current directory, but also print their size in human-readable format (kilobytes): du -sh `ls -l | grep '^d' | awk '{print $9}'` Here's how it works:  …

View all tags