Twittipy: A pynotify and pycurl experiment

June 27th, 2008

It’s been a drag since Twitter IM went down. I had a very brief “play” time the other night that gave birth to Twittipy. It’s a Twitter notifier written in python with pynotify and pycurl.

Running Twittipy

  1. Create a configuration file in your home directory (~/.twittipy)
  2. Set your Twitter username/email and password in the configuration file.
    Example:
    [general]
    username = johnsmith
    password = unhackable
  3. Make Twittipy executable
    $ chmod u+x twittipy.py
  4. Fire it up!
    $ ./twittipy.py &

Twittipy requires Python 2.5, pycurl and pynotify. If it complains of missing modules, you probably didn’t meet the requirements.

Roadmap

I did some googling and found other stuff to try that could improve Twittipy.

  • Port for other platforms (Windows with pywin32 and KDE via wxPython)
  • Icon at the notification area or system tray (via wxPython)
  • Encrypt or obfuscate password in config file and/or if password is not found in the config file, prompt and store in memory.
  • Make use of the other methods of the Twitter API.

Download it here. There are two more options in the config file, update_interval and last_update. The former defaults to 4 minutes and the latter to the current time.

I’m quite satisfied with it. The notifications of pynotify are less obtrusive than an IM message. There’s one noticeable quirk where a tweet repeats. We’ll fix that for the next release.

Comments are welcome and please check out tweetyPy as well (not mine but also an academic project).

Finch

June 11th, 2008

Pidgin kept crashing when I tried tunneling through a remote machine. After minutes of googling around, I found Finch, a command-line version of Pidgin! It used to be called Gaim-text. Really cool!

Finch

I need a new hard drive for…

May 25th, 2008

On a side note, any comments on the “modern” Winamp version? I’m thinking of using its library features. Since my media “server” back at home was decommissioned, I’ve been having problems with my muzak itches.

Another side note, is there a portable music player out there that has a ≥60GB flash drive? I might’ve dropped my iPod too many times. A fancy UI is the least of my concerns.

I think about queues all the time.

April 24th, 2008

Here’s something to waste your time and bore your brains out.

There are three nodes, say Nodes A, B and C. Node A and C are application servers. Node B is a messenger for nodes A and C. Although Node B is not needed but for reasons I’m not allowed to discuss and would rather not discuss, it has to be there and is the root cause why we have a problem.

Let’s start with an example series of events. A new transaction begins from Node C which sends data to Node B. Node B stores the data in a queue. Node A fetches x items from the queue every y seconds.

After Node A processes the transaction, it begins a new transaction. Node A sends data to Node B only this time, it is no longer stored in a queue. Node B immediately forwards the data to Node C.

On some occasions, Node C starts a new transaction as an acknowledgment from the data that originated from Node A. This transaction is treated as a transaction similar to the first one only that Node A knows that it’s an acknowledgment.

Originally, Node A and Node C communicated to each other directly. The queue didn’t exist. The queue came in to fix a couple of problems but it introduced new ones. Recently, the script in Node A that polls data from Node B died and now it’s catching up with backlog. The script processed data one by one. This showed how slow the main application in Node A is.

I already have a solution in mind and I enjoy writing boring stuff but I’d like to hear other views.

The Few Good Stuff on Television

April 20th, 2008

For me, there are three elements for a good television show: geeks, a hot chick and sarcasm. Lahaina told me to check out The Big Bang Theory and I got hooked the minute I saw the first episode.

The show is set with two physicists and a hot chick who just moved in across their apartment. Given the poor socializing skills of most some geeks (you can count me in), you’d probably get the drift of the series.

Here’s a keeper to spoil you.

I like the chemistry shirts that Leonard wears on most episodes. This show is da sex! I can relate to it a lot. So much that I usually see myself in Leonard and Sheldon.

Reduce Attacks on Apache+PHP

April 20th, 2008

A couple of days ago I thought that one of my servers got compromised. I thought someone cracked my password by brute force and kept shutting down Apache at 4AM. As it turned out, I made a mistake with the log rotation configuration that the post-rotation restart fails to start Apache.

I immediately installed DenyHosts, disabled keyboard-interactive login and hardened the firewall. It made me feel more insecure which resulted into today’s post.

With a fresh install of FreeBSD 7 on another server yesterday, I wanted to make sure that I do it properly from the start this time.

Apache adds the Server header that reveals the OS, version and some modules. PHP also adds an X-Powered-By header that shows the version of PHP. With those information publicly available, someone can write a script that could exploit vulnerabilities on specific versions of Apache and/or PHP.

For Apache, you can use mod_security. It’s available as a port and at Karanbir Singh’s yum repository for CentOS users. See the directive below.

<IfModule security_module>
  SecServerSignature "Apache"
</IfModule>

Also, just to be a happy camper, I used a new configuration file to be included. Consult your configuration for the path. On CentOS, the default configuration directory is at /etc/httpd/conf.d. On FreeBSD, it’s at /usr/local/etc/apache[n]/Includes, where n may be your Apache version.

For PHP, simply set expose_php to off in your php.ini

Disclaimer: This works for me but I’m not sure if this is the best way to do it. I tried mod_headers first but it didn’t work.

Notebook Memory

April 4th, 2008

If your laptap starts to crawl if you have too much programs running at the same time, you can try adding IGB of RAM from PC Express.

Free Image Hosting at www.ImageShack.us

[found by D. Billano]

Insert to Asterisk’s Queue Log When a Member Is Called

April 4th, 2008

Asterisk’s queue_log can come in handy in many cases (queues in Asterisk can be called ACD). There are systems that go as far as depending solely on the queue_log to operate (including mine).

Every now and then requests requirements for a feature to tell if a call in the queue is being transferred to a queue member (an agent) comes up. I had a workaround that used an AGI script but it didn’t work all the time. I’ve been digging around the source code so that it’s inserted into queue_log instead. After three attempts of hacking one friggin’ line of C code, I finally did it. My sincerest apologies to my COMPRO1 and COMPRO2 professors.

You may get the patch for asterisk-1.4.19 over here.

P.S. I know that watching the queue_log isn’t much of a good idea. I only stole the concept and I wasn’t aware of AMI at that time. Migration plans are on the way.

“Viral” Linking

March 31st, 2008

I’m supposed to copy and paste the stuff below.

I have randomly selected 5 of you below to be tagged and I hope that you will similarly publish this post in your blog. You have to tag 5 other bloggers and just keep adding on to the list. (Do not replace, just keep on adding! Yes let’s hope a long list!) It’s real easy! Tag others and see your Technorati Authority increase exponentially!

The benefits of Viral Linking:

  1. One of the fastest ways to see your Technorati Authority explode!
  2. Increase your Google PageRank fast
  3. Attract large volume of new traffic to your site
  4. Build your community
  5. Make new friends!

And these are the people who already took part on this tag:
Blognation, Pinoytek, Reyna, Bluep, Kotsengkuba, Buraot, Iris, Banco De Reyna, Manilenya, Mitch, Melai, Malen, Beng, Sasha, Foolsville, Lloyd Lopez, Vance, JP Loh

The unlucky five are (I didn’t check my Technocrappy page): Dwek, Wildquaker, Sir Joel, Mark Q. and Edwin Kamote (currently unavailable =p).

Just riding along. My blog has attracted all sorts of spambots that exploit WordPress vulnerabilities that I do not want more popularity (if any). Besides, I’m on an all-time low with about two posts per month.

Maybe the higher Technocrappy authority will get me laid.

Celebrities

March 18th, 2008

I’m trying to negate fugliness with popularity. The following are the results of my tests (for your Photoshopping pleasure).

With Jun Lozada

If you want to know my opinion (and others’) about Lozada, you can follow the thread started by Ms. D.

With Jun Lozada (1/2)

With Jun Lozada (2/2)

Embassy

I got invited to this party organized by Flash Manila last Friday. Photos courtesy of Jordana.

Moi and Keana Reeves

Moi and Raven Something

Yes, my blog is dead. I kinda lost the will to blog or something comes up when I want to write something. You can follow me at Tumblr for the meantime.