linux

Control memcached from the command line  bash

memcached is a general-purpose distributed memory caching system originally developed by Danga Interactive for LiveJournal but now used by many other sites. It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the number of times an external data source (such ... More

Find all files containing a given string  bash

A quick one-liner to recursively search files for a given text string. Open up a terminal session and enter the following - replacing "foo" with the text to search for. find . -exec grep -l "foo" {} \; You can also limit the search to files with a particular extension (e.g. HTML or ... More

Kill unresponsive applications on Linux

Sometimes things go a bit wrong. Sometimes they go very wrong. XKill is a simple little application that allows you to kill a running X application that has got out of kilter. Think of this as a quick way to get back control of your Desktop. More

Change the 'Desktop' directory on Linux

On desktop setups where icons are shown on the desktop these are normally taken from the specific folder ~/Desktop. If you find you want to show icons from either your Home or another directory for a particular install/user you can do so by editing the user-dirs config file as ... More

Collaborate in the shell with screen (multiuser)  bash

Screen is a neat little program that allows you to use multiple virtual terminals in a single session on Unix/Linux and Mac. However, it does more than just that. It can also allow you to share your current session on a machine with another user - allowing you to collaboratively ... More

Bash Command Substitution  bash

Bash command substitution performs a given command replacing the marker with the resulting standard output. It is particularly useful when you want to store the output of a command in a variable or as an alternative method of chaining multiple commands together. Bash command substitution is achieved by wrapping your ... More

Control Console with SysReq  bash

System request (often abbreviated SysRq or Sys Req) is a key on keyboards for PCs that has no standard use. This key can be traced back to the operator interrupt key of the IBM System/370 mainframe computer. But under Linux there's a bunch of useful things available via ... More

Get a list of all processes not run by you  bash

Find the currently running processes on your system that were not started by yourself. A great way to find out what is hogging your system on multiple-user setups or remote logins. Open up a terminal session and enter: ps aux | grep -v `whoami` ps aux returns (a) all processes with ... More

Get file type information from the command line  bash

Often forgotten the file command will give you a simple summary of a file's type and content. At the prompt enter file where is the name of the file you are interested in. You will receive output detailing the files contents, e.g. A Word Document.doc ... More

Install Cinnamon on Ubuntu 12.04  ubuntu

Cinnamon is a re-implementation of the Gnome 2 desktop in GTK3 developed by the Linux Mint project as an alternative to both Gnome3/Shell and Ubuntu Unity. Here we explain how to install Cinnamon on top of your Ubuntu installation, without installing Linux Mint. As with all Ubuntu unsupported software ... More

Execute last command as root  bash

Re-run previously entered command as root user. sudo !! !! is automatically substituted to the content of the previous command. Turning the above line into sudo . More

Debug GNOME Shell

Debug Gnome Shell, or run it from the console, either for plugin development or troubleshooting. Switch to the console using Ctrl Alt F1 Type "w" to find your display (usually it's :0.0) Export your display (usually with export DISPLAY=:0.0) Restart gnome shell from the console by ... More

Control-R Through Your History  bash

Interactively search through your command line history with a simple keyboard shortcut. At a new shell prompt (bash or Terminal.app on Mac) press Ctrl-R Start typing the search string to lookup in your bash history. As you type the top matching command in your history will appear. Hit Return ... More

Use screen to manage persistent sessions  bash

GNU Screen is a command-line application that allows use of multiple virtual sessions within a single real terminal or remote session. Importantly, it allows for persistent running of command-line applications independent of the shell that initiated them program, meaning active applications can persist during disconnection. More

KDE fileprotocol+transportprotocol://

While getting started using the new wp-plugins.org SVN I was looking for a quick way to download the contents of an SVN to local disk. This can be useful when doing research on methods employed by other plugins or for getting a local development copy where SVN access is unavailable. Under KDE you can normally access any remote location using the standard URL format. For example, an SVN (using the svn://) protocol would normally be accessed using the URL style svn://svn.wp-plugins.org. Many SVNs, e.g. svn://svn.kde.org can be accessed as expected. However, this is reliant on the server providing an svn:// protocol access which some do not – notably the wordpress.org SVN which instead provides access to the SVN through http:// only. In these cases you need a method for accessing svn:// via http:// ..and surprise, surprise, KDE can do that. As Sabin Iacob noted, it’s possible in KDE to provide separate file and transport protocol within a single URL. Doing this allows the filesystem to connect through one (transport protocol) and act on the result as if it were the other (file protocol). More

Apache vs. the Slashdot Effect  web

Increasing traffic is the measure of success for a website. More visitors equals more exposure which in turns generates more income. However, if you have hosted your site on a low-end package you could get hit by excess use charges just as your start celebrating your success. Here at mutube.com the combination of 4,625 visitors (8,531 hits) a month and popular free downloads quickly helped trip our 1Gb bandwidth limit. In this article I’ll look at how I’ve used the combined power of Apache Server and Coral Cache to distribute all kinds of requests away from your server transparently. More