Archive for the ‘Linux’ Category
Darktable
This past weekend, I spent some time with my new camera, the Olympus E-PL2. The E-PL2 has interchangeable lenses, whereas my Canon G9 does not. Both can take photos in JPG and RAW formats. With learning a new camera, there are times where you have overexposed or underexposed a shot. I was looking for an application that runs in linux that allows me to adjust photo properties simply. I read ‘Digital Photography Tools on GNU/Linux‘ and got some great suggestions for packages in Fedora, but haven’t had to to get into all of them. I had installed Darktable a few months ago, but never spent time to look at it until now.
As described on the Darktable site (http://darktable.sourceforge.net/) “darktable is a photography workflow application: a virtual lighttable and darkroom for photographers: it manages your digital negatives in a database and lets you view them through a zoomable lighttable. it also enables you to develop raw images and enhance them.” The source code is available under the GPL version 3. Binaries are available for most major linux distributions.
I had been looking for something to work on my photos without knowing a huge amount about the Gimp. Darktable has many plugins in which to perform the actions I need in changing exposure and color, and working with RAW files without having the interface get in the way.
You can find some very good screencast tutorials on Darktable here: http://blog.pcode.nl/2010/12/06/darktable-0-7-screencast-library/
Managing self-signed certificates in Windows and Linux
Self-signed SSL certificates are a good way to add security to your web sites without having to pay the fees to a ‘trusted’ Certificate Authority. However, different browsers handle these self-signed certificates differently. Watch my howto video to see how to manage these kinds of certificates better in Internet Explorer and Google Chrome on Windows.
If you’re on Linux, the same rules apply: Firefox has it’s own exception list that you manage in the browser, but Google Chrome will honor your operating system’s built in list. Here is how to add the exception in Linux so Chrome will stop complaining:
# echo | /usr/bin/openssl s_client -connect adamhaeder.com:443 -showcerts > ~/adamhaeder_cert.pem # /usr/bin/certutil -d sql:$HOME/.pki/nssdb -A -t "CP,,CP" -n adamhaeder.com -i ~/adamhaeder_cert.pem
Restart Chrome, go back to your SSL encrypted site, and you should no longer get the error message.
Extracting email addresses from mbox files
I’ve often been in situations where I want to extract a list of email addresses from an mbox-formatted mail file, usually because I want to send an email to everyone that had sent an email to a certain address. This script will extract email addresses from lines that start with “From:” in a given mbox file, attempting to remove all of the ‘non-human’ email addresses it finds.
The script has extra line breaks to make it more readable. You could remove them for compactness.
The regular expression for matching an email address is courtesy of www.regular-expressions.info.
#!/bin/bash
# This script will parse an mbox file, displaying all of the From: email addresses, removing ones that
# are from postmaster, mail admins, etc
FILE=$1
if [ ! -r $FILE ]; then
if [ -r /var/spool/mail/$FILE ]; then
FILE="/var/spool/mail/$FILE"
else
echo "Sorry! Neither $FILE nor /var/spool/mail/$FILE exists, or I can't read them"
exit
fi
fi
grep "^From:" $FILE | egrep -vi \
"(postoffice|\
postman|\
administrator|\
bounce|\
MAILER-DAEMON|\
postmaster|\
Mail Administrator|\
Auto-reply|\
out of office|\
Mail Delivery System|\
Email Engine|\
Mail Delivery Subsystem|\
Mail.Administrator|\
non.deliverable)" |\
egrep -io "[A-Z0-9._%+-]+@[A-Z0-9.-]+\.([A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum)" |\
tr '[A-Z]' '[a-z]' |\
sort | uniq
Use linux dd comand to create a disk image
dd if=/dev/zero of=<img_path_name.img> oflag=direct bs=1M count=10240
will create an entire 10gig empty image file with 1meg blocksizes
Dual Booting Fedora and Windows 7
I purchased a new Toshiba NB305 netbook this week (in Blue to match Fedora). It came with Windows 7 Starter Edition, the one that’s been slightly stripped down. My intention was to dual-boot Fedora 12 and Windows 7, so I used the Fedora 12 Unity DVD I downloaded the weekend before, burned it to a blank DVD-R and hooked up my external USB DVD drive to the NB305. The installer recognized I had an existing NTFS partition so I choose to have the installer resize the NTFS partition to create free space for the Fedora install. The repartition went well, I finished the installation from the DVD, rebooted and added a new user. I proceeded to add the Adobe and RPM Fusion repositories to add flash and multimedia codec.
At this point, with Fedora installed and all working well, I decided to set up the Windows 7 side. There is where my trouble came in. Each time Windows 7 SE started up, it would blue screen and restart. Trying Safe Mode produced the same problem. Having the external USB DVD drive still hooked up, I booted into the Windows 7 Pro 32Bit install disc I got during the holidays and pulled up the Recovery portion of the disc. It could not find a Windows 7 installation. I thought that perhaps since Windows 7 SE hadn’t gone through it’s set-up out of the box, the partition wasn’t marked correctly.
The NB305 did not come with any recovery media and the set-up ‘sheet’ said you should make recovery discs when Windows 7 was booted. And here is where I thought you should have set-up Windows 7 SE first, made the recovery discs, then installed Fedora 12. Luckily, I noticed there was a hidden partition on the hard drive with the label HDRECOVERY. A quick Google search determined pressing 0 when the Toshiba logo appears, then repeatedly pressing 0 should launch a recovery console. Which it did. The recovery options presented me with the ability to Factory restore the NB305, returning me to the state of purchase. When selecting this option, I was asked to set-up the C: partition size. I found this rather nice, as I didn’t want the NTFS partition to have the whole 250GB drive, so I set it to 100GB.
The restore took almost 2 hours, and put on the usual bloatware that a new PC comes with (Office 2007 Student and Teacher edition on a netbook? That’s just pain…). I removed all the extra bloatware from the Windows 7 SE partition. Once completed, I put in the Fedora 12 Unity DVD and installed Fedora per the usual instructions (partition, install, add the Adobe and RPM Fusion repositories, add the flash plug-in and gstreamer media plug-ins). This time around everything went much smoother. Everything with Fedora worked out of the box, no driver issues (wireless worked without a hitch). I only had to configure NetworkManager to run on boot-up in runlevels 345 (chkconfig –levels 345 NetworkManager on), that was my only problem with Fedora.
Dual Booting works flawlessly now this time around. The Fedora partition is the default boot target in GRUB, and will be used 99% of the time. The Windows 7 SE partition will remain on the hard drive, simply as an option for testing purposes for VPN, and firmware management for my Garmin GPS. I ran the netbook for almost three and a half hours last night, with another 4 hours remaining on the battery.


