Using 'foremost' to recover deleted files

I have a program for recovering deleted files from a Windows-based PC, but it only runs when you can boot into Windows. This works pretty well, but if you're trying to recover files from the drive Windows is mounted on, you risk losing over-writing files (while booting into the OS) before you get a chance to recover them. Plus, it cost money to license it, so there has to be a better way...

I found a neat answer in an Ubuntu LiveCD, with an app called 'foremost' doing the heavy lifting. Here's the recipe and run-down, probably not suitable for the absolute beginner, but good enough for me to re-use a year from now when I've forgotten again:

  1. Boot from an Ubuntu LiveCD (I used Ubuntu 8.10 Deskop Edition)
  2. Mount the Windows partition for viewing (mine was /dev/sda1)
  3. Plug in, and turn on, an external USB drive; make sure it mounts and shows up on the desktop (mine was /media/disk)
  4. Switch to the USB drive ('cd /media/disk')
  5. Enable the Universe and Multiverse repositories
  6. Run 'sudo apt-get install foremost' in a shell window to install foremost (it doesn't come installed on Ubuntu Live)
  7. Run 'sudo dd -i /dev/sda1 -o recover.iso' to copy the contents of sda1 to an iso image on your usb drive
  8. Run 'sudo mkdir recovered' to create a target directory for your recovered files
  9. Run 'sudo foremost -i recover.iso -o recovered/ -v' to actually recover the files (to the 'recovered' folder)
  10. Run 'sudo chown -R ubuntu:ubuntu recovered/' to make the contents of the 'recovered' folder accessible

Foremost will have created a series of folders inside the desitination folder ('recovered', in my example), categorized by files type. Any recovered files will be found inside them.

A couple thoughts:

  • You probably don't really need to create an iso image of the drive first, though I didn't try it without. I like doing it this way, because once you've got the iso, you can leave the 'real' disk alone and work from the iso.
  • You may have to 'force mount' the Windows partition, especially if it was so corrupted that it wouldn't boot. I won't cover that here, but Google will snap up plenty of examples of how to do it
  • Thanks to this blog post for much of this idea and instruction. Also check out the man page for foremost
  • Foremost comes pre-configured (check /etc/foremost.conf for details) to recognize a number of the most popular file types. Adding more files types is beyond the scope of this little article - and probably a step out of my own reach, for that matter. No matter, though...most of the files that are going to be important fit in that 'popular type' category.

Which browser is for you?

If you've been browsing the Internet for long, you're probably familiar with Internet Explorer, the web browser bundled with every Microsoft Windows installation. IE, as it's called, is a very popular browser, though some would argue it's popular only because of that bundling.

Did you know there are plenty of other web browsers out there, and that many of them can beat IE in important areas like security, speed, and features? The most popular browsers are free for you to download and install, and will integrate into your Windows computer seamlessly.

Web site developers often have several browsers installed on their computers so they can test their new web applications in as many different browsers as possible. I find that I prefer a certain browser for specific kinds of web surfing. For example, Google's Chrome browser is great for listening to Pandora Radio and interacting with Google applications like Reader, Calendar and Docs.

I won't go into a detailed comparison here, because it's been done thousands of times before and any comparison done here will be invalid in a few days. Instead, I'll offer a short list of popular browsers, along with some advice that you might want to try installing and using them. There's no risk in giving them a shot, and you might find a new favorite...

Firefox - Firefox is a product of the Mozilla project, and is a strong contender. It's generally more secure and feature rich that Internet Explorer, and is supported by a whole array of 'add ins' that you can install to extend it's ability WAY beyond 'just' browsing the web.
Chrome - a relative newcomer, Chrome has some very technical differences (behind the scene stuff) that many users won't care to hear. What those differences mean, though, is you get a very stable and clean web browser.
Opera - touted as a very fast browser, Opera is a mature product that leads the way with some neat features (like the 'speed dial' interface/startpage).
Safari - Apple's major web browser offering. If you're reading this from a Mac, you're probably using Safari already. If you're reading this from a Windows machine, you can install Safari and see the web world like a Mac user.

One last comment I'll offer is that some web pages behave better in one browser than another. If you have a couple browsers installed, when you run into that page that just won't load correctly, you might be able to load it up in another browser and have better luck. Have fun!

Engrish.com

Two sites (or one, really, divided into parts) finding humor in the difficulty that is the English language.

Rated 'PG':
http://www.engrish.com

...and it's Rated 'R' counterpart:
http://adult.engrish.com

My sides ache after reading through them...

The Septic's Companion

OK, so I've already posted about this on FaceBook, and I'm sure I had something about it 2 years ago on my (old) blog, but Chris Rae has a really funny book out that compares the American definition of various words to their British counterparts.

Here's the link...if you go check out the site, you can get a very good sample of Chris' writing style and sense of humor, without paying a penny.

The Septic's Companion: A British Slang Dictionary - A dictionary of British slang, written by a Scotsman living in America

I'm waiting for my copy to arrive, so I haven't confirmed this personally yet, but Chris assured me via email that my name is given proper credit somewhere inside...presumably in painfully tiny print, for a definition I gave him to include. That's probably as close to being published as I'll get, but I'll take it. Thanks Chris!

In the spirit of full disclosure, Chris has also promised a free copy of the book, just for posting this and promoting for him. Since I'll then have 2 copies, I'll take bids/bribes for giving one of them up, if you're interested. Or maybe you'll get lucky and I'll give you one for Christmas or something.

Faxing by Email

With (especially business) users on the go more and more, we're finding ourselves less tied to a 'real' office environment. One of the classic tie-downs, though, is the fax machine. Still a useful tool, is there any way to keep the convenience of a fax, but take advantage of new technology and cut the ties to the office? If not, this would be a short article; read on for an explanation and example:

"Email to Fax" and "Fax to Email" services are available from various online companies. Essentially, you pay a monthly service charge to the company, and they give you a phone number you can use for fax transmissions. When someone sends a fax to your number, the fax is converted by the service into an email message that shows up in your email inbox. Usually, the original fax message is attached to the message in pdf format, but other options are available.

To send a fax using these services, you (usually) are given a special email address to send your faxed to. You compose the email message and attach documents if you want (pdf, doc, xls, etc.). The service converts your message into a fax transmission and delivers it to the destination fax machine. Most of the time, the recipient has no idea the fax came from your mail account and not from a 'real' fax machine.

Pricing for fax>email services varies widely, but (as of this writing) GoDaddy.com offers plans as low as $9 per month, or $13 per month for a toll free fax number.

IMAP vs. POP mail accounts

More and more users are taking their email on the road with connected devices (i.e. Blackberry, Palm, Windows Mobile phones), so staying connected is easier than ever. It can get a little complicated, though, if your mail account isn't set up properly for your growing needs. If you're struggling because some of your email is only available at your desk, and some of it is only available only on your phone, read on for (hopefully) some help...

Most consumer (and business) email accounts are set up as POP (or POP3) accounts. POP stands for Post Office Protocol...and this kind of email account works a lot like the real Post Office. The server (the Post Office) holds your mail/email until you 'pick it up' by clicking 'Send/Receive' in Outlook Express, or some other email client. From that point on, the mail only exists on your local computer...the copy on the server is deleted afte the mail is downloaded to your local computer. Since mail can only be delivered to one place by the post office, you also can't get access to those messages from any other computer.

The other major option for email is called an IMAP account. With IMAP, the mail always stays on the server. When you want to view it, you open up a program (like Outlook) and that program goes out the server to get a list of messages for you to view. You read, compose, reply, forward, and delete the messages just like in a POP account, but you're just looking at a local copy of what the server is holding for you...the messages don't actually exist on your computer. This allows you to move to a different computer, access your email account, and see the exact same message list. IMAP gives you 'anywhere-access' to your messages.

The downside of IMAP is that it requires you to be connected to the Internet constantly...it's not very good at working offline. If you have a steady, high-speed Internet connection, this isn't usually a problem...but it's worth considering if you use dial-up.

Cost-wise, there isn't much difference...but IMAP is slightly more expensive. This is especially true if you have a lot of email, and you're not the deleting kind of user, because you have to pay for constant online storage of those messages.

Here are links to other discussions about IMAP vs. POP mail accounts.
http://www.helpdesk.ilstu.edu/kb/index.phtml?kbid=1172
http://www.washington.edu/computing/windows/issue13/imap_pop.html
http://www.imap.org/papers/imap.vs.pop.brief.html

Google Chrome's crash dialog

Hey, if your web browser is going to crash anyway, it might as well have a little personality. This is better than the cold messages you normally get from applications.

inline:screenshot.5.png

Globetrotter action

Photo_012709_002.jpg

Cold morning

Photo_012709_001.jpg

That's -22F. Sheesh.

View/Copy Windows RAID0 array from Ubuntu Live CD

I had a customer computer, which was running Windows XP Pro on a RAID 0 array (striping). There were twin 230GB hard drives, striped into a 460GB RAID0. Customer bought new 1 TB drives, and wanted them installed. This time, though, there would be no RAID, just one drive for the OS and programs, and one for the customer's data.

I wanted to see if I could get Ubuntu's Live CD to copy the RAID0 partition from the old drives to a new partition on the new terabyte drive. The Ubunut (Ibix, 8.10) Live CD comes with GParted on it, so copying partitions from one disk to another is a snap. THe issue is that you have to get Ubuntu to recognize the Windows FakeRaid before you can copy anything...GParted won't (by itself) see the RAID0/striping, and it wil look like two unformatted disks.

The solution, it turns out, is pretty simple. You only have to install one more package to let Ubuntu Live see your RAID. Boot to the Live CD, make sure the machine has an Internet connection, and issue the command:

sudo apt-get install dmraid

Once that's is complete, (re)start GParted, and your RAID devices will show up in the list. Note that they'll have some craxy-long complex names, but there's logic to the naming. The one without the numeric identifier is the actual RAID, the others are the participating partitions. This is what mine looked like:

iswbfjbdhhceaARRAY
iswbfjbdhhceaARRAY1
iswbfjbdhhceaARRAY2

You can now use GParted as normal to copy the partitions from your array to the new hard drive.

Small issue with eeePC dial-up over Palm Treo 755p

In a previous post, I wrote about setting up a tethered dial-up connection using a Palm Treo 755p and an eeePC.

It seems that during the upgrade process from Ubuntu 8.04 (Hardy) to 8.10 (Intrepid), something changed in the networking modules and broke this...a little bit.

The problem was that after the upgrade) the system was holding onto the 'default gateway' of my wired connection, even after dialing up the ppp connection, so it wasn't properly routing requests (trying to send requests through the ppp network, via the the wired default gateway).

I found this post where a suggestion to include 'replacedefaultroute' in ppp-script-treo solved the problem.

Installing an APC UPS to support an Ubuntu server

I just had an opportunity to install a new APC (Model BN1250LCD) UPS to support an Ubuntu Linux server. Configuration was really easy thanks to this post on the Ubuntu forums and this post in Ubuntu's Community Help documentation.

The only oddity I noticed was that after starting apcupsd, there was no notice in the /var/log/apcupsd.events of the successful start. No big deal, I guess...it still responds to /etc/init.d/apcupsd status with all the happy details of the UPS' condition.

I ended up plugging my cable modem, wireless router, printer, and scanner into the UPS too, just to try to keep some 'extra' services alive for as long as possible. Even with all that plugged in, the UPS still reports only about 16% load.

Incidentally, Sam's Club had the best price for this device...pretty cheap insurance at $140, me thinks.

A wiki-markup style url filter for Drupal 5

Since I started using Atlassian's Confluence in a few projects, I find myself wanting to type in wiki markup everywhere. I especially like being able to create links like this:

[Title of url|url of link]

Using this markup, you can type something like this:
[John's Blog and Stuff|http://www.gobowen.com]

...and get this:
John's Blog and Stuff

I think that's a really easy system to remember and use. So, I took my first stab at writing a custom module for Drupal, a filter that can be used in the Input Formats to produce this kind of link. Rather than start completely fresh, I copied a good deal of the concept from the amazon filter for Drupal and just adapted it to my own purposes.

It works, but it needs work. The Regular Expression validation and matching is very weak. If you're reading this and want to improve on things, have a go at it and let me know how it turns out.

The code is attached. I recommend assigning it as a filter before the default url handler filter in Drupal...otherwise, you may get unexpected behavior.

AttachmentSize
wiki_linkify_filter.tar.gz6.94 KB

OpenOffice.org - speeding up load times

I already love OpenOffice for all the typical reasons (functionality, freedom, etc.), but it's always been a little slow to load. It might take 15 seconds or so to initially open writer or calc...once they're open, everything is fine...it's just that load time that's a little annoying.

Here's a link to an article that shortens that load time by allocating more memory to OOo. I *did not* try the JRE trick listed there...just the first part about changing memory usage in Tools>Options>OpenOffice.org.

With that done, OOo load time is down to 3-4 seconds!

view from the blind

Photo_111508_001.jpg

Welcome to another opening day of the firearm deer season in Michigan...something of a local holiday I guess.

Here's my view on this windy afternoon...

Cron.daily scripts that don't run on Ubuntu

I found a really nice script that backs up all my MySql databases on a rotation, and generally provides insurance against database crashes and the like. I followed the instructions given, popping my copy of the script into /etc/cron.daily, and double-checking the permissions. The only change I had to make to get the script to run properly was to set #!/bin/sh at the beginning of the file...after that, I could run it *manually* all I wanted. Neato.

But, I found after the first night that autocron wasn't running my new script (at least, I wasn't getting the email notification about how the backup went). So I went digging around and found this article, where the author mentions he had the same problem and _may_ have found a solution in removing all the '.'s from script names in cron.daily.

I took a quick look inside cron.daily, but besides my own new script (automysqlbackup.sh), there are 5 others that have dots in their names...presumably, they were put there by a package/tool...they can't be wrong...right?

A little more digging turned up a suggestion to run "ls -lut" in the /etc/cron.daily folder, essentially listing the scripts by their last run time. Check this out:

screenshot_1.png

My script has been renamed already in this screenshot, but you can clearly see that the scripts with a dot in their name haven't been run in a long time (probably not since they were created).

I'll try to post back tomorrow with results, but it sure looks like that advice was right on...*scripts in cron.daily (on Ubuntu) won't run unless there is no dot (".") in their name*.

[update:2008-11-25]
This has worked perfectly since making these changes!
[/update]

Test post with image attached

If things go well, this post from email will have an image of a doggy
inline right below this text...

black_dog.jpg

AttachmentSize
black_dog.jpg4.31 KB

Test post with image attached

If things go well, this post from email will have an image of a doggy
inline right below this text...

NOT FOUND: 1

Drupal MailHandler - a learning curve

My first, second and third tries at posting to this Drupal site from a cell phone have taught me a lot about the MailHandler module. They've also left me with a few questions.

I've learned that you don't want 'Full HTML' set as the 'Input Format' for email-submitted items. It's probably best to come up with a custom input type, but for now I've settled on using 'Filtered HTML'. Also, make sure your phone/email application isn't sending HTML formatted messages. That will add an extra set of and tags in your post, which is in a page that already has those tags. It just screws up the pages' HTML, which could lead to unexpected results.

A larger lesson I've picked up is that you have to be careful with the 'default commands' you enter in the Mailhandler module's settings for your email account. In my case, I made the mistake of setting 'type: Story', thinking I wanted all my emailed posts to end up as stories (on this blog).

Unfortunately, Drupal recognizes 'story' as a content type, but 'Story' is only partially recognized. It would display (in view mode) OK, but trying to edit these 'Story' types would give me a blank screen (well actually, it had the site's title, color scheme, etc...just no body content for the post to be edited).

Changing the node type in the database from 'Story' to 'story' made all this better.

Now, to figure out how to keep images that were attached to the message...