Twitmon update: read and post to Twitter on the command line

I've posted a new version of Twitmon, my Python command-line Twitter client.  The new version includes a fix to work with the latest version of Twyt, but more importantly, it can now be used to post status updates to Twitter as well!

Download: twitmon, and don't forget to set your username and password in the script!

Twitmon will fetch new Twitter updates from your followees every couple of minutes, just as before.  But now you can update your status as well, just by typing the new status and hitting enter.

You can also edit the update as you're typing it, and use the arrow keys to navigate back and forth through updates you've previously typed.

Occasionally, the Twitter posts will be refreshed while you're typing, and mess up the display.  You can use the arrow keys to go back, then forward, to clean things up.  It's ugly when this happens, but it still works.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Furl
  • Reddit
  • Slashdot
  • Technorati
  • SphereIt
  • Spurl
  • Fark


Tags: , ,
Comments (2)

Twitmon: command-line Twitter reader

I've been feeling dissatisfied while trying to read the Twitter statuses of people I'm following. What I usually want to do is read everything that has come in since the last time I posted something. Unfortunately, this is hard to do on Twitter's website. I have to go back through the pages, one by one, to find my last tweet, then start reading upwards and backwards until I get to the beginning again. It's a lot of work and the page load times could be better, so it leaves a lot to be decided.

Twitmon screenshotI decided to use the Twitter API to write a command-line client that would check Twitter every so often and spit out new updates. Turns out I didn't need to do much work: Twyt is an existing Python implementation of the API. I was going to write it in Python anyway, so I downloaded Twyt (on Ubuntu: sudo apt-get install python-twyt) and started poking around.

It wasn't immediately clear how to get started, but I read through Twyt's files until I figured out how to authenticate, fetch status data, and turn it into usable objects. I added some extra stuff to print out color text and to periodically check Twitter, and I've got something I can really use. The code is here: twitmon.

I haven't tested it on Windows; it should work in general, but the text colors may not. The colors can be turned off in the script. Normally, it will use the colors to highlight links and usernames. It will also highlight the current user's username separately from other names; I like this because I can quickly tell if anyone mentions me, and I can find my last tweet quickly.

Update: I've fixed the script to work with Twyt 0.7 (which is the version in Ubuntu 8.04) and 0.8 (which is currently the latest version). You can also now send updates to Twitter with it - just type them and hit enter, and they'll show up on the next refresh.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Furl
  • Reddit
  • Slashdot
  • Technorati
  • SphereIt
  • Spurl
  • Fark


Tags: , , , ,
Comments (4)

Roll your own remote RickRoll

Last week I posted about a program I wrote to RickRoll someone at will by controlling their computer over the network. Basically, you tell their computer to play "Never Gonna Give You Up" whenever you want. I call it Remote RickRoll, and I'm making it available to download today, including prebuilt binaries and source code.

Remote RickRoll UI

In the victim's list of Windows services:

Remote RickRoll service

In the victim's application log:

Remote RickRoll in the application log

The README file contains complete instructions for preparing your victim's computer without physical access to it.

Remote RickRoll runs as a Windows service, so you will need administrative rights on the victim's machine to make it work. The victim's machine needs to be running Windows and have the .NET Framework 2.0 installed (although that can also be installed remotely without their knowledge). You'll find that Sysinternals PsExec comes in handy.

The source code is C# and it's a Visual Studio 2005 solution. But the zip file includes binaries, so you don't need to compile anything to use it. It's GPL, so if you want to modify it, knock yourself out.

I've used this on two people so far, to great effect. That said, messing with people's computers without their knowledge can turn ugly, so be smart.

I'd like to hear about your questions/comments/success stories/failures/modifications, so please comment below if you're inclined.

Thanks and enjoy!

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Furl
  • Reddit
  • Slashdot
  • Technorati
  • SphereIt
  • Spurl
  • Fark


Tags: , , , , ,
Comments (2)

Greasemonkey script: Pitchfork links

Last.fm links on Pitchfork I read a lot of record reviews over at Pitchfork, and when something sounds good, I usually jump over to Last.fm to listen to it, or to remind myself to check it out again later. For a long time, I've been meaning to write up a Greasemonkey script for Firefox to generate the Last.fm link for me, so I don't have to type it in every time. You know, because that's so hard.

Anyway, I'm working on an, ahem, not tremendously exciting project at work, so I finally got around to it. I went ahead and made it extensible for other links besides Last.fm, so it can do links to iLike and Wikipedia, too; others are easy to add if you're reasonably familiar with Javascript. The script adds the links right next to the album artwork, right below the links to Emusic, digg, del.icio.us, and so on.

I posted it on userscripts.org. I currently have a hundred or so back reviews to read, so hopefully I'll have saved net keystrokes by the time I catch up.

Update: added links to IsoHunt, Mininova, and the Pirate Bay, by request.  I can't test right now because I'm on Firefox 3 RC2 and Greasemonkey doesn't work there yet.  But you can get the new version right here for now.  I will update it on userscripts.org as soon as I get it tested.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Furl
  • Reddit
  • Slashdot
  • Technorati
  • SphereIt
  • Spurl
  • Fark


Tags: , , , , , , , , , , ,
Comments (2)

Acquisitions

I just think it's really interesting that Oracle is buying BEA and Sun is buying MySQL, and that both acquisitions were announced on the same day.  That is all.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Furl
  • Reddit
  • Slashdot
  • Technorati
  • SphereIt
  • Spurl
  • Fark


Tags: , , ,
Comments

Upgraded my router with dd-wrt

This weekend I finally did something I've been meaning to do for a while - I installed the dd-wrt firmware on my Linksys WRT54G wireless router. dd-wrt is based on the original firmware from Linksys, but it adds a ton of new features.

Since installing it three days ago, I've done various things that I couldn't have done before:

  • Static DHCP leases for my machines, so they always get the same IP address. This also makes the router act as a DNS server for free.
  • SSH access to the router
  • WPA2 wireless security
  • Increased the transmission power of the router's wireless signal
  • Set up NTP to keep the router's time current
  • Set up IPv6 on my home network using 6to4. The router will automatically assign IPv6 addresses to all clients.
  • Mounted a Samba share on the router

I love doing this kind of thing. dd-wrt is a fantastic piece of work, and has increased the value of my router a great deal.

The most satisfying bit was the IPv6 setup.  I find it kind of nifty that simply having a single IPv4 address entitles me to several quintillion contiguous IPv6 addresses. You know, just in case.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Furl
  • Reddit
  • Slashdot
  • Technorati
  • SphereIt
  • Spurl
  • Fark


Tags: , , , , , , , , , , , , ,
Comments

Restoring obelix's boot drive

Since the boot drive on my home server, obelix, died, I've been trying to get at its data.  The large part of the important data had been on a separate drive, mounted as /home, so there was nothing of critical importance, but I still wanted to recover some of the config files and such that I'd spent years setting up.

I knew that it wouldn't be easy - the first sign of trouble with the server, after all, was when it hung during boot with the message "Remounting root partition read/write."  Sure enough, when I pulled out the drive and put it in another machine, it couldn't be mounted, not even read-only.

First thing I did was to run fsck on the malfunctioning reiserfs partition. After a while, it exited, telling me that the drive had bad blocks. Great.

So I ran badblocks and got a list of five block numbers, and then fsck.reiserfs –fix-fixable, passing it the list of bad blocks, to see if it could work around them. It choked on one, telling me I'd have to run fsck.reiserfs –rebuild-tree on the partition. When I did, it died at the same point - I wouldn't be able to repair the filesystem while it was still on the malfunctioning drive. I'd need to dump it out to a file on a good drive. Unfortunately, I didn't have anything handy that could hold the entire partition, so I took the bad drive to work with me.

Once there, I hooked the drive back up and dumped it to a file on a network share (thanks for the space, John). As fsck.reiserfs recommended, I used dd_rescue, which can nicely handle bad blocks by zeroing them out on the destination. It completed successfully, finding several bad blocks and dealing with them gracefully. Then I ran fsck.reiserfs –rebuild-tree on the dumped file. It also completed successfully this time, so I held my breath and mounted the dumped file with mount -t reiserfs -o ro,loop, and, thankfully, it worked. I'm now copying everything I need onto a good drive.

Even though it wasn't that important, I'm glad it worked out. I've never had to recover a bad drive before, so now that I've had the chance, I'll know more about what to do when the time comes again.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Furl
  • Reddit
  • Slashdot
  • Technorati
  • SphereIt
  • Spurl
  • Fark


Tags: , , , ,
Comments

Farewell, obelix

In the evening on Monday, December 31, my venerable home Linux server, obelix, went down for the last time.  His boot drive developed a bad block and could no longer be mounted.  Efforts are still underway to recover the data from the drive, but on Tuesday, I made the decision to decommission obelix for good.

obelix was a Dell Dimension L667R with a Pentium III and 384 megabytes of RAM.  I've had him for about seven years.  I bought him (refurbished!) on a whim, somewhere in the distant past.  He was extremely versatile; he acted as web, file, and database server, as well as providing services to our network as a Samba domain controller and an LDAP, DHCP, and DNS server.  In his early years, he was also my primary workstation, running countless window managers, desktop applications, and games over the years.  Due to his having a FireWire card installed, I used him to capture DV from my video camera to edit on another machine.  He spent most of his lifetime as a Gentoo Linux box, no doubt logging thousands of hours of software compilation.

Until recently, he served my websites over my home connection, although since I recently began hosting with Dreamhost, he no longer performed this function.  This was a major factor in my decision not to stand him back up after the disk failure.  Although he had still been providing network, file, and database services, I knew that I would no longer need a dedicated server at home once the websites had been moved to external hosting.  So I moved his large data disk to another computer and dismantled the Samba domain, which was more or less unnecessary to begin with.  His primary function as a database server was to host my Amarok music collection database, which was easily rebuilt after he went down.

I will miss having obelix around, though; I named him after my favorite Asterix character, I've had him longer than I've known my own children, and I knew him backwards and forwards.  Tinkering with Gentoo, Apache, MySQL, OpenLDAP, and Samba on obelix was how I began to truly solidify my knowledge of Linux system administration; using obelix absolutely helped get me where I am today.

It's somehow fitting that he should go out on the last day of 2007; it's been quite a year.  There's been a lot of anxiety, some deaths, a birth, some sickness, some health, some successes, some failures, a new job, many highs, many lows.  It hasn't been the easiest year to live through in a lot of ways.  In no way is the loss of obelix anywhere near a significant event in the face of what's happened this year, but it does sort of reinforce the feelings I have about 2008 - cautiously hoping for a clean slate.  The new year always brings new things and does away with some of the old.  Whether that's for good or ill, we'll just have to wait and see.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Furl
  • Reddit
  • Slashdot
  • Technorati
  • SphereIt
  • Spurl
  • Fark


Tags: , , , , ,
Comments

Im in ur printrz

When I read about INSERT COIN, the Perl script that changes the ready messages on HP network printers, I was overjoyed. It seems to be a perfect way to wreak mild havoc without really harming anything. I showed it to my buddy John this morning; it's right up his alley, too (for an idea of what John's alley is like, check this out).

Of course, he's a Windows guy (although not a Windows 95 guy). And INSERT COIN is a Perl script, and he doesn't have ActivePerl installed, because when you have cmd, you have everything you need!

So I decided to get him a standalone version of INSERT COIN that will run on his box. I decided to try to port the thing to D. Mainly because I have a short attention span, and I recently read an article about D.

I'm a scripting guy, only recently having delved into statically-typed-but-still-use-a-runtime languages like Java and C#, and hardly at all into lower levels of programming. C and C++ scare me a bit, frankly, but D seems a little more accessible. And by accessible, I mean that it seems like it would be harder to make a total ass of yourself as a newbie. Image is everything.

So I ported INSERT COIN to D. And I have to say it was a very enjoyable experience. Here's the source and the Windows binary (compiled with MinGW). Now John can happily tweak the printers anytime he likes.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Furl
  • Reddit
  • Slashdot
  • Technorati
  • SphereIt
  • Spurl
  • Fark


Tags: , , , , ,
Comments

Living the dream

Today I registered a new domain - mogrify.org - and began the process of migrating my websites to my new host, Dreamhost. The now-venerable mogrify.homelinux.org, as you may have noticed, redirects to the shiny new code.mogrify.org. I'll be moving other things across in the coming days and fixing problems whenever I notice them.

I've been wanting to host offsite for some time, since I'm currently running three separate sites on a single, beige Pentium III Dell box in my study. This is not exactly the most robust of setups, and there have been issues with power and network outages.

I expect to love Dreamhost for the same reason I love hosting at home - because I genuinely enjoy administering Linux systems, and Dreamhost gives you a lot of control - shell access, .htaccess files, log files, email accounts, etc., as well as a whole ton of other options.

So, the dream is becoming a reality.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Furl
  • Reddit
  • Slashdot
  • Technorati
  • SphereIt
  • Spurl
  • Fark


Tags: , , , ,
Comments (1)

Bad Behavior has blocked 126 access attempts in the last 7 days.