Posted by Derek@TheDailyLinux in
Tutorials and Guides »
Add Comment »
Here’s how to install shell-fm as tested on Fedora 13. shell-fm is a great little command line tool that will play last.fm radio and even has some features that last.fm doesn’t have (artist autoban, no advertisements, and more). You can read more about it here. Alright, let’s get to the install instructions!
[Read more →]
Posted by Derek@TheDailyLinux in
Tips and Tricks »
Add Comment »
The utility aspell (along with others such as spell and hunspell), can be used to spellcheck a file from the terminal. You can also specify a file “mode” for which to scan. Modes include plain text, HTML, sgml, LaTeX, and others.
Usage Example
To list all of the spelling mistakes of the file “testfile.txt”, use:
aspell list < textfile.txt
To list all of the spelling mistakes of the HTML document “testpage.html”, use:
aspell --mode=html list < testpage.html
As always, be sure to take a look at the man pages for more information. Keep in mind that certain distributions may not come with aspell pre-installed, so you may need to use the package manager to install it (ie. apt-get install aspell or yum install aspell).
Posted by Derek@TheDailyLinux in
Tips and Tricks »
Add Comment »
It’s fairly common to edit the /home/user/.bash_profile file to setup a custom environment, such as alias and startup applications, for user, but what if you wanted that profile to be the same for all users (including root). The best way is to use a custom script that resides in the /etc/profile.d/ directory. This process is described briefly in /etc/bashrc:
# /etc/bashrc
# System wide functions and aliases
# Environment stuff goes in /etc/profile
# It's NOT good idea to change this file unless you know what you
# are doing. Much better way is to create custom.sh shell script in
# /etc/profile.d/ to make custom changes to environment. This will
# prevent need for merging in future updates.
Here is a quick example for taking advantage of this hook which assigns a simple alias. First, you must setup /etc/profile.d/custom.sh:
/etc/profile.d/custom.sh
chmod +x /etc/profile.d/custom.sh
Second, you must created the contents of /etc/profile.d/custom.sh:
#!/bin/sh
alias ls='ls -lah'
Third, simply log out and then back in again. You’ll notice the changes. You can verify this particular example by using the alias command:
$ alias | tail -n1
alias ls='ls -lah'
$
Of course, you’ll want to take what you’ve learned above and run with your own script suited to your needs. I hope this has helped you achieve your goal of creating a universal profile for all users on the system.
Posted by Derek@TheDailyLinux in
Uncategorized »
Add Comment »
I’d like to take a break from our regular content to (re)introduce the Cardiac Computer. This is an old school cardboard computer that taught how CPUs/computers actually function. I’d really enjoy getting my hands on one of these (apparently, you can still buy them)! Be sure to check out the wiki page for more information.

More pictures here:
http://www.porticus.org/bell/belllabs_kits_cardiac.html
Posted by Derek@TheDailyLinux in
Tips and Tricks »
Add Comment »
Let’s get right to the point. Here’s how to install .rar support in Fedora 13:
1.) Open the terminal
2.) Copy/Paste the following into terminal
su -c 'rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'
su -c 'yum install -y rar unrar'
3.) Refer to the following pages for usage
Create/Compress/Archive Almost Any File in Linux (tar, tar.gz, tar.bz2, gz, bz, zip, 7z, rar, etc…)
Extract/Uncompress/Unarchive Almost Any File in Linux (tar, tar.gz, tar.bz2, gz, bz, zip, 7z, rar, etc…)
P.S.
For those die-hard one-liner fans out there, you can use the following instead:
su -c 'rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm && yum install -y rar unrar'
Posted by Derek@TheDailyLinux in
Scripting »
Add Comment »
A valuable tool when developing and debugging scripts is set. In particular, the -x or -xtrace options of set will “print a trace of simple commands and their arguments after they are expanded and before they are executed”. Here’s an example of using set -x:
Script
$ cat setx.sh
#!/bin/sh
echo "Hello There!"
echo "Here's the date..."
set -x
date
echo "Also, a calendar..."
cal
echo "Bye!"
$
Execution
$ ./setx.sh
Hello There!
Here's the date...
+ date
Sun Aug 8 21:33:03 MST 2010
+ echo 'Also, a calendar...'
Also, a calendar...
+ cal
August 2010
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
+ echo 'Bye!'
Bye!
$
Be sure to check out the man page for even more useful options of set.
Posted by Derek@TheDailyLinux in
Software »
1 Comment »
As of Fedora 13, the package mysql-gui-tools is no longer available (replaced by mysql-workbench; see this page), so we’ll have to do things the hard way by digging into the archives over at http://dev.mysql.com. It’s not all that tough, but there are some issues currently (see end of post). I would like to ask others to provide any insight to the issues. So, for now, I present the beginnings of how to install MySQL Query Browser on Fedora 13…
Open the terminal, login as root with ‘su’, and copy/paste the following commands:
<br />
wget http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-gui-tools-5.0r12-linux-i386.tar.gz/from/http://mysql.he.net/<br />
tar xzvf mysql-gui-tools-5.0r12-linux-i386.tar.gz -C /opt<br />
cp /opt/mysql-gui-tools-5.0/MySQLQueryBrowser.desktop /usr/share/applications/<br />
A menu link to the program should be available under “Applications -> Programming -> MySQL Query Browser“, however if you want to run it from the terminal, use the following commands:
<br />
PATH=$PATH:/opt/mysql-gui-tools-5.0/<br />
mysql-gui-tools<br />
Now, if your luck is anything like mine, you’ll notice that if you run the program from the command line, you’ll get the initial setup window (strange looking, like theme isn’t being used), then an error message, then nothing happens after filling out the setup information. The error message will probably look something like:
<br />
[root@localhost ~]# /opt/mysql-gui-tools-5.0/mysql-query-browser<br />
/usr/share/themes/Clearlooks/gtk-2.0/gtkrc:55: error: unexpected character `@', expected string constant<br />
Fontconfig warning: "/etc/fonts/conf.d/65-fonts-persian.conf", line 190: invalid match target "scan"<br />
Fontconfig warning: "/etc/fonts/conf.d/65-fonts-persian.conf", line 199: invalid match target "scan"<br />
Fontconfig warning: "/etc/fonts/conf.d/65-fonts-persian.conf", line 208: invalid match target "scan"<br />
Fontconfig warning: "/etc/fonts/conf.d/65-fonts-persian.conf", line 217: invalid match target "scan"<br />
Fontconfig warning: "/etc/fonts/conf.d/65-fonts-persian.conf", line 226: invalid match target "scan"<br />
Fontconfig warning: "/etc/fonts/conf.d/65-fonts-persian.conf", line 235: invalid match target "scan"<br />
Fontconfig warning: "/etc/fonts/conf.d/65-fonts-persian.conf", line 244: invalid match target "scan"<br />
Fontconfig warning: "/etc/fonts/conf.d/80-delicious.conf", line 17: invalid match target "scan"<br />
Fontconfig warning: line 73: unknown element "cachedir"<br />
Fontconfig warning: line 74: unknown element "cachedir"<br />
This is actually where I need your help. Does anybody have any ideas? My thought is that symbolic colors were introduced in GTK+2.10 and the mysql-query-browser doesn’t expect symbolic colors, so it throws an error message and messes everything up. However, I wonder if it doesn’t matter since it’s only the appearance of the window. This shouldn’t cause the program to stop working. Maybe it has something to do with the font warnings? But wait, when have warnings ever stopped a program from running?
Anyways, if anybody out there can offer some advice, it would be much appreciated by myself and readers (I’m sure). If it’s just not going to be possible, I’ll remove this post from the blog to avoid confusion (I’m sure it’s already caused quite a bit).
Source: http://dev.mysql.com/doc/query-browser/en/install-generic-tarball.html
Full list of downloads/mirrors: http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-gui-tools-5.0r12-linux-i386.tar.gz/from/pick#mirrors
Note: If ‘wget’ is not available on your system, install it with ‘yum install -y wget’ or use ‘curl url -o filename’ instead.
Posted by Derek@TheDailyLinux in
Tips and Tricks »
Add Comment »
When you’re working in an embedded Linux environment, liberal use of the sync command can be a headache saver. Here’s the thing: in most embedded systems, your OS will be running from something like an SD card or flash and you may be subject to unexpected power loss. When you’re editing files or making changes in the filesystem, some of these edits and/or changes are only written to buffer cache, not the flash disk (not yet anyways). sync will force the system to commit the buffer cache to the disk.
As always, be sure to check out the man page for more information.
Posted by Derek@TheDailyLinux in
Tips and Tricks »
Add Comment »
Simply put, perldoc is the man page of perl applications. Use it and use it often when dealing with perl utilities. For example:
perldoc open
Reveals…
System::Library::Perl:User.Contributed PeSystem::Library::Perl::5.8.8::open(3)
NAME
open − perl pragma to set default PerlIO layers for input and output
SYNOPSIS
use open IN => ":crlf", OUT => ":bytes";
use open OUT => ’:utf8’;
use open IO => ":encoding(iso−8859−7)";
use open IO => ’:locale’;
use open ’:utf8’;
use open ’:locale’;
use open ’:encoding(iso−8859−7)’;
use open ’:std’;
DESCRIPTION
Full‐fledged support for I/O layers is now implemented provided Perl is
configured to use PerlIO as its IO system (which is now the default).
...
...
Posted by Derek@TheDailyLinux in
Tips and Tricks »
Add Comment »
I’ve been on a kick recently about doing everything in the terminal and I became excited about the possibility of doing it through the terminal. I was excited until my little research on the subject revealed that this horse has been beaten left and right and up and down and diagonally. There were so many different ways of doing it, I sorta lost the urge to create a post about it. Well, here I am anyways listing the ones I found to be the most interesting. Check ‘em out if you’re interested…
http://fungi.yuggoth.org/weather/
http://linuxshellaccount.blogspot.com/2008/09/bash-script-to-get-weather-forecasts.html
telnet rainmaker.wunderground.com
curl http://weather.noaa.gov/pub/data/forecasts/city/state/city.txt