pdftk - command line magic for PDFs

Wednesday, August 27th, 2008

Sorry it’s been so long since I posted. Things have been busy this summer with family reunions, family visiting, on-call of course, and all the normal fun of life.

So here’s at least a little fun to share. I’m sure you occasionally want to chop up a PDF file into tiny bits and then re-assemble it. For instance if you’re teaching a class and you want to give students the chapter they’re working on and the glossary at the back.

Enter pdftk onto the scene. It allegedly runs on *nix, Windows and Mac. I can only testify for the Windows portion of it. I know, you’re saying, “BUT THIS IS A UNIX BLOG.” Well, I decided that something was better than nothing.

So anyhow, it’s free, go download it here and try it out. Like many command line commands it’s a bit enigmatic, but try the –help flag and you’ll be jamming in no time.

My Current Desktop

Tuesday, June 10th, 2008

I use John’s Background Switcher to rotate my desktop images.  It has this cool feature that John calls a snapshot scrapbook where it downloads images from flickr and then creates a desktop that looks like someone threw a bunch of polaroids on your desk.  It’s pretty cool, plus it’s free and supports dual monitors.  Check out the image:

How to Remove Link Scanner from AVG8, anti-virus scanner

Friday, June 6th, 2008

Yesterday Lifehacker ran an interesting poll, link here, about the best anti-virus product currently available.  Many of the comments are a bit silly, but it started a conversation between me and Claus Valca that fixed a recent gripe I’ve had with AVG8.

Before I go on, I should probably explain why I don’t use one of the big AV scanners.  I use freeware anti-virus scanners at home because I’m cheap.  I used to load AVG on every computer I owned, but somehow AVG determined that I was using more copies than was legal(you can load a copy on one non-commercial computer) and they popped up a window telling me that I was breaking the law.  Now, it could have just been a scare tactic, but it made me go out and read AVG’s free license options very carefully.  And since there were other freeware options, I just diversified.

I run AVG on my most important system because it is a real-time scanner so it can prevent me from goofing up.  On the rest of the computers I run Clamwin which is nice, but will not prevent me from goofing up.  I am considering trying Avast anti-virus, but that’s for another post.

Now, I recently upgraded to AVG8.  But it has a new feature that isn’t very zippy in it’s performance.  The Link Scanner option really slows down browsing on computers, especially when you execute a google search and you get 10-50 options and the Link Scanner is checking each web page for it’s nastiness level.  Now, you can disable the option, but then you get a red exclamation point in the systray and I don’t like red things in my systray.  Red to me means bad, and I like mostly green things in my systray so that I know the system is healthy.

Claus, remember Claus?  I mentioned him at the beginning of the post, experienced this same problem and blogged about it.  Some nice, anonymous person read about his pain and sent him a command line hack to fix this problem.  It’s so awesome.  Download the binary from AVG via this link.  Save the binary to somewhere, then run it from the commandline with these two flags:

avg_free_stf_*.exe /REMOVE_FEATURE fea_AVG_SafeSurf /REMOVE_FEATURE fea_AVG_SafeSearch

then accept all the default options, accept licenses, etc until you get to the add/remove components, repair, and some third option.  Select the add/remove components and then continue all the way through and whammo, you will have AVG8 sans Link Scanner.  You will probably have to update your virus definitions, but that’s no biggy.

Big Kudos to Claus for so thoroughly reviewing this product and to the anonymous poster who helped relieve this pain!

Dell found a way to keep selling XP

Friday, May 16th, 2008

Microsoft is still moving forward with plans to stop selling XP on June 30, but in the meanwhile Dell has found a loophole in the contract that will allow them to sell XP as a downgrade license from Vista. Infoworld wrote about it in their Save Windows XP blog here.

This is a good deal for Dell, but seeing as how Dell’s support structure appears to be going downhill, this isn’t really the answer we need for our solutions. My employers usually give me a laptop to support their operations and for a few years now they’ve been Dell’s. But for my home systems, I just refuse to buy complete systems from integrators like Dell.

This is primarily due to the fact that I refuse to spend time with horrible customer service troubleshooting issues. I’m not commenting on Dell alone at this point, as all desktop support has become a great way to ruin hours and hours of time that you could be earning money, cruising the web or playing computer games. Plus, I require redundancy on all of my filesystems at home which means that as soon as I’m on the phone with tech support I’ve got a problem that they’re incapable of supporting.

Now I’ve already discussed in previous posts that this will be my last install of a Microsoft operating system. Ubuntu has finally produced a decent desktop out of Linux and I plan on building a solid desktop that can do just about everything my current computer can do. But what about games, you say? Well I’ve held out against game consoles for long enough. It’s time for me to bite the bullet and pick up a wii or something else that I will enjoy. And now that vista is so outrageously expensive, the argument is so much easier.

But if you’re in a position where you need to buy desktop computers for a business setting, you probably should consider Dell and their downgrade license.

Fiber or Fiber-Hybrid the only feasible technology for the next decade

Friday, April 11th, 2008

Ars Technica has an interesting article up about the various broadband technologies. And it appears that DSL still sucks, cable is ok but needs a bigger pipe(fiber) to your block, and fiber all the way to the house is expensive but most who have it love it. Read the actual page here

p.s. and they propose running fiber cables with ferrets or weasels in some unique circumstances. No, it’s not a late April Fools joke.

Automating backups to mediamax

Wednesday, February 14th, 2007

I was duly impressed with the 25GB of free storage mentioned in this lifehacker post, http://lifehacker.com/software/online-storage/get-25gb-of-free-online-storage-at-streamload-mediamax-234272.php, and so I set out to find a way for it to be useful. It’s worth mentioning that even though you can upload 25GB you can only download 1GB without paying a $5/month fee. But I’ll only need that when I need these backups or I may be able to keep backups of just the REALLY important stuff.

So the first thing to figure out is what’s the really important stuff. I googled around a bit to see what others thought was worthy of backing up. It seems like this is the sort of stuff people worry about the most:

  1. original content I created
  2. pictures
  3. financial documents
  4. system configuration files
  5. saved games
  6. system drivers(or I would if I could figure out a way to do it from the command line)
  7. registry AKA System State
  8. system keys/licenses
  9. bookmarks from browsers
  10. scripts

Things I’m NOT backing up:

  • my .pst file. I only use Outlook at work and I have a different backup solution there.
  • my calendar or address book. Those are again generally work related and the data is backed up via syncing to my Palm and another backup solution.

Then it’s time to set up a mediamax account at http://www.mediamax.com. Answer their confirmation email. And also use a command line interface to log into the FTP interface and create your backup directory. Basically that comes down to the following:

Start->Run->cmd->ftp ftp.mediamax.com -> username->password->mkdir backup->quit

Then it’s time to set up your backup scripts. I based mine off of the efforts of Adam Pash and BostonMark ala http://lifehacker.com/software/version-control/hack-attack-simple-version-control-170164.php. You can find my versions at http://danieljdoughty.com/version-control-with-ftp-backup.0.2.bat and http://danieljdoughty.com/ftp-backup.ftp. You may have to right click and select save as. I set up these files in the c:\scripts folder. If you want to put them there, you’ll probably have to create the directory. If you choose another location, you will have to adjust the batch script to compensate for the new location of the scripts directory.

You’ll need to modify these files. Modify the version control script with textpad and alter the section that is to be downloaded, AKA %HOMEPATH%\My Documents\Simple Version Control. And you’ll need to set your own username and password in the ftp-backup.ftp configuration file.

If you want to backup your IE bookmarks I advise you to use autohotkey, http://lifehacker.com/software/software/download-of-the-day-autohotkey-118270.php. Then you want to download my autohotkey used to get IE bookmarks, http://danieljdoughty.com/getIEBookmarks.ahk

CAVEAT: I’m an avid Firefox user and IETab user. Don’t bash on me backing up IE stuff. I work with developers who are instructed to code only to IE. It’s easier to use IE for these internal web pages than to argue with every developer in the department about how Firefox is different. I’m usually having a hard enough time convincing them that there’s a problem with the app.

Now run a test run. It’s best to do that from a command window as you will be able to scroll back and see if there is a problem somewhere in the processing. If it looks good, then log into mediamax. Under the File Manager section you will see a folder titled Uploaded File. Expand it out and you will see your backup files.

Finally schedule that backup in your windows scheduled tasks ala http://lifehacker.com/software/feature/hack-attack-using-windows-scheduled-tasks-153089.php and you’ve got a backup set up for some of your most important stuff.

CAVEAT: I’ve heard awful reviews of mediamax’s customer service. So you may want to choose another webhost for this sort of thing. Since I’m not paying for their service, nor do I intend to use more than 1GB ever, I don’t think I’ll worry about it too much.

THINGS LEFT TO DO: I should add some code to delete the original backup folders and not delete the zipped file and also to add some limits. For instance, only keep local copies of the backups for so long. Also to delete remote copies after some time. Maybe tomorrow.

Also need this thing to clean up after itself.

External USB Drive issues: Healthy GPT Protective Partition

Friday, January 5th, 2007

So I’ve decided to start putting some old drives to use lately. I played around with freenas for a while but the throughput was pretty miserable and I had other issues. I now suspect that those issues were actually symptoms of another problem but in the meanwhile I sought another solution. That’s how I started looking into putting my old IDE drives into external USB enclosures.

The first problem was with the jumper settings on my disk. Apparently drives should always be set to master if you want them to be recognized. Unfortunately XP doesn’t really explain that in any of it’s troubleshooting. In fact, it will install the device and tell you it’s up and running but you’ll not find the drive under Disk Management like you’d expect.

I also read the documentation for a while and reinstalled the disk into another system. That’s because some of the documentation indicated I should reformat as FAT32. I did that and it didn’t help either. But once I set the disk to master, it at least was visible in XP.

But even then I couldn’t work with the disk. Under Disk Management the system was listed as Healthy (GPT Protective Partion). I don’t have a good answer for why this happened. This normally happens to linux disks migrated to a Windows system. And I did use a linux utility to format the disk to FAT32 but it shouldn’t have left any traces. In fact I used GParted, http://lifehacker.com/software/partition/download-of-the-day-gparted-live-cd-175024.php, ; since Gina Trapani’s site lifehacker.com recommended it. I still think the utility is useful but maybe not for this use.

Finally I located information about how to fix this problem at (currently this web page is down http://www.freshscoop.com/modules.php?name=News&file=article&sid=5 ;, but I’ve mirrored it locally.  Click Here.

I used that utility to low level format the first 4096 sectors, rebooted, and whallah, now she’s cooking with gas. Good luck with your own external adventures.

Here is the type of external enclosures I used. They work just fine. Frankly, I bought them because they were available locally at Microcenter for a fair price.

RedHat I bid thee adieu

Thursday, February 16th, 2006

I’m tired enough of redhat that it’s time to explore other options. I’ve been having yum issues for years now(yum is the program you use to patch RedHat) and it’s finally time to just look to another OS. Asking for $180 a year for updates to an operating system is just unrealistic. All of this for a silly little box that is running a Pentium 2 processor. The box is literally worth $5. But I’m going to pay $180 a year to run software on it? I generally don’t like variable pricing, that is to say like what Oracle does but in this case it would make more sense.  If you’re running a single processor ancient box, $25 for updates.  If you’re running a 16 processor box that can compute a googl, that will be $1000 for updates. What’s a little silly is that this is an increase from the old prices. They used to beg for $100 a year but give you the updates for free if you wouldn’t donate. I hate to go back to Windows, but at least Microshaft understands that I don’t want to license my OS. Actually, I’ve read that Microsoft explored the idea and realized it wasn’t feasible, probably due to the strong competition by Google.

OK, so if you’re a non-geek and still here I’ll attempt an allegory. Imagine that instead of buying the transmission to your car you instead decided to lease it. You own the car and you get to design the cockpit…but you have to pay an annual fee(FOREVER) just in order to get the thing to move. It’s just an absurd idea initially. Then when you price it improperly there’s no reason to bother with it all. Imagine if they asked you to give them $3000 a year for your transmission, in addition to your usual car loan payment.

So anyhow, this begins my foray into freeBSD. Never had a reason to not like it…it’s just that fedora and redhat were always so cheap and accessible. Time for a change.

hard drive woes

Monday, January 30th, 2006

My hard drive woes are fixed. Remember that hard drive I bought for the DVR? Finally got it returned to newegg(it died shortly after I started using it.) Now I tossed it in my main computer that’s been running poorly lately. So I mounted it up on my sata channel. At first it wouldn’t mount. Checked the manual and find that I have to set a DIP switch. Got that knocked out and then the OS blue screened. Crossed my fingers and just tried again. It booted.

And surprise surprise….it turns out I have on-board SATA raid. So install the drivers and get moving. In the meanwhile I pull up the PDF on the hardware. Even better. The system doesn’t have to build a RAID from scratch. I can move data to this drive then add a backup drive later on and it will migrate the data to the new drive. So next paycheck I’ll dump $110 into another Seagate Barracuda at newegg and I’ll be sporting two RAIDs on the same system. Plus I can put a new XP load on this system(it’s 30 months old.) and really enjoy life.

holy crap what a good read

Tuesday, May 3rd, 2005

I don’t usually dig essays, but this one is pretty compelling. http://www.paulgraham.com/nerds.html

Some snippets can be found below.

Nerds aren’t the only losers in the popularity rat race. Nerds are unpopular because they’re distracted. There are other kids who deliberately opt out because they’re so disgusted with the whole process.

I’m not claiming that bad schools are the whole reason kids get into trouble with drugs. After a while, drugs have their own momentum. No doubt some of the freaks ultimately used drugs to escape from other problems– trouble at home, for example. But, in my school at least, the reason most kids started using drugs was rebellion. Fourteen-year-olds didn’t start smoking pot because they’d heard it would help them forget their problems. They started because they wanted to join a different tribe.

Misrule breeds rebellion; this is not a new idea. And yet the authorities still for the most part act as if drugs were themselves the cause of the problem.

If life seems awful to kids, it’s neither because hormones are turning you all into monsters (as your parents believe), nor because life actually is awful (as you believe). It’s because the adults, who no longer have any economic use for you, have abandoned you to spend years cooped up together with nothing real to do. Any society of that type is awful to live in. You don’t have to look any further to explain why teenage kids are unhappy.