Standard Mischief

Archive for April, 2008

*nix mischief: fun with “file carving”

I had these really important photos on my hand-held device, with a backup on the PC when I caught a case of teh stupid and erased them one night to make some space. On next sync, the files were “deleted” per standard sync procedure, which in a ext3 file system means that the inodes were erased, effectively marking those spots on the hard drive as available for reuse. I didn’t really think about the files going “poof” until about 36 hours later.

Quote from me: “Oh crap”

When I got home, I shut the system down. While the PC was up, there was always a chance that something would write to disk, and overwrite those important files. After some study and research, I found Foremost, a program to do “file carving”. What this program does is search an image of a filesystem and copies out any series of bytes that have the proper start and ending hex strings. you can look through the raw data and copy out anything that looks like a jpeg or a html file, or just about anything else you want to search for. Here’s something of a step-by-step. This is basically what I did, except without the tedious research between many of the steps to make sure I was doing the right thing.

  1. Boot the PC using a Linux live CD that does not automatically mount hard drives. I used an old copy of Ubuntu I had lying around, therefore instructions here will be tailored to that distro. By default, Ubuntu will use any swap space it finds, but will not auto-mount any file systems.
  2. I had space on my hard drive, so I used a partition program to make a new 8 GB partition.
    If there wasn’t any space, I’d likely have to install another hard drive or something. I used whatever came with Ubuntu, likely Gparted, to format the partition.
  3. In Ubuntu, you will need to go to software sources and enable via check box the universe and multiverse options. I believe everything is in the universe repository, but why do this step twice?
  4. Drop down into console (command line) and mount your new partition. You could also mount anything where you have enough space, and this could be network drives or flash drives, or anything that works for you. Just don’t mount the partition that contains the files you want to recover. I used $ sudo mkdir /home/hda4 to create the mount point, and then $ sudo mount -t ext3 /dev/hda4 /home/hda4 to mount the partition.
  5. Use dd to make an image of the unmounted partition where recovery took place. I used $ dd if=/dev/hda3 of=/home/hda4/image.dd bs=4096 conv=notrunc,noerror
  6. Get Foremost. I used $ sudo apt-get install foremost
  7. I also had to get some tools for interfacing with Palm PDA. Depending on what you want to carve, you likely won’t need this. For me it was $ sudo apt-get install pilot-link
  8. Run Formost on your disk image. I had to write my own formost.conf file. Full details are on the man page. I won’t go into details because it’s not likely that you will be searching for the exact same kinds of files as I was. I was looking for files that ended in jpg.pdb, and I had to create some example files first and then do hexdumps to see what the files start and end with. Fun.

In the end I recovered the photographs, but I ended up not ever needing them. They were from a hit and run accident where the lady that plowed into me ended up stopping long enough to talk to me and call someone else, but then abruptly left when I was on the phone with the police. Luckily, I had pictures of the other vehicle with license plates and after contacting her insurance, and every possible delay, her agent finally cut me a check for the damage.

I’ve really got to work on my incremental hard disk backups.

2008-04-30 01:00 by Standard Mischief, Filed under:don't try this at home     4 Comments

Spam Karma 2.3 rc4 update

I wish Dr Dave would put up a RSS feed for new releases or something. Anyway, I was at Spam Karma 2.2 r3, but now I’m giving 2.3 rc4 a spin.

The only problem I’m really having spamwise nowadays is people who create actual WordPress spam blogs (splogs) and create actual posts actually linking to me. Ye Olde Spam Karma couldn’t tell the difference between a splog and a actual blog. I’m not sure if SK2.3 fixes that.

I might want to see if I could cobble up a plugin for SK2.3 that would let you create a whitelist to give people on your bloglist a boost of karma, and then just set everyone else that pings you to moderation or something. Unfortunatly, my PHP-Fu is lacking.

The other minor issue is that the Spam Karma comes zipped up in a folder called SK2. You know, just like the last version did. I’ve renamed the new folder SK2.3rc4. Hopefully that won’t be an issue.

Watch this space, because If anything goes wacky, I’ll report.

2008-04-29 12:18 by Standard Mischief, Filed under:standard mischief blog news     No Comments

Won’t work, nice try though

I figured someone else would say something already, but no one has.

Sailorcurt takes up on the suggestion that we all use the Brady Campaign’s business reply envelope as a mailing label, gluing the thing to something heavy like a brick. The idea being that the Brady Bunch would have to pay more money out of their own funds to receive something useless.

It won’t work, but it’s a nice try though.

It’s really no surprise that a quasi-goverment 23rd level bureaucratic quagmire such as the United States Postal Service has a regulation to exactly cover this situation. The USPS also has regs that cover the placement of rubber bands on bulk mailing bundles of magazines and the fluorescent properties of the stock used to print postcards.

In this case one of my favorite columnists, Cecil Adams, tells me that it’s reg 917.243(b):

According to rule 917.243(b) in the Domestic Mail Manual, when a business reply card is “improperly used as a label”–e.g., when it’s affixed to a brick–the item so labeled may be treated as “waste.” That means the post office can heave it into the trash without further ado.

You could probably stuff it with newsprint, and seal it. That would cost them a few cents. You could enclose a target or two from your last range session, but that might be interpreted as a threat. Another idea from Ask Metafilter is to request a copy of their IRS Form 990. Wikipedia says:

Public Inspection IRC 6104(d) regulations state that an organization must provide copies of its three most recent Form 990s to anyone who requests them, whether in person, by mail, fax, or e-mail. Additionally, requests may be made via the IRS using Form 4506-A, and PDF copies can often be found online on sites such as Foundation Center’s 990 Finder and Guidestar.org.

You know, if you really want to cost a non-profit some coin, you could take an old fax modem, a standard analog phone line, and a computer and fax in your requests for those IRS form 990 from those non-profits. I think there’s some ad supported web-to-fax services out there too. It would probably take an army of clones to make a serious dent in their finances, but I suppose every little bit helps.

Please be aware that POSTNET, the current postal barcode is being phased out for the Intelligent Mail Barcode (to be required in 2009). Intelligent Mail Barcodes encode both the mailing and return address and if it was used on business reply envelopes (I’m not 100% on the regs, so I’m not sure) would probably allow that brick to be traced back to you.

2008-04-29 08:00 by Standard Mischief, Filed under:deranged rants     10 Comments

In defense of Pizza Hut, or why, there ought to be a law…

Say Uncle is upset with Pizza Hut for their firing of a delivery driver who defended himself with his lawfully carried firearm. There are a few “hell yea, me too” messages in the comments, and a mention in the VCDL blog too. Some people have even threated to boycott the company in response. While I certainly have to admire commitment to only patronize businesses that support all of our civil rights, I think that there’s a few points being missed.

  • Pizza hut gave the former driver two months severance pay and was offered help finding a new job by the company

Really. For a pizza delivery job. To me that says “We really don’t want to fire you, but our lawyers are making us”.

  • Every single pizza chain delivery store has the same policy. So do most convenience stores and many other retailers.

The reason most retailers have these workplace rules is strictly economics. In this example, Pizza Hut with the deep pockets does not want to be successfully sued by the wounded would-be robber, or in a (theoretical) different case, the dead bad guy’s family. So they have a corporate policy against weapons, and they enforce it when they have to.

I don’t usually like to say “tort reform”, because that’s usually just lawyer-speak for “reform” regarding who get socked with writing a big check, rather than meaningful reform of our legal system. I do think something needs to be changed.

So since the NRA is so much better at shielding the corporate limited liability thingys from frivolous lawsuits solely aimed to drive manufactures out of business – such as the Protection of Lawful Commerce in Arms Act, something I wholeheartedly agree with – than actually, you know, restoring rights to individual citizens, perhaps we could push for some reform this way.

Something like if limited liability companies do not have policies that limit individuals from lawfully carrying firearms for the defense of their own life, then they are automatically shielded from any lawsuits arising from the personal defensive use of those firearms by their employees.

Oh, and while I think Pizza Hut pizza by and large is subpar and too greasy, I think their “hand-tossed” style is pretty good in a corporate consistent mediocre way. The main problem with all the chains and most of the independent shops is that they use the cheapest mozzarella available, and that cheese simply doesn’t taste at good as the good stuff.

2008-04-28 11:42 by Standard Mischief, Filed under:deranged rants     1 Comment

WordPress version 2.5.1 – here we go again

Well, it’s pretty painless to me, because I install and update mine via Subversion, but still. I can barely get a post out before another important exploit fix comes around.

In addition to the security fix, 2.5.1 contains many bug fixes. If you are interested only in the security fixes, you can download these corrected copies of wp-includes/pluggable.php, wp-admin/includes/media.php, and wp-admin/media.php. Replace your existing copies of these files with these new copies.

I hope your host has one-click install/update at the very least. If you don’t want to do the whole installation again, it seems you can rename your old files with a .bak extension, and copy over the three new files as a quick fix.

Subversion Mischief:

$ svn sw http://svn.automattic.com/wordpress/tags/2.5.1/

Update: there’s a recommended but optional updated wp-config.php in the new package, but it’s called wp-config-sample.php to keep it from overwriting your current file. To use it:

  1. Rename your old wp-config.php to something like wp-config.OLD.php .
  2. Open that same file in notepad or another simple editor. Word wrap should be off.
  3. In another window, open wp-config-sample.php for editing.
  4. Copy over the proper DB_NAME, DB-USER, DB_PASSWORD, and if needed, DB_HOST.
  5. Scroll down to where it says ‘put your unique phrase here’, and between the quotes, insert a long string of random upper and lower case letters and numbers, or use this page to randomly generate yourself a string
  6. Save this file as wp-config.php . You’re done. If you used notepad, please check to see that the damn thing didn’t add a .TXT extension to the end. Go and load your blog and make sure everything is working.
2008-04-25 22:45 by Standard Mischief, Filed under:standard mischief blog news     No Comments
current.png

Powered by WordPress , Theme Ported to Wordpress by Liu Xun. Original Design by Cathayan