Thursday, June 11, 2009

wake on lan on the SC1430

Wake On Lan..she is a working on the SC1430 now, after a bit of sturm unt drang:
http://en.community.dell.com/forums/p/19278497/19501270.aspx#

Tuesday, March 31, 2009

Fedora 10, xrandr and InFocus projector

So, I'm doing this presentation at the Trenton Computer Festival next month and couldn't get the InFocus IN2102EP Projector to work on my dual boot MacBook Pro (2.33Ghz Core 2 Duo) that runs both Leopard and Fedora 10, x86-64 using ReFit as the boot loader. I tried to connect the InFocus to the DVI output of the Mac while running under Fedora.

The InFocus is connected this way:
MacBook external DVI output > DVI-VGA dongle > VGA - M1-DA Cable
> InFocus M1-DA connector

The problem is that though xrandr sees the DVI-0 port as connected, but the InFocus doesn't get the signal or spring to life through the setup listed above.

I've verified that the DVI-0 output works with a regular DVI cable connected to the DVI input on my Dell 1907FP 19-inch Flat Panel LCD. So this means a digital signal is being output from the port. Now, I've also verified that the DVI-0 output from Fedora does NOT work with the DVI-VGA dongle connected to the VGA input on the Dell. When connected with the DVI-VGA setup listed above, xrandr sees that the InFocus is connected (shown below). Also, Gnome sees the InFocus in the connected displays.

On the flipside, I've verified that the InFocus projector works using the DVI-VGA cable setup when booted from the Mac OS. So that's odd.

Since I can see the output while connected to the Dell's DVI input, I don't think this is a configuration issue. But maybe Fedora just doesn't like the DVI-VGA dongle. I'm sure I could buy an M1-DA direct to DVI adapter and be done with it, but I'd rather save the $55 and figure out why the Mac sees the Infocus, but why Fedora has troubles.

Here is the output of xrandr:
[cm@cm ~]$ xrandr
Screen 0: minimum 320 x 200, current 2464 x 900, maximum 2720 x 1924
LVDS connected 1440x900+0+0 (normal left inverted right x axis y axis)
331mm x 207mm
1440x900 60.0*+
2048x1536 60.0
1920x1440 60.0
1856x1392 60.0
1792x1344 75.0 60.0
1600x1200 85.0 75.0 70.0 65.0 60.0
1400x1050 74.8 60.0
1280x1024 85.0 75.0 60.0
DVI-0 connected 1024x768+1440+0 (normal left inverted right x axis y axis)
0mm x 0mm
1024x768 60.0*+ 85.0 75.1 75.0 70.1 60.0*
1400x1050 60.0
1280x1024 75.0 60.0
1024x768_60.00 60.0
1280x960 60.0
1152x864 75.0
832x624 74.6
800x600 85.1 72.2 75.0 60.3 56.2
640x480 85.0 72.8 75.0 72.8 75.0 60.0
720x400 85.0
640x400 85.1
640x350 85.1
0x0 0.0


Here is my xorg.conf:
Section "ServerLayout"
Identifier "Default Layout"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Synaptics Touchpad" "CorePointer"
EndSection

Section "Module"
Load "synaptics"
Load "extmod"
Load "dbe"
Load "glx"
EndSection

Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/input/mice"
Option "Protocol" "auto-dev"
Option "SHMConfig" "true"
Option "LeftEdge" "10"
Option "RightEdge" "1200"
Option "TopEdge" "10"
Option "BottomEdge" "370"
Option "FingerLow" "10"
Option "FingerHigh" "20"
Option "MaxTapTime" "180"
Option "MaxTapMove" "220"
Option "SingleTapTimeout" "100"
Option "MaxDoubleTapTime" "180"
Option "LockedDrags" "off"
Option "MinSpeed" "1.10"
Option "MaxSpeed" "1.30"
Option "AccelFactor" "0.08"
Option "TapButton1" "1"
Option "TapButton2" "3"
Option "TapButton3" "2"
Option "RTCornerButton" "0"
Option "RBCornerButton" "0"
Option "LTCornerButton" "0"
Option "LBCornerButton" "0"
Option "VertScrollDelta" "20"
Option "HorizScrollDelta" "50"
Option "HorizEdgeScroll" "0"
Option "VertEdgeScroll" "0"
Option "VertTwoFingerScroll" "1"
Option "HorizTwoFingerScroll" "1"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection

Section "Device"
Identifier "ATI Technologies Inc M56P [Radeon Mobility X1600]"
Driver "radeon"
Option "backingstore" "true"
Option "RenderAccel" "true"
Option "AccelMethod" "EXA"
Option "Monitor-LVDS" "Internal Monitor"
Option "Monitor-DVI-0" "External DVI"
BusID "PCI:1:0:0"
EndSection

Section "Monitor"
Identifier "Internal Monitor"
HorizSync 30.0 - 110.0
VertRefresh 50.0 - 150.0
Option "DPMS"
EndSection

Section "Monitor"
Identifier "External DVI"
Modeline "1024x768_60.00" 108.88 1280 1360 1496 1712 1024 1025 1028
1060 -HSync +Vsync
Option "Enable" "true"
EndSection

Section "Screen"
Identifier "Screen0"
Device "ATI Technologies Inc M56P [Radeon Mobility X1600]"
DefaultDepth 24
SubSection "Display"
Depth 24
Virtual 2720 1924 # <--- This is the newly added entry
EndSubSection
EndSection

Section "DRI"
Mode 0666
EndSection


Alex Deucher on the Xorg mailing list was able to help me:
> > > If you are using F10 with kernel modesetting (KMS) it doesn't have the
> > > proper quirks do deal with the broken connector table on the macbooks.
> > > I think the non-KMS code shipped with F10 should have the proper
> > > quirk handling, if not, you may need to upgrade your ddx.

I did a workaround and used the "nomodeset" kernel parameter option on kernel command line in grub.conf. So now, the display wakes up when Gnome starts.

Hooray!
TAG

Xorg/Xrandr References
Xorg Info Page
XRandr Wiki
Open Solaris on MacBook Pro
XRandr on Debian

Saturday, March 07, 2009

dual boot: macbook pro and fedora 10

Lately, I've been preparing a talk on Linux video production in linux that I will be giving at the end of April. More or less, it will be a technology demo that shows how to accomplish various video related tasks in Linux:
-capturing a video (acquisition)
-importing the output from the camera via firewire
-basics of file formats
-editing
-rendering
-scripting
-saving to a final destination (iPod/DVD/Vimeo)

So there will be a lot of ground to cover in the hour or so I will be speaking. I considered the mechanics of my presentation and first thought it would be cool to use my JVC HD10U to capture video of the conference which I'd then edit in Cinelerra. I had Fedora 10 already running in a virtual machine via VMware Fusion on my MacBook Pro 2.33Ghz Intel Core 2 Duo.

This method posed one big hurdle: VMware does not support firewire. VMware supports USB, but my camera only transmits high def video over firewire. Thus, I would not be able to capture live video from the camera during the talk. Conceivably, I could use a USB camera, but the quality would be so piss poor as to be embarrassing. So the VMware solution was nixed. The best solution was to dual boot my MacBook. I had my marching orders: I had to figure out how to dual boot my MacBook.

As expected, I hit a few speed bumps along the way, as the TechAnswerGuy always does. And as usual, you get to learn from my mistakes. Here we go..

Summary
Here was the high level plan:
1) upgrade my system drive to a 320GB 7200RPM Seagate Momentus
I was running out of space on the original 120GB drive, so this would be fun.
2) partition that fat new system drive to have a 240GB partition for Mac OSX and leave the 60GB unused space for Fedora
3) use SuperDuper to backup all important files to the Mac partition
4) use either Boot Camp or rEFIt to present a nice dual boot menu when the MacBook boots
5) configure the Fedora 10, x86-64 instance with a working copy of Cinelerra, dvgrab and all the media goodies necessary to make a slam-bang presentation come alive

Devil in the Details
In order to upgrade my system drive, I needed to migrate the data from the old drive to the new drive. Lucky for Mac users, David Nanian has written a wonderfully simple app called SuperDuper that creates bootable backups of Mac system drives. I prefer the word clone, as it refers to the fact that the backup also makes the drive bootable. Semantics aside, the result is the same.

Since my system drive is the drive that came installed in the MacBook, I needed to hook up the new 320GB Seagate I had bought. This was done using a very neat little device, a non enclosed disk enclosure called the Thermaltake BlacX eSATA Hard Drive Docking Station that I had bought at the same time for this express purpose.

Thermaltake BlacX..Sweet!
What a simple, easy little device to use! It is like a little USB disk drive bucket for both 2.5" and 3.5" disks. You just insert a disk connector side down into this bad boy, plug it in via USB into your PC or MAC, turn it on and voila, instant access to your storage! No fussing with screws or metal sleeves. It's cheap too, low $40s. After using enclosures for years, it is nice to not have to pick up a screwdriver to get access to my storage.


Once I plugged in the new drive into the BlacX and turned it on, it was time to 1) partition the empty drive and 2) do the SuperDuper backup. Partitioning the drive with the OSX Disk Utility was fairly easy. I accepted the defaults for the partition:
* Mac OS Extended partition (Journaled)
* install Mac OS 9 drivers

Partition Hell
Of the 300GB usable out of the drive, I allocated 240GB in the Mac partition and 60GB Free Space to land my Fedora 10 system. One very important thing that I needed to select is under Options:
select GUID Partition Table. Initially, I had taken the defaults settings and the defaults create a drive that uses the older Apple Partition Map drive partitioning scheme:


Do NOT use APM because you will get errors in both Boot Camp and rEFIt. The Boot Camp error went something like this:
Startup disk cannot be partitioned or restored to a single partition.
Backup the disk and use Disk Utility to format it as a single Mac OS Extended (Journaled) Volume.


The above error is very misleading, because when you look at the format of your partition, the partition is formatted in the correct way. But at the bottom of Disk Utility's Partition screen for the drive, the information about the drive will be listed and the key piece is "Partition Map Scheme". If Apple Partition Map is there, you won't be able to use Boot Camp or rEFIt. In my case, I had to repartition the new drive again to create a partition that had a Partition Map Scheme of GUID Partition Table. Here's a short guide that explains how to convert a drive from APM to GUID.

Long story short, you'll have to blow away whatever is on the disk to do the conversion. So be advised.

SooperDooper Indeed!
Once I had resolved the Partition Map problem, I moved onto backing up my sensitive data to the new drive with SuperDuper. There are a number of guides out there and SuperDuper is really easy to use. It took about three hours to copy 100GB of data from my currently internal old system drive to the new 320GB, 7200RPM hard drive that was plugged into the Thermaltake.

Quid Pro Quo
The next step was to take apart the MacBook and switch out the old drive for the new. This was non-trivial, required a delicate touch and took about an hour.
http://www.extremetech.com/article2/0,2845,2119529,00.asp

rEFIt
As I am all for open source solutions, I decided to use rEFIt as my boot manager. rEFIt also provides a clean way to install another OS. In point of fact, you don't need rEFIt to boot into a second operating system on your MacBook. Simply hold down the Option button as your MacBook is booting, and you will see OSX's built in system volume chooser.

Once I installed rEFIt, I rebooted the system and I saw the rEFIt boot manager appear. I booted a second time and inserted my Fedora 10, x86-64 install DVD and when the rEFIt boot manager appeared, I now had a second choice appear in the menu. That of Tux!


Familiar Territory
After that, the Fedora install process was the usual. One note: make sure to look at the disk properties in the disk configuration section of the install. Even though Fedora deselects any Mac partitions, it is good to double check this. The Fedora installer make good choices for the partitioning, given that my newly installed system disk in the Mac was found as /dev/sda:
* Fedora automatically deselected the first two partitions in /dev/sda as they were Mac partitions
* Fedora correctly assigned /dev/sda3 as the boot partition

Nice. After confirming Fedora's correct selected defaults for the partitioning layout, I then selected the base installation plus Developer Tools. This selection, plus the dependencies for Cinelerra build resulted in about 5.1GB used on the disk. Not too porky. I went to breakfast and the install finished in about 30 minutes.

After the system restarted, I found some troubles with the Mac's touchpad. I resolved them with the synaptics driver and some xorg.conf config, but I will detail that in a second post.

I will try to fill in some of the details of this long winded post with pictures to break up the monotony of the text.

TAG

Other References
http://www.macgeekery.com/tips/cli/nondestructively_resizing_volumes
http://ubuntuforums.org/archive/index.php/t-766172.html
http://www.shirt-pocket.com/forums/showthread.php?t=3282
http://forum.onmac.net/showthread.php?t=2793

Sunday, February 22, 2009

extending a logical volume in Fedora

I have a Fedora 10, x86-64 installation running under VMware Fusion on my Mac. Today, I ran out of disk space on my root partition. My root partition sits on a logical volume. In the "df" output below, note that I only have 92MB left on my / drive:
[root@ogre ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00 5.7G 5.4G 92M 99% /
/dev/sda1 190M 30M 151M 17% /boot
tmpfs 543M 0 543M 0% /dev/shm
/dev/sr0 96M 96M 0 100% /media/GParted-live


Oh no!

Research Necessary
Now, I haven't worked with logical volumes in quite some time, so I had to do a bunch of reading to figure out what the heck to do. These documents were of immeasurable help:
A Beginner's Guide to LVM
VMware Fusion - Expanding a Disk
Resizing LVM Volumes in Linux

Summary
In a nutshell, here are the steps necessary to expand the amount of space in your logical volume on Fedora. The first step is the allocation of new space in the context of VMware, but you could easily substitute the installation of a new hard drive:
1) In VMware Fusion, under Virtual Machine -> Settings -> Hard Disk, expand the size of your disk to the desired amount. I increased my disk space allocation from 8GB to 10GB:


2) Make a new partition using unallocated space
3) Create a new physical volume from the new partition that was just created
4) Extend the volume group into the new physical volume that was just created
5) Note the amount of free space in the volume group
6) Extend the amount of space in the logical volume using the value of free space
7) Resize the filesystem on the logical volume
8) Note the increased available space in the filesystem on the logical volume
9) Drink beer, you've earned it!

Details
##########
#2) MAKE A NEW PARTITION USING UNALLOCATED SPACE
##########
[root@ogre ~]# parted
GNU Parted 1.8.8
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 32.3kB 206MB 206MB primary ext3 boot
2 206MB 8587MB 8382MB primary lvm

(parted) mkpart primary 8588 10700
(parted) print
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 32.3kB 206MB 206MB primary ext3 boot
2 206MB 8587MB 8382MB primary lvm
3 8587MB 10.7GB 2113MB primary

(parted) quit
Information: You may need to update /etc/fstab.

##########
#3) CREATE A NEW PHYSICAL VOLUME FROM THE NEW PARTITION THAT WAS JUST CREATED
##########
[root@ogre ~]# lvm
lvm> pvcreate /dev/sda3
Physical volume "/dev/sda3" successfully created
lvm> pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup00 lvm2 a- 7.78G 32.00M
/dev/sda3 lvm2 -- 1.97G 1.97G

##########
#4) EXTEND THE VOLUME GROUP INTO THE NEW PHYSICAL VOLUME THAT WAS JUST CREATED
##########
lvm> vgextend VolGroup00 /dev/sda3
Volume group "VolGroup00" successfully extended
lvm> pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup00 lvm2 a- 7.78G 32.00M
/dev/sda3 VolGroup00 lvm2 a- 1.94G 1.94G

##########
#5) NOTE THE AMOUNT OF FREE SPACE IN THE VOLUME GROUP
##########
lvm> vgdisplay VolGroup00
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 9.72 GB
PE Size 32.00 MB
Total PE 311
Alloc PE / Size 248 / 7.75 GB
Free PE / Size 63 / 1.97 GB
VG UUID H89xDs-yTqE-y2YZ-ORVq-idgW-HdGf-hHU8m3

##########
#6) EXTEND THE AMOUNT OF SPACE IN THE LOGICAL VOLUME USING THE VALUE OF FREE SPACE
##########
lvm> lvextend -l+63 /dev/VolGroup00/LogVol00
Extending logical volume LogVol00 to 7.75 GB
Logical volume LogVol00 successfully resized
lvm> lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol00 VolGroup00 -wi-ao 7.75G
LogVol01 VolGroup00 -wi-ao 1.97G
lvm> quit
Exiting.

##########
#7) RESIZE THE FILESYSTEM ON THE LOGICAL VOLUME
##########
[root@ogre ~]# resize2fs /dev/VolGroup00/LogVol00
resize2fs 1.41.3 (12-Oct-2008)
Filesystem at /dev/VolGroup00/LogVol00 is mounted on /; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/VolGroup00/LogVol00 to 2031616 (4k) blocks.
The filesystem on /dev/VolGroup00/LogVol00 is now 2031616 blocks long.

##########
#8) NOTE THE INCREASED AVAILABLE SPACE IN THE FILESYSTEM ON THE LOGICAL VOLUME
##########
[root@ogre ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
7.7G 5.4G 2.0G 74% /
/dev/sda1 190M 30M 151M 17% /boot
tmpfs 543M 0 543M 0% /dev/shm
/dev/sr0 96M 96M 0 100% /media/GParted-live

##########
#9) DRINK BEER!
##########


Hooray! Now I won't run out of space in my VM!
TAG

vmware tools install in Fedora 10

Here are some quick notes to installing VMware Tools in Fedora 10 in Fusion. My particular architecture is x86-64, but these should work for regular x86 installs:
1) yum groupinstall "Development Tools"
2) yum install kernel-devel* kernel-headers*
3) run ./vmware-install.pl as root

Also, I had one problem where the kernel-devel* and kernel-headers* package did not match my kernel, which was one revision lower than my installed kernel. The vmware-install.pl program told me this when I tried to run it. The solution to this was to simply update my kernel:
yum install kernel

TAG

pulseaudio and Fedora 10 don't get along

Working with my Fedora 10, x86-64 VM running under Fusion on my MacBook Pro was an exercise in frustration today:
- pulseaudio was spitting out noise and I couldn't uninstall it
- VMware Tools wouldn't compile
- I was running out of disk space in the VM

PulseAudio Problem
The problem with PulseAudio and Fedora 10, x86-64 is that when you use any multimedia application that has sound, the pulseaudio driver just creates noise in your speakers. Also, any video stream associated with the audio stream will be corrupted or at a minimum, sped up or slowed down and generally unwatchable.

Solutions that should work, don't
Under System -> Preferences -> Personal -> Sessions, I unchecked the PulseAudio Sound System. Even with this change, my apps in Gnome kept using Pulse. I'm wondering if this problem is related to Gnome in the last three Fedoras not saving session information properly?

Also, reading the man pages for pulse-daemon.conf, pulse-client.conf and pulseaudio wasn't much help as it did not yield a simple solution for disabling it.

I couldn't remove pulseaudio, because the beast has hooks into everything:
[sodo@ogre ~]$ sudo yum remove pulseaudio*
compiz-gnome x86_64 0.7.8-7.fc10

control-center x86_64 1:2.24.0.1-12.fc10
gdm x86_64 1:2.24.0-12.fc10
gdm-user-switch-applet x86_64 1:2.24.0-12.fc10
gnome-applets x86_64 1:2.24.3.1-1.fc10
gnome-panel x86_64 2.24.3-1.fc10
gnome-session x86_64 2.24.3-1.fc10
gnome-session-xsession x86_64 2.24.3-1.fc10
gnome-settings-daemon x86_64 2.24.1-7.fc10
gstreamer-plugins-good x86_64 0.10.11-4.fc10
libcanberra x86_64 0.10-3.fc10
libcanberra-gtk2 x86_64 0.10-3.fc10
mencoder x86_64 1.0-0.103.20080903svn.fc10
mjpegtools x86_64 1.9.0-0.6.rc3.fc10
mjpegtools-gui x86_64 1.9.0-0.6.rc3.fc10
mplayer x86_64 1.0-0.103.20080903svn.fc10
orca x86_64 2.24.3-1.fc10
plymouth-gdm-hooks x86_64 0.6.0-0.2008.11.17.3.fc10
totem x86_64 2.24.3-1.fc10
totem-gstreamer x86_64 2.24.3-1.fc10
totem-mozplugin x86_64 2.24.3-1.fc10
totem-nautilus x86_64 2.24.3-1.fc10
vlc x86_64 0.9.8a-1.fc10
vlc-devel


A Working Solution!
The pulseaudio* removal wasn't going to work, as it was going to remove a helluva lot of dependent programs. However, a different syntax for the removal of pulseaudio seemed to work a little better:
[sodo@ogre ~]$ sudo yum remove pulseaudio

Without the asterisk (*), yum removed only pulseaudio programs and not any dependencies. So it was just a tweak to the yum remove syntax that did the trick. Thank God. Now my videos don't break up!

FYI - As a last resort, if none of these removals work, just rename the binary to something else:
sudo mv /usr/bin/pulseaudio /usr/bin/paudio

That way, the system won't be able to find it. Of course, this isn't the preferred method of disabling pulseaudio!
;)
TAG

Reference
http://forums.fedoraforum.org/showthread.php?t=213711
An untested solution:
http://forums.fedoraforum.org/showthread.php?t=206868

Friday, February 20, 2009

smtp mail from evolution to comcast

Well, this is completely f'd up. Suddenly, outbound SMTP mail from Evolution on my Fedora 10 install just stopped working. The only thing I had done was install Alpine, the most recent version of what used to be the Pine command line email program.

Digging further, I found this post suggesting that both Compuserve and Comcast have been using port 587 instead of port 25 to receive SMTP email.

Thanks Comcast. You just killed more than two hours of my time. You incompetent fools.

Sunday, February 15, 2009

100% cpu on vmware fusion 2.0.2 with Mac OSX 10.5.6

This weekend, I installed Fusion 2.0.2 on my MacBook Pro 17" (dual core 2.4Ghz, 2GB RAM) running OSX 10.5.6. I was running an XP SP2 VM using one processor and 512MB. The one dedicated CPU would spike to 100% and my mouse disappeared. Thus, I had to control XP via the keyboard, always an exciting task. Of course, the display was really sluggish as others in this thread have reported. I did try the reinstall of VMware Tools, but that didn't work. Two things in conjunction did work:

1) under Settings -> Sharing -> Shared Applications, I disabled "Allow your Mac to open applications in the virtual machine"

2) in the same dialog box, select "Never" for "Show running virtual machine applications in the dock". This essentially disables Unity mode for that option.

Update 2009/02/16
Shutdown your vm and restart Fusion to make sure the changes are effective.
*** end update ***

Update 2009/02/18
I should clarify that my MacBook was upgraded to OSX 10.5 Leopard recently. I believe the DVD upgraded it to 10.5.4, and then I did another interim upgrade via Internet download to 10.5.6
*** end update ***

When you read the list of caveats in the VMware Fusion Release Notes, it is quite a litany of troubles. I guess this is where complexity gets us..too many combinations of guest and host OS versions for the company to adequately QA their products.

Unfortunately, it cost me at least two hours of my time today.
TAG

References:
Beginner's Guide to VMware Fusion
Power User's Guide to VMware Fusion
Resizing Virtual Disks with Step-by-Step Instructions
Run a Virtual Machine at Boot
Workstation 6 Manual
Modifying Fusion's Network Settings

Wednesday, February 11, 2009

the pleasure of command line email

I don't think there is anything as satisfying as the simplicity of sending an email at the command line. Like so:
[sodo@ogre ~]$ mail -s "short and sweet" cacasododom@gmail.com
This is my email.
.
EOT
[sodo@ogre ~]$


Simplicity Itself
I mean, really, how sweet is that? No opening a big fat email client, no clicking "Compose Email", no clicking into an address textbox field, no surfing through lists of adressees, you get the point. Command line email is simplicity itself. Of course, its simplicity is its drawback..you can't do the fancy stuff. But for simple communications or piping the input of text files into an email and sending it off, command line email can't be beat.
[sodo@ogre ~]$ mail -s "Fedora 10 random lockups" cacasododom@gmail.com
[sodo@ogre ~]$

Sending Mail Via Comcast
Fedora 10's base install comes with "mail". However, you need to tweak your .mailrc file for it to work with your mail provider. In my case, I am on Comcast. Comcast's mail requires your username and password. And of course you need to specify the outbound SMTP server. Finally, I want to set the "From:" address, so replies go to the right place. So my .mailrc file looks like this:
[sodo@ogre ~]$ cat .mailrc
set smtp-auth-user=myaccount
set smtp-auth-password=password
set smtp=smtp.comcast.net
set from=myaccount@comcast.net

Just put this .mailrc file in your home directory and you should be good to go. Test it by sending a mail from the command line:
[sodo@ogre ~]$ mail -s "test email #1" yourtestemail@mailhost.com < /dev/null
[sodo@ogre ~]$

Test That This Works
After sending your email, you may get a bounce back if something is incorrectly configured. So you may receive a message at the command line:
[sodo@ogre ~]$
You have new mail in /var/spool/mail/root
[sodo@ogre ~]$

Just type "mail" and hit enter. The interactive version of "mail" will start and you'll see a list of mail headers:
[sodo@ogre ~]$ mail
Heirloom Mail version 12.4 7/29/08. Type ? for help.
"/var/spool/mail/sodo": 2 messages
> 1 Mail Delivery Subsys Fri Feb 6 11:07 253/20968 "Returned mail: see transcript for details"
2 Mail Delivery Subsys Fri Feb 6 11:07 249/20491 "Returned mail: see transcript for details"

Type the number of the email header (1, 2, 3, etc) to see its contents.
Message
1:From MAILER-DAEMON@localhost.localdomain Fri Feb 6 11:07:40 2009
Return-Path: <MAILER-DAEMON@localhost.localdomain>
Date: Fri, 6 Feb 2009 11:07:40 -0500
From: Mail Delivery Subsystem <MAILER-DAEMON@localhost.localdomain>
To: <sodo@localhost.localdomain>
Content-Type: multipart/report; report-type=delivery-status; boundary="n16G7eTG018842.1233936460/localhost.localdomain"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)
Status: RO

Part 1:

The original message was received at Fri, 6 Feb 2009 11:07:39 -0500
from localhost.localdomain [127.0.0.1]

----- The following addresses had permanent fatal errors -----<
cacasododom@gmail.com> (reason: 554 Blocked by SPAM RBL check senderbase.org orwikipedia.org/wiki/DNSBL)

Debug
Usually, there will be a very clear indication in the email as to what is going on. Such as in the above email:
reason: 554 Blocked by SPAM RBL check senderbase.org orwikipedia.org/wiki/DNSBL

Type "quit" to exit.

So that's it. Enjoy your command line email!
TAG


PS - As shown in the example above, I have been experiencing some random lockups in Fedora 10: http://forums.fedoraforum.org/showthread.php?t=205950
My current workaround is to use the "noapic" command line option. But I will need to further investigate why these lockups just started happening with Fedora 10. They didn't happen with Fedora 9 or 7!
Feel free to drop me a line or ask me a question.