Wednesday, January 23, 2008

File Command

This is neat. I just discovered that if you need to figure out the type of a file you can use the file command like this:

file file-of-unknown-type

File Permissions in Linux

Here's one I can never remember:

- = 0
x = 1
w = 2
r = 4

So, chmod 777 means everyone can read, write or execute a file. chmod 755 means that the owner can read, write, or execute it, and everyone can read it or execute it, but not write it.

Monday, January 21, 2008

Installing Adobe Flash Player with Yum

I just installed Adobe Flash Player for use with Firefox in my newly installed Fedora Core 8. In the process, I discovered that one can use yum to do it. The instructions are here from Adobe. If what they say is true, then whenever I need to install the latest version, from now on I can just type yum update flash-plugin from a terminal window.

Installing Fedora 8 on my Dual-Boot Dell Inspiron 600m

I finally had some time to upgrade my laptop's OS from Fedora Core 6 to Core 8. Below are the steps I took. You can find installation instructions from Fedora here.

Note: I did not have to do any partitioning since I did that long ago when I first made the computer dual-boot. I followed the instructions here to do that initial installation. I have no idea if the instructions there are still valid or if there are better ways of doing it.

1. Download Fedora from the Fedora Project and burn it to a DVD. I used the Direct Download option rather than BitTorrent.

2. Back up all of the data in your home directory as well as configuration files elsewhere on the computer that you might want later. I have a script that daily backs up all of my important data to our desktop, but for this backup I wanted to get everything I could possibly want, including my crontab file, hidden files and folders, etc. At some point, I'm going to write a script that does all of this for me, but this time I did it manually. The files/directories that I don't include in my normal backups, but included for this installation are:
  • ~/.bash_profile
  • ~/.bashrc
  • ~/.emacs
  • ~/.emacs.d
  • ~/.smbpasswd
  • /etc/fstab
[Edit: I should have also backed up my /etc/hosts file. Oops.]

3. Insert the Fedora 8 DVD into the laptop and reboot. To boot from the DVD on a one-time basis, press F12 (and hold for a bit) as soon as the Dell logo appears. This brings up a screen asking you to choose where you want to boot from. Select the DVD and hit enter.

4. Follow the instructions as prompted. Below are some notes on certain choices that I made:
  • I chose to do a fresh install rather than have the installation program simply upgrade my existing system. Why? I just like to wipe things clean and start fresh every once in a while.
  • When it came time to deal with partitions on the hard drive, I chose to use the default layout: "Remove Linux partitions on selected drives and create default layout." This left my Windows partition untouched.
  • I did not tell it to UTC since you should not do this if your machine also runs Windows. See here about UTC.
What follows are a few post-installation things I did:

1. Install mplayer. The easiest way I know of installing mplayer is to use yum or pirut. To get this to work, you first have to let yum know about ATrpms. To do this, as root, create a file atrpms.rpo in the /etc/yum.repos.d directory. Then add the following to the file:

[atrpms]
name=Fedora Core $releasever - $basearch - ATrpms
baseurl=http://dl.atrpms.net/f$releasever-$basearch/atrpms/stable
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1

You may also have to import the GPG key. But then you can just tell yum or the Add/Remove Software application to install mplayer. With the application, just do a search for mplayer.

2. Install auctex. Again, with the Add/Remove Software application just search for auctex. You will of course need to Emacs.

3. Install Xfig. Again, it's super easy with the Add/Remove Software application.

Changing Crontab's default Editor

Normally, when you run
crontab -e
vi starts up as the default editor. The truth is I don't like vi. I've tried to use it, but I can never remember it's key commands for more than a few minutes. Instead, I prefer to use emacs. To get crontab to use emacs instead of vi, just add the following two lines to your .bash_profile:

EDITOR=emacs
export EDITOR

That's it.