Tuesday, March 23, 2010

Laptop Upgrade!

I just made the switch to a new laptop in the last week... pretty easy process. I went with a Dell Latitude E6400 since I've had such good luck with Latitudes.

Specs:
2.80 Ghz Core2Duo
4 GB ram
Nvidia Quadro NVS 160M

It came with Windows 7, which I didn't even boot into... Didn't take long to have Fedora 12 installed and configured. I think it took longer to do all the updates then the actual install =) It's been a while since a did a Fedora install from scratch, but everything in the installer, partition choices, etc all worked well. I backup my home directory from the old laptop using rsync to an external drive (works great!), but I didn't want to bring all old settings over. So I brought over all the directories then went through the dotted files/directories to figure out which ones I wanted and pulled them over as needed. I was relieved to see bringing over Nautilus bookmarks was as easy as copying over a couple dotted files! When connecting to the remote directories for the first time on the new laptop, it re-prompts for password, but that's not a huge deal.

Here's the list of customizations/installations:
- Installed Nvidia driver 190.53 (nouveau works pretty well, but 3D support isn't quite good enough yet) using kmod package. I got in the habit of installing the drivers my self using Nvidia's installer but I figured I would give the kmod packages a try again. I saw 195.x is marked as stable now, but haven't seen the update for that... Update: Installed the kmod for Nvidia 195.36.15 and haven't had any hibernate/suspend problems since then
- Trying out Adobe Flash 10.1 beta 3... works well with all the videos I have tried, but there have been one or two flash sites it didn't like.
- Compiz/Emerald with settings/themes tweaked to my liking
- gnome-do - If you use gnome and aren't using this, you are missing out!
- Added boot param to get plymouth to work correctly and switched plymouth theme to solar. Is it just me or have there not been any plymouth themes that are nearly as impressive as solar?
- Removed default open window gnome panel and installed awn. I think gnome-do made some changes to docky so I will have to try that again too to see if it's better than awn.

Observations:
- Wireless, webcam, mousepad all worked great
- Video/Audio call in empathy not quite working. Video worked, audio didn't but I haven't played with it much yet.
- Suspend/hibernate - I've tried them once or twice.. It has acted a little flaky resuming sometimes... not sure if that's nvidia, compiz, or what, but it does end up working. Nvidia driver 195.36.15 seems to fix these issues
- I messed up something with Eclipse - was lazy and just pulled over the workspace and eclipse install dirs, but the CVS integration is only partly there. Local changes aren't getting marked in the project explorer as being changed, even though I can do updates, commits, etc.

Remaining:
- Get the WinXP vm off the old laptop. Vmware server has gotten to be a pain, and kvm seems to have progressed enough for me to make the switch. I wish I could get rid of the vm all together, but I have to be able to use ActiveSync for updating one of our Mobile Apps on WM2003 devices. When I tried converting the vmdk to qemu a month or two ago I got no where. I will give that one more try before just doing a new XP install on kvm.

Has anyone else done a Fedora install on any of the new Latitude E series?

Wednesday, March 3, 2010

Ghostscript saves the day

We got a request from one of our users last week that we had to (gov't regs) print out over 700 pdf documents that we have stored in Alfresco... She wanted to know if there was any way we could do that without having to open each pdf and print it out individually. I didn't think Alfresco had any way of doing that, but had a couple of ideas.

I got our primary Alfresco dev to write a query and put the docs in an Alfresco folder, which I mounted to my Fedora laptop. I cheated and use Gnome's "Connect to..." functionality, but you can manually mount it using CIFS as well. I noticed that the .pdf extension wasn't case consistent..

I had used ghostscript to merge pdf's before, so I planned on using it to merge all 730 pdf's to one file and let the user do whatever she needed to with it. I thought that ghostscript had an option to just append files together one at a time so I figured out the bash necessary to iterate over the files (which had spaces in the filenames) and pass each filename to gs:


## This makes the for loop work even though there are spaces in the filenames
IFS=$(echo -en "\n\b")
for File in `ls -l | grep -i ".*pdf" | cut -c 54-`
do
gs -sDEVICE=pdfwrite -sOutputFile=$2 -dNOPAUSE -dBATCH -f $File
done;


But ghostscript doesn't have an append option (at least not one that I could find) and I didn't want to have to concat all the file names together and pass that to ghostscript.

Here's the command I figured out to make it work:

gs -sDEVICE=pdfwrite -sOutputFile=/tmp/merged.pdf -dNOPAUSE -dBATCH -f *[pP][dD][fF]

That created a 1000+ page pdf doc that the user was happy to receive and promptly printed out. Interestingly enough, the poor printer she sent the doc to actually died trying to print the 1000 pages... fail.

Thanks ghostscript!