Category Archives: Tips

Another Very Poor Man’s Google Analytics Post

1 minute, 15 seconds

A bit ago I wrote a post about using command line tools to get stats of this blog. I recently wrote another version of this to get the most popular posts here, sorted by the most popular at the top. I love that this can be done in all in one command.

Here’s the command:

tail -1000000 access_log|grep 'GET /blog'|cut -d" " -f 7|egrep -v '.png|.jpg|wp-includes|.css|/page/|/category/|xmlrpc|wp-trackback|/feed/|wp-login|/wp-content/|/trackback/|wp-comments|wp-app.php|wp-admin|comment-page|index.php|?p=|page_id|comments|feed'|sort|cut -d"/" -f 3|uniq -c|grep -v ' 1 '|sort -nr>plip.blog.tops.txt

This breaks down into the following:

  • get the last 1000000 of the blog access log
  • look for requests to “/blog”
  • split by space, and get the 7th field, the URL being requested
  • exclude a ton of items
  • sort the results
  • split by the “/” slash and get the 3rd field, the blog name in the URL
  • get the unique list of blog names with a count for each URL
  • remove the singletons
  • reverse sort so the most popular is at the top
  • write it all to a file called plip.blog.tops.txt

The results are in! The winner is currently chocolate-crinkle-cookie-photos! W00T

   137 chocolate-crinkle-cookie-photos
   119 two-loves-css-recaptcha
   109 24-hours-in-photos
   104 our-pet-venus-fly-trap
   103 ruby-less-way-to-add-key-frames-to-flv-videos-for-the-likes-of-jwplayer
    94 toss-your-salad-code
    91 update-firefox-does-have-reset-more
    91 firefox-reset-is-really-launch-in-safe-mode
    84 keep-those-passwords-safe
    81 photos-food-bikes-sunsets-and-stars
    79 thoughts-on-very-large-monitors
    78 when-the-cat-is-away-the-worms-will-play
    76 photos-from-around-the-bay
    76 our-tree
    75 one-foggy-morning-in-my-commute
    74 wordpress-exploit-fog-fruit-plants-and-plates
    72 recaptcha-now-google-recaptcha-will-help-google-books
    72 from-burning-man-town-to-oaktown
    67 gmaps-pedometer-google-calc-8-94607843-minutes-per-mile
    66 the-massive-compost-tower
    65 on-theft-privacy-and-data-loss
    64 pizza-and-dough-from-scratch
    60 this-is-not-an-ipad
    60 go-faster-encoding
    57 fixed-theme-wp-updated-more-wp-hacks
    44 every-vehicle-is-a-prius
    42 photorec-to-the-rescue
    41 the-very-very-poor-mans-google-analytics-tail-cut-sort-uniq-wc
    41 on-comcast-internet
    38 taking-the-plunge-safari-4-full-time
    35 secret-jumps-of-tunnel
    35 i-got-four-cores-but-a-distributed-load-aint-on-one
    34 stir-fry-dinner
    33 tasty-comfort-food
    32 fancy-diff
    26 how-to-fix-zend-studio-5-5-zde-in-os-10-6-snow-leopard
    24 ping-traceroute-and-quotes
    22 wordpress-rich-mans-blog-poor-mans-cms
    21 new-news-old-open-source
    20 old-broken-usb-hub-ipod-charger
    19 gmail-contest
    19 alternate-way-to-have-google-analytics-track-pdfs
    17 this-is-what-makes-a-happy-saturday
    17 macchiato
    16 american-born-chinese
    15 rogue-mysql-queries
    15 fixed-gear-slipped-chain-thankful-for-brake
    13 simple-wp
    13 plip-is-no-longer-a-cobblers-child
    11 plix-plixing-better
    11 itunes-imovie-on-lenovos-new-media-center-pc
    10 wonderful-bike-lane-signs
    10 this-is-what-makes-a-happy-sunday
    10 plip-ts-on-your-back
     9 plipgo-01-released
     9 bart-speaks
     8 yet-another-redesign
     7 update-plip-content
     7 plixing-for-pleasure
     7 plip-for-peace
     7 long-be-gone
     7 kodiak-11-released
     7 dot-com-casualty
     7 dont-just-commit-commit-intelligently
     6 verge-works-solves-all-your-woes
     6 simpsons-for-ever
     6 simple-is-better
     6 plip-gets-its-own-dictionary
     5 aids-ride-completed

Fixed theme, WP updated, more WP hacks

0 minutes, 32 seconds

Back when I fixed this blog’s instance of wordpress, I broke the theme. Today I fixed it. W00T! Sadly, this is because I found even more instances of a hacked wordpressery. This was based on the remv.php hacks. I can not stress enough how important it is to keep your software up to date. Go subscribe to the wordpress release feed if you need to. Just stay up to date.

While finding the instances of remv, I took a peek at it. It’s actually pretty neat! If you have LAMP stack handy and are interested, here’s a copy. Enjoy!

Update: Here’s the home page of PHPRemoteView (aka remv.php) translated from russian. Checkout the rockin windows 95 style windows!

Keep those passwords safe

1 minute, 52 seconds

A problem with online security is that there’s no standards for passwords. You may come up with the silly simple single password you use for all site. This works well, until you encounter a site that wants one that is, say, 2 characters longer than the one you use. What then? Or, maybe you’re a bit better and use a scheme where you “encrypt” the domain name into your password. Again, this works fine until a site forces you to break this scheme, and then you’re shit out of luck. The net result is that you either A) have extremely simple passwords or B) forget the passwords often or C) write them down next to your computer.

In case you didn’t think so, options A, B and C suck. Don’t do it. Be smart and be safe.

The way to do this involves some pain in the ass security, which I’ve said before different levels are acceptable. I feel that protecting your passwords are critical, so I’m willing to accept a somewhat higher PITA level. My PITA of choice for passwords is KeePass. Being an open source project (W00T!), some of the execution of the user interface is left to the developer, so you may find some ports are better than others. However, the vanilla OS X and Windows flavors I use at work and home respectively, simply rock. The Android port I use is the icing on the cake. I can download a copy of my password file and have all my passwords on the go.

KeePass, much like TrueCrypt, has really thought about how to store passwords. Here’s a list of some of the great features:

  • generate a secure password based a given site’s rules (8+ letters, 1+ number etc.)
  • hot keys to quickly copy username and password
  • android version puts the username in alert menu so you can easily copy and paste it into a web form
  • encrypt notes for extra info like security question you also won’t remember and wrote down next to your password
  • ported to just about every platform, including iphone and android

The net result of this is that you never forget a password, you use secure passwords and no one can get at your passwords. This is secure and this is how you should do it! For the forward thinking, store your password file on a USB cary with you or, if you’re like me, you’ll put it on your dropbox account, and then you can seamlessly use it on all your computers. Doubly handy!

Update: Firefox does have reset & more

0 minutes, 16 seconds

A bit ago I posted about how Firefox 3.5 doesn’t have an easy way to reset all the cookies and cache files and the like. I stand corrected. Not only does it has this feature, it has an even better ‘clear for the last hour’ or ‘clear for all time’. Handy! I took some screen shots to show ya.

Gmaps Pedometer + Google Calc = 8.94607843 minutes per mile

0 minutes, 41 seconds

I just got a new pair of running shoes and I wanted to take them for a spin. I have no idea how fast I run because I only run with an ID. I don’t have a watch, a GPS or anything else. Well, OK, I do have my first ever pair of running shorts. However, those don’t tell you where you are or what your mile splits are.

You know how to most easily track your route and distance (again, with out a GPS)? Gmaps Pedometer! It’s a google maps mashup that allows you to easily double click your local (or remote) running route.

After I had done this, and I had noted the time I left and returned, I had this math to do: 4.08 miles per 36.5 minutes to minutes per mile. I thought, heck, why don’t I drop it into google and maybe they’re that smart? Sure enough, they are. Thanks Google!

PhotoRec to the rescue!

0 minutes, 45 seconds

Recently the SDHC card for our new camera went bad. All computers and the camera said that the card needed to be formatted and could not be read. Running windows “chkdsk” reported that “The type of the file system is RAW.” After googling around I found a great app called PhotoRec. This is an open source app for all OSes that focuses on recovering images and movies from a hard drive, USB drive or flash memory. It is DOS based, but is extremely easy to use and does not require you to install anything, just extract the zip contents and away you go.

It not only recovered the images that we recently took and wanted to restore, but also found EVERY photo we’d EVER taken. This, when I think about it, isn’t that surprising given how computers delete data, but I like that it worked so well. I gave a donation with in minutes of seeing my photos restored. I encourage you to download and donate today if you’re data is in peril!

photorec

Firefox “reset” is really “launch in safe mode”

1 minute, 6 seconds

I know that it’s not that hard to find out how to do it , but I am still disappointed two fold in how hard it is to reset Firefox 3.5. First, if you look at Safari, it’s super easy to reset it. Secondly, it’s not called ‘resetting’, it’s called ‘safe mode’. Further, your mom doesn’t want to do this on her mac:


/Applications/Firefox.app/Contents/MacOS/firefox-bin -safe-mode

Yeah, I guess for the most part your mom isn’t doing bleeding edge AJAX development that hoses her browser so she needs to do a full factory reset like I was today. But still, make it easier for me?

Sadly, the lil’ ol’ plip blog probably isn’t popular enough to give ‘reset ff3.5’ a higher ranking in google to turn up ‘use safe mode, silly!’

For those who read our Safari full time post of yore, you ask, “what’s the verdict?” The verdict is I use both. I would say that on a Mac, Safari is hands down an insanely fast browser. Faster that FF3 or FF3.5. However, firebug is the absolute no contest, pack it up and go home winner of JS debugging, DOM tweaking, ad hoc CSS styling, OMG there’s-another-feature-I-didn’t-know-about web developers god send life raft. Indeed. So, I use both. Yes, it does help to have a silly amount of screen real estate:

Update: Firefox 3 had the feature want, I just remembered!

Update 2: I’m wrong. Firefox 3.5 does have it.

On theft, privacy and data loss

4 minutes, 58 seconds

I’ve recently taken a serious look at the reality of theft of computers as well as ensuring privacy and reducing data loss should such a theft occur. Take a moment and and take inventory of where you store you data and how accessible and backed up it is. What would happen if:

    • You dropped your cell phone in the toilet? (data loss)
    • Your cell phone got stolen? (data loss & theft)
    • What about that ‘it will never be stolen’ desktop computer at home? What if some one stole that? Do you have a password on login, do you have your email password saved and your browser remember all your passwords? Do you file your taxes online and store copies? Do have resume with references, previous address and social security number? (Data loss, theft, and loss of privacy)

With the sheer number of accounts we create at every new site we register with, we’ve become lazy and no longer want to remember passwords. Most folks either check ‘remember password’ in their browser of choice, use the same password for every site, write down the password or all three. Further, most folks don’t password protect their smart phones. Compliment with all personal data stored on a laptop or a desktop, this creates a recipe for catastrophic data loss, serious violation of privacy potentially leading to identity theft.

In this post, I’m going to outline a number of suggestions to help fight data loss and identity theft while protecting your privacy. I’ll give each suggestion a PITA rating of how hard and how long it will take to implement. A PITA of 1 is easy a PITA of 10 is, well a real PITA!

Master Passwords

PITA: 1
If there’s one thing you actually do, do this one. I use both Thunderbird and Firefox. As I said, most folks are lazy and want all their passwords stored and remembered for them as needed. This is all fine and dandy until your laptop walks an the thief can use all your accounts with out ever touching the keyboard. Both Firefox and Thunderbird offer the ability to set a master password. Every time you open your browser or mail client and a password is needed, you will be prompted for a your master password once. Then all other passwords will be filled in for as normal. Note: close your browser and mail client often ; )

OS Level Passwords

PITA: 1
A no brainer. Both Windows and OS X (video) have it.

Set a phone password

PITA: 9, then less
When I first set a password on my phone it was a real pain in the ass. I had to enter it every time I wanted to make a call or check my email. I have a Palm OS phone (not a Web OS phone), so it’s not that sophisticated. I know that Android based phones have a quick pattern you can trace which is quite easy. The iphone has a number pad you can use. Any which way, over time, this becomes second nature, so the PITA rating will fade from 9 to a lower number.

Remote Backup

PITA: 7
I’ll explain my backup technique in a sec, but take this one seriously. If your house were to burn down while you were out of town, how much data would you loose? I hate to be all doom and gloom here, but most folks don’t shoot analog any more, so all photos are digital. Maybe you upload to flickr or the like, but there’s nothing like have all your photos organized just so. I strongly suggest you look at commercial providers for this.

Our household has both local and off site backup. We start by backing up all devices (two laptops and a desktop) to our local qnap server via robocopy (think rsync for windows). The qnap is just linux, so it runs all sorts of great things like rsync and secure copy (scp). A friend has a qnap as well. We first connected an external drive to our own qnaps and made a backup of all our backups. We then swapped external drives and connected them to our respective qnaps. We now have a remote backup that we can rsync our data to over ssh and the initial gigs of data are already there.

Remote, Secure Backup

PITA: 10
I have a subset of my data that is hundreds of PDFs. I generate them via my trusty and some what spendy sheet feed scanner. This guy creates searchable PDFs that have the OCR text embedded in them. Genius. In comes a bill, tax return or sensitive document, out comes a PDF and some shredded paper to recycle. Cross cut, of course.

This data set is a treasure trove. Should my desktop with hundreds of megs of PDFs walk out my front door one sunny afternoon in a thief’s hands I’d be up you know what creek with out a paddle. Data loss aside, it would be little effort to apply for a credit card after a little address change. Bad times indeed.

Enter Drop Box. This is an excellent free service (for the first 2 gigs) that allows you to do what I would call very rich man’s rsync. Store all your PDFs in this folder, and now they’re not only backed up, but remotely accessible!

Wait – what about the stolen desktop? The default behavior of Drop Box is to remember your password. Should someone take your computer and gain access to it, the PDFs on Drop Box are good as local on the drive.

Now enter the second layer: TrueCrypt. TrueCrypt is the no-joke way to store data securely. They support both an encrypted boot drive as well as the spook spy stuff: plausible deniability. Ignoring the more advanced features, TrueCrypt’s quick start guide will walk you through creating an encrypted volume that’s encapsulated in a single file. This file can be any size, thus the drive can be any size. You could then store you hundreds of PDFs in a TrueCrypt volume in a file on Drop Box. True secure offsite backup.

I’ve even gone so far as to create a small TrueCrypt volume that has all my passwords. It’s the keys to the kingdom, but I’m going to be vigilant about protecting this file and only the one closest to my heart knows how to get in there.

Caveat emptor

I’m not a security expert, take my advice with a big grain of salt. There are ways of hacking the master password for firefox and thunderbird. OS Level passwords are trivial to bypass for a skilled IT professional or evil intentioned googlist. Even TrueCrypt can be accessed via social engineering or a sloppy operator who writes down their password.

Good luck and happy securing!

Two loves: CSS & Recaptcha

0 minutes, 56 seconds

I just spent some time trying to outrun my cobbler’s child-dom by using mod_rewrite to make the old URLs for contact, about and projects pages to drop the oh so late 90’s “.phtml” suffix. They turned out pretty great I think! mod_rewrite is worthy of a whole separate post, I’d say.

http://plip.com/contact

Along they way, I remembered that my contact page, simple as it is, was actually a target for spammers a couple times a week. Do they think I just fell off the radish truck? Silly geese. The solution of course is to use a captcha. There’s a number of them out there, but a while ago I stopped rolling my own and started using Recaptcha. Aside from being super easy to install and deploy, you’re helping their worthy cause. Sweet.

Now that you have your captcha stopping those geese from spamming you, you need to make it look like your site. Hours of hacking? Nope! Minutes of CSS stylings. Recaptcha is highly structured DOM with easy to reach classes for CSS. In just a few minutes I turned the the vanilla captcha into the the, well, even more vanilla plip captcha. OK, yes, I’m a geek who loves CSS. That’s me.