STumbling In Linux Land, STupid and Unlucky Pablo? The tribulations and happy discoveries of a Linux former Newbie, now bit more experienced user
Wednesday, September 3, 2008
md3sum test in Ubuntu
md5sum filename Where: filename is replaced with the exact name of the file you want verified
Where: the file to be verified is located in your /home/username folder.
It often takes a short time, depending on the size of the file. A few minutes is not uncommon.
or:
Assumed that file.iso and file.iso.md5 are in the same folder
type in terminal: md5sum -c file.iso.md5
A tip is to use 'Tab completion' to type the filename, to do that, just type the first two or three letters of the filename to be entered rather than typing it all. Then press your 'Tab' key and the rest of the filename for the file you want verified will be auto-completed. That saves time and typing errors.
Shutdown Timer
sudo shutdown -h 20:00 -H -P
sudo: admin rights
-h: hour:minutes
-H: hold system
-P: Power down
-c is very usefull when you need to cancel the shutdown
--------------------------------------------------------
This is a relatively simple tip, but if you’re new to Linux you might not be familiar with it. I don’t believe there is a built-in feature for doing this within Gnome or KDE, but this uses the command line so it will work in any environment. Shutting down your computer on a timer can be useful if you want to do something like put on a music playlist, and then have your computer automatically turn off after an hour. Kind of like the sleep timer on your TV.
This is quite simple to implement. You will need to open the command line to use this, but don’t fear! You don’t need to know anything about how to use the command line. In fact, I’ll even tell you how to make a handy little button for this.
If you’re comfortable with the linux terminal, you might already know that you can type halt on the command line and your computer will immediately shut down. Well, halt has a sibling command called shutdown which has a little bit more intelligence and features built into it. Shutdown is the command that we’ll be using here. First you’ll need to bring up your terminal. If you’re running Ubuntu go to Applications > Accessories > Terminal. Now you should have a command prompt. Here’s an example of the command if you want to shut down in 30 minutes:
sudo shutdown -h +30
Sudo means you need to temporarily become admin in order to shut down the system - so you will be prompted for your password. -h tells shutdown that you want to halt the system as opposed to restarting it. +30 means you’re specifying 30 minutes on the timer. The other way to specify the time is to say exactly what time you want the system to shutdown. It’s in 24-hour time, so if you want the system to shutdown at 9:30PM, here’s the command:
sudo shutdown -h 21:30
Again, this will probably ask you for your password. If you want to cancel the shutdown, you can try typing Ctrl+C in the terminal where you issued the shutdown, or if that doesn’t work then you can manually issue a shutdown cancel like this:
sudo shutdown -c
If you’re using Gnome, and you want to create a button for this, go up to your panel and right-click on it. Click “Add to panel.” Then click “Custom Application Launcher.” For type, specify “Application in Terminal.” Name it something like “Shutdown in 30 min.” For the command, use what you learned above. You can also find a pretty little icon for it.
See also: http://micrux.net/?p=42
Don't want the beeps?
You hear beep when you choose: sudo shutdown +10
so in ten minutes; you may hear a pc speaker beep every minute; this will be a annoying.
"The best way that I found to disable the system beep is to remove the kernel module that creates it. This has the advantage to turn off the PC speaker completely thats the speaker creating the beeps. It will work for all applications.
Execute the follow command in a terminal and try to see if you hear a beep:
sudo rmmod pcspkr
# No more beeps
blacklist pcspkr
====================================================
Setting it up as an automated task
Howto Get Enough Sleep Despite StumbleUpon with Ubuntu
What?
I am a long-term StumbleUpon user, which means that I don’t get much sleep. Now, after almost 4 years of stumbling, I have decided to get my life back. Well, at least some sleep!
What does this do?
Every night when I have to work on the next day (Sunday night to Thursday night ), at 23:25 my computer shows me this little warning message:

After the 5 minutes have passed, the computer shuts itself automatically down.
I use this little trick with Ubuntu, but it should work anywhere where Gnome is installed.
How?
Thanks to the power of Linux, this is not difficult to do for yourself, and configure it however you want it to behave:
- Open /etc/crontab with your favourite text editor (no need for crontab -e since this is the system wide crontab), e.g.
sudo gedit /etc/crontab
- Add the following lines (replace manker with your username!)
25 23 * * 0-4 manker /usr/bin/zenity --display :0 --warning --text="Shutdown in 5 minutes. Go to bed."
25 23 * * 0-4 root shutdown -h +5 - The first part of both lines 25 23 * * 0-4 means that the commands are executed at 23:25, but only Sunday (day 0) to Thursday (day 4). Read man 5 crontab for a detailed description of that format.
- The first command uses zenity to show a warning message. You have to execute this as the same user that you use for working, or you will not see the message, so change manker to your username (root does not work either).
- The second command shutdown -h +5 means that the computer will halt in 5 minutes. This has to be run as root, and it also shows nice warning messages in all your open terminals so you can’t really miss it.
- Save the file, and stumble until it is 23:25.
Sweet dreams!
Tuesday, September 2, 2008
Install Fonts in Ubuntu
(source: http://www.stchman.com/install_fonts.html
First thing first I recommend you install the Microsoft TrueType core fonts. To install them type the following at a terminal:
sudo apt-get install msttcorefonts
This will install fonts like Arial, Times New Roman and other Microsoft proprietary fonts. It will not however install Tahoma. Sometimes this server is really busy or down so be patient.
Also there are some Java fonts like Lucida that you can install. This requires the 1.5 JRE to be installed. To install them type the following in a terminal.
sudo apt-get install sun-java5-fonts
Now lets say you have soem custom fonts you wish to install. No problem as I can help you with this as well.
All the fonts you will use in Ubuntu are stored in two places.
1. /usr/share/fonts
2. ~/.fonts
I recommend you install them in the #1 loaction. Reason being is that if you install them to your /home directory they will not be accessible form another account on the computer. Lets begin, shall we.
First make a folder to hold your custom fonts.
sudo mkdir /usr/share/fonts/truetype/customttf I am using customttf as an example.
Next open a terminal in the folder where you have a bunch of custom fonts and type the following:
sudo cp ./*.ttf /usr/share/fonts/truetype/customttf This will copy the truetype fonts to that folder.
Now that we have the fonts in the proper folder we need to install them in Ubuntu. That is what the fc-cache command is for.
Open a terminal in your customttf folder and type the following:
sudo fc-cache -f -v
This will install the fonts so that your applications like OpenOffice and others can use them.
How to hide your linux partition fro co-users
If you just want to hide your linux partition then the best thing to do would be to hide grub.
This is done by editing the menu.lst file (sometimes called grub.conf) This can be found by typing into a terminal:
sudo gedit /boot/grub/menu.lst
Find the lines:
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu
They should be near the top, edit them so that they read:
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu
(No #) Then save, exit and reboot
You may also want to change your default boot entry, if you want your xp to load then add savedefault into your xp entry, mine looks like this:
title Windows XP bootloader (x3)
root (hd0,0)
savedefault
makeactive
chainloader +1
then change the default num option, usually first option to 'saved'
This should automatically boot to windows, without showing any traces of linux and if you want to boot to linux tap ESC on boot.
Still having problems and having to restore the pc to its original state?
Or otherswise stated to be sure that things are reversible:
How to uninstall grub and Linux: http://www.users.bigpond.net.au/hermanzone/p18.htm
The Linux Terminal For Beginners
source:
http://davestechsupport.com/blog/2008/06/14/the-linux-terminal-for-beginners/

A very long time ago, computers didn’t have mice, icons or fancy graphics. Instead of an Operating System with a Graphical User Interface, there was the Command Line Interface. With it, you would issue commands to your computer in a text only environment that is not seen so often these days. But many computer technicians, especially Linux geeks, consider it to be one of the best ways to interact with the PC for certain kinds of tasks. Though there is a little bit of a learning curve about it new users shy away from . So I’m going to try and flatten that curve with an introduction to the Terminal window for beginners.
Understanding the Command Line
To help get a better feel for the Terminal, you should open one up right now and follow along with this guide. To do this (in Ubuntu) click Applications>Accessories>Terminal. Once you do, a new window will appear with a command prompt and a blinking cursor. The prompt typically looks like this:
username@hostname:~$
The username is your username, the hostname is the name of your computer. The tilde symbol “~” is shorthand for “your home folder”. And the dollar sign indicates that you are currently operating under a kind of limited privilege mode (if you were running terminal with Root level privileges, the $ would be a #. More on that later). Following all of these things is a blinking cursor, which is your cue to begin typing a command into the Terminal window.

In the above screenshot, we have our Nautilus file manager to the left as well as a small terminal window on top of it where I’ve typed in the commands “cd Documents”, followed by an “ls” command, pressing Enter after each. If you’ll notice, the “dear ubuntu forum moderators.odt” file is shown in both the terminal window as well as the file browser. It’s the exact same file, and I used those two commands in Terminal to “browse” to the folder containing that file and list the contents of the folder. So we have two commands here that we can talk about briefly:
cd - Change Directory (e.g., “cd Documents”)
ls - List current folder contents.
When you first start Terminal, you are usually placed in your Home Folder (which is indicated by the ~ (tilde) symbol). If you type ls and press enter, you’ll see all of the files and folder contained in your Home Folder. Try to practice navigating from your home folder to some other folder using the cd command. NOTE: All Linux commands are Case-Sensitive! Once you’ve navigated into a folder, or perhaps into a folder within another folder, you can go “backwards” to the parent directory by typing “cd ..”
Exercise 1: cd and ls
- Click Applications>Accessories>Terminal
- Type ls to view the contents of your Home Folder
- Type cd Documents and press Enter to navigate into the Documents folder.
- Type ls to see the files (if you have any) listed. Then type cd .. and press enter to return to your home folder.
Ok, how about a few more commands?

As shown above, the cat command can be used to create new files, but it can also be used to append text from one or more files to the end of another file… but we’re not going to get that advanced. We just want to create a new file and play with it using other terminal commands.
cat - Create new files, combine text files and display them
cp - Copy
rm - Delete/Remove
Using these commands, we’re going to create a text file, copy it, then delete the first copy.
Exercise 2: cat, cp and rm
- Open terminal, and browse to the Documents folder by typing cd Documents, and press Enter
- Create a new text file by typing cat > foo.txt and press Enter.
- You’ll be sent to a blank line just below the command prompt. You can type whatever you want, starting a new line each time you hit Enter. It’s a basic text editor. When you’re finished typing, you can save and exit by pressing CTRL-D.
- Type ls to see the new file in the directory. To display it’s contents, you can type cat foo.txt.
- Copy the file by typing cp foo.txt foo2.txt. Type ls again to see the new second file.
- Delete the first file by typing rm foo.txt, and then type ls again to see the change you made.
There are other commands out there besides cat (such as touch) that can be used to create new files, but we’re trying to keep this short and simple.

Now lets create a file, then a new folder, and move the file into that folder. We’ll do this with the mkdir, mv and ./ commands. The ./ command in particular is interesting — it basically stands for “the current directory you are in”. Sound redundant, right? Here’s why you need to use it: There are many commands in the Linux system that can be run from any directory, such as the ones we’ve been using (cat is an example). These commands reside in a location of the computer that’s been designated to be available at the terminal no matter what folder you reside in.
So say you created a computer program called “cat”, but had nothing to do with text files, and more to do with the feline animal. If you simply typed “cat”, Linux would assume you meant the cat program we used to create a text file, and not yours. By adding the ./ in front, it forces Linux to focus on that local folder you happen to be in.
Exercise 3: mkdir, mv and the ./ delimiter
- Open terminal, and cd into you Documents folder.
- Type cat > foo2.txt, press enter, type some text, then CTRL-D to save and exit cat.
- Type mkdir foocopyfolder to create a new folder. You can type ls after this to see it.
- Type mv foo2.txt ./foocopyfolder/ to move the file into foocopyfolder
- Type ls to see that the file is now missing, then cd foocopyfolder, and then ls one more time to see the recently moved file.
Other Useful Commands
By now, you should already be familiar with the basics of the terminal. Here are some other commands you can experiment with:
rmdir - Remove Directory
sudo - This is typically inserted in front of any regular command that requires root level privileges in order to do. You can think “Super User Do” to help you remember how it’s spelled and what it does. For example, if you wanted to execute a command that required root privilages (such as installing a program) you would type “sudo apt-get install vlc”. Remember, the terminal windows is Case-Sensitive.
locate - a useful index-based file search utility
lspci - Lists PCI devices in your computer (used for technical troubleshooting)
lsusb - Similar to lspci, but for USB devices
apt-get - This is used very often to install, remove and update software. An example of this command would look like: sudo apt-get install vncviewer. Note the sudo in front.
The Manual Command
Now, a lot more could be said about these commands. If you ever want to read all you can read about any one command, you can do that with the man command (which is short for Manual), followed by the command you’re interested in reading about. For example, if I wanted to read about all the different options for the ls command, I would type man ls. When viewing a manual for a command in terminal, you can use the up and down arrows to scroll, and then when you’re done reading, you need to press the Colon key : followed by the q key. This will take you back to the Terminal window.
That’s all I am going to write about the Terminal for today. The three very simple exercises above should have you feeling just a little more comfortable with the Terminal and navigating around your file system. Here are a couple tips though, in case you get lost:
cd / - takes you to your root directory
cd ~/ - takes you to your Home Folder.
And just so you know, your Home Folder is actually located in /home/yourusername/.
There are a lot of great guides out there that go into a lot more detail that I’m willing to do here, so check Google to see what you can find. Here’s one that I think is pretty clear and concise that you should take a look at if you intend to learn more about the command line.
Do stuff in Ubuntu without touching the mouse
source: http://www.ubuntukungfu.org/blog/2008/07/10-things-you-didnt-know-you-could-do-in-ubuntu/