How to remove the last n lines from a directory full of csv files.

March 24th, 2009

First, install Cygwin.
Next, add the cygwin\bin directory to your path (control panel\system ->advanced settings -> environment variables
Create a script to invoke the head command and iterate over the files and put the script in the \cygwin\bin directory.
Call it truncate.sh.
Add the shebang to the file (#!c:/cygwin/bin/bash) at the top
Make it executable by running chmod a+x c:\cygwin\bin\truncate.sh (might not be necessary?)
Open a command window in the directory containing your files to be truncated.
Set the starting and ending variables to the right numbers.
Set the number after -n to the last row you want in your data files.
Save truncate.sh
Run dos2unix c:\cygwin\bin\truncate.sh
Type bash c:\cygwin\bin\truncate.sh
Your files will now be truncated and named. [filename].bak You can use a file renaming utility such as Batch File Renamer to rename all the files to .csv

Improvements that could be made:
Counting the number of files and determining the right starting and ending filename.
Taking user input for the row to truncate after.
Writing the files as the right extension, but in a \truncated directory.

Baywords.com is a blog hosting service run by The Pirate Bay

April 17th, 2008

PirateThe Pirate Bay, those naughty Swedes that continually thumb their noses at the recording industry, have set up a blog hosting service. For little effort, and no money, you can have your very own *.baywords.com blog. When I checked a few minutes ago, there were 6 such blogs, a second later there were 7. Watch the search “site:baywords.com” to find more as they show up. Most seemed like normal moronic blogs, but there was one containing the links to the booty that The Pirate Bay so often plunders and distributes, Robin Hood fashion, and there was another with links to traditional hacking information.

I’m glad there’s another option for those people who have things to say that wouldn’t be allowed on US soil. The major class I’m thinking of are those people who face legal threats from corporations like Monster Cables, known for their bullying of critics.

via The Register

UPDATE 4/18/2008: Google now shows “about 141″ sites on baywords.com.

I Am Mr. Gunn

March 31st, 2008

I dominate the whole first page of Google results for the query, “mr gunn“. Things can always change, but for now, I’ve effectively claimed Mr. Gunn as my identity. I’m not doing nearly as well on “William Gunn“, but I haven’t working on that as much, and there’s considerably more competition there.

Concast to stop throttling Bittorrent

March 28th, 2008

After years of claiming that they weren’t, then admitting they were but claiming it was the only way to make things fair for everyone, they’re finally getting around to ceasing the practice of throttling bittorrent. Now we’ve just got to wait a couple years more for them to do something about that “unlimited downloads” situation.

I signed up for the Ovi Ambassador program.

March 20th, 2008

The main thing it needs is to pull in your existing content/activity, a la profilactic.

Google becomes safe haven for splogs.

March 13th, 2008

Just try and submit a splog to google’s abuse team. They don’t quite laugh in your face, but they clearly can’t be bothered, even though it’s blatant manipulation of PageRank.

Poking my head into the echo chamber again…

March 13th, 2008

I’m still hearing the iphone talked about like it’s a developers dream, by the same people who talk about it like it’s some revolutionary device, when it’s really just a feature-poor lackluster piece of hardware using yesterday’s technology and today’s billion-dollar marketing budget.

Have you guys heard about this little mobile device OS called Symbian? You know, the one that doesn’t require its apps to be blessed by the device manufacturer and whose apps can be distributed for free, and using whatever distribution channel the developers like? The one which has already had tons of commercially successful applications?

You know, sometimes I just can’t shovel fast enough.

Slick is a good IM app for Symbian S60v3 devices

January 30th, 2008

It’s free and runs great on my N75, uses little data and is only 721K. It supports ICQ, Jabber, AIM, MSN, Yahoo and GTalk. I can confirm that the ICQ, Jabber, and GTalk protocols work. The ICQ protocol is difficult to test yourself, because it only lets you be logged in one place, so you can’t send a message from your desktop client to your phone, but it retrieved my contacts fine and showed who was online properly, so I assume that works too. Another nice thing about it is that it uses a small font, so the threaded message view is actually useful.

Slick is simple, fast, and functional. Eqo take note.

If you’d like VOIP functionality also, you can try Gizmo5, but I haven’t used it and the other two I tried, Eqo and Fring, were failures. Fring might be fine if all you’re doing is VOIP and using Slick for IM, but will probably run your battery down even faster.

The Eqo IM/VOIP client looks promising

January 29th, 2008

Unfortunately, not only can I not get any of my IM accounts to work, but I can’t even log in to their support forum to tell them about it. The whole point of this post is to leave a trackback to their blog, because Chris, the “Tech Evangelist” seems pretty responsive and there’s no other way to contact them.

He also shares my frustration with embedded video/podcasts, too. We need transcripts!

Chris, if you’re reading this, contact me here because I can’t reach anyone there.

As I expected, logging a support incident(I can log in there, just not the forum) was utterly useless. The first response said, “You’re using a beta, so there will be issues.”, missing the point of the site not working entirely, and the second response requested that I change my password to all lowercase, which I had already done based on the sticky thread in the forum mentioning this requirement.

This is the same thing that turned me off of cocomment. They have these droids working the support forum, who seem unable to do anything but make pointless and redundant suggestions to do things you’ve already tried.

Qik is pretty freaking awesome: A review

January 24th, 2008

I signed up for the alpha test at Qik.com, and received my download invitation today. Here’s the deal with Qik, and it’s very simple: Your phone streams video, live, to your Qik account.

I was a little skeptical about how well this would work, but it worked flawlessly. I just started the app, my phone established a 3G connection, and I pressed “Stream”. When I finished recording my short test video, I logged in to my profile, and there it was. The site feels very much like Flickr, with tagging and sharing and commenting and so on. Videos are public and include audio by default, but you can turn the microphone off and set videos to private from the phone. They’re working on an interface to title and tag from the phone, but that part’s not ready yet. I also had some site error editing my profile, but overall, I feel pretty comfortable declaring this a “killer app” simply because it makes it so simple and easy to share video, live.

One feature I’d really like to see phone details captured, similar to the way camera info is embedded in pictures, so you can browse by phone type, like on Flickr. I’d also like some invites, so I could bring in some of my friends who I think would love this, particularly those that already have a Flickr account. I’d also like integration with Plaxo, or Open Social in general. They already integrate with Twitter.

Of course, you’ll want a phone that takes decent video, but more than that, you’ll want a phone capable of high speed data and you’ll definitely want an unlimited data plan. I used my Nokia N75 to record the demonstration video, using the Symbian version of the software, and they pretty much only support Symbian phones right now, but, hey, you should get one because they’re the best phones on the market now anyways.

There’s more from this big guy, who’s apparently been quite excitedly using it.