HOWTOs

I've written about bash quoting before, and yes, it's about as exciting as watching paint dry or listening to the corn grow. It can also be extremely frustrating when it doesn't do what you want, case in point: trying to script the updating of a field in a mysql table when the field to be changed contains quote characters.

It's fairly simple to find large files on your system using commands such as find, but if you're looking for directories over a certain size find won't help you. The Perl script presented here can help you track down those explosively large directories.

As I've mentioned before I'm an openSUSE user, and as long as they don't make the "U" lower case again, I'll probably stick with it. When it comes to package management, OpenSUSE and SUSE Linux Enterprice (and SuSE before them) are usually associated with YaST (and yes, I'm still waiting for them to upper case the "a"). YaST works well but it's a bit verbose for installing a single package, and of course that's just more fodder for the apt-getters with all their apt-get install this and their apt-get install thats. And you can't argue with them, but there are other options with openSUSE: yum and apt4rpm come to mind, but the preferred solution is zypper.

In the last release of Ubuntu (9.04) the Ctrl+Alt+Backspace key sequence normally used to kill the X server was disabled by default. Apparently many people like to kill their X server this way so a workaround "dontzap" package was used to enable it. With the latest Ubuntu release (9.10, aka Karmic) it's even simpler to enable it.

Sometimes when you're watching online videos on youtube or other sites, you want to save some of them for later offline playback. You've probably heard of Firefox extensions like DownloadHeloper that can do this, but sometimes you may only have a bare version of Firefox, or perhaps a different browser, one that doesn't have a plugin for doing this. Using the tip below, you can save videos no matter what browser you're using.

I usually lock my screen when I leave my cubicle for a tea-break etc. With all the talk of saving energy these days I've disabled screen-savers on my system. Still, when I'd lock my screen I noticed that the LCD didn't turn off completely. Wanting to go as green as I could I wanted to switch off the LCD as well.

In Part I we tested out Android on VirtualBox. Now we'll try running Palm's WebOS as a Virtual Appliance.

This article assumes that you are using:

If you don't want to step up to a full monitoring solution such as Nagios you can create your own scripts for monitoring the things that you want to monitor, such as disk space. The following script alerts you when your root partition is almost full:

With Google and Verizon recently announcing that several Android phones will be coming out on their network, a Linux lover might have smartphones on the brain.  Obviously, having Linux running on your phone is awesome, but which Linux OS should you choose? AndroidWebOS?  Maybe even

Now that summer is over and your digital camera is full of pictures, how do you get them organized? At the command line of course! The script provided here automatically organizes them into sub-directories by date.

Everybody's seen redirection in bash commands, that's pretty common, but bash also allows you to define redirections when you define functions. This causes the redirections to be evaluated/executed whenever the function is called. This feature doesn't really give you any new features, just another way to express existing features.

In diff tool speak, a visual diff tool is a GUI application. Meld is such a tool: a tool for displaying differences between files (and directories) and also for merging the differences. Meld is programmed in Python.

Like other word processes, OpenOffice.org Writer makes creating tables of contents (ToCs) quick and easy. Unfortunately, it also works with unaesthetic defaults and allows you to make choices that complicate your work flow rather than improving it.

Fortunately, Writer is also flexible enough to allow you to produce useful, aesthetic ToCs if you follow a few basic steps.

If you saw yesterday's Tech Tip and were looking for more on using TCP/IP with bash's built-in /dev/tcp device file then read on. Here, we'll both read from, and write to a socket.

Most of us default to wget, curl, netcat and others when in need of network data from the commandline, not knowing, or perhaps forgetting, that bash often provides the support that we need using redirection from /dev/proto/host/port.

I don't do a lot of audio/video stuff with my system, but the other day I had the urge to see if there was some voice synthesis software available on Linux and it turned out that I already had it installed: it's called Festival. Turns out there are a number of voice synthesis and analysis packages available.

If you need a quick web server running and you don't want to mess with setting up apache or something similar, then Python can help. Python comes with a simple builtin HTTP server. With the help of this little HTTP server you can turn any directory in your system into your web server directory. The only thing you need to have installed is Python.

If you're a Vonage user and you'd like to keep tabs on your bill as the month progresses, the script described here can help. The script uses curl to login to your Vonage account and download the web page with your current balance. The balance is then extracted using grep and sed.

Shell Scripts are very useful but not all that fun to look at. They have simple user input and output text. But, there is a way to spice up your scripts and make them a bit more eye catching with a simple program called "Figlet".

Bash functions, unlike functions in most programming languages do not allow you to return a value to the caller. When a bash function ends its return value is its status: zero for success, non-zero for failure. To return values, you can set a global variable with the result, or use command substitution, or you can pass in the name of a variable to use as the result variable. The examples below describe these different mechanisms.

Syndicate content

Newsletter

Each week Linux Journal editors will tell you what's hot in the world of Linux. You will receive late breaking news, technical tips and tricks, and links to in-depth stories featured on www.linuxjournal.com.
Sign up for our Email Newsletter

Tech Tip Videos

From the Magazine

December 2009, #188

If last month's Infrastrucuture issue was too "big" for you then try on this month's Embedded issue. Find out how to use Player for programming mobile robots, build a humidity controller for your root cellar, find out how to reduce the boot time of your embedded system, and if you're new to embedded systems find out the basics that go into one. You can also read about the Beagle Board, the Mesh Potato and a spate of other interestingly named items. And along with our regular columns don't miss our new monthly column: Economy Size Geek.


Read this issue