Wednesday, April 22, 2009

Creating HTML Signatures in Gmail with Google Chrome

In the last couple of months I've been a heavy user of Google Chrome. I got really addicted to its amazing speed, comparing to IE and Firefox.

Yes, Google Chrome is still under development - there's no fancy interface to extensions yet, Greasemonkey needs a command line switch to be activated and so on. But the speed just makes it worth.

Anyhow, in my Firefox days I used the Black Canvas extension to add HTML signatures to my outgoing Gmail messages. Nothing too fancy -- just a grey text and a link to my blog.
Google Chrome, however, doesn't support such extensions, so I searched for an alternative and found this tool.

This little application creates an inline Javascript that should be dragged to your bookmarks bar, and with a click of a mouse it adds the signature you created into the message. Sounds good, nay?

Well, besides that this generated scripts downloads an external script (http://code.jquery.com/jquery-latest.pack.js) which only god knows what's there, another problem popped up.

When I first used this tool I clicked on the link and nothing happend. No Javascript errors. Nothing. Then I remembered that I'm using the Gmail's lab tasks feature. Closing that window made the script work.

Why not create a smaller, working version, I thought. And I did. There it goes:
javascript:void ((function(){document.getElementById("canvas_frame").contentDocument.getElementsByTagName("iframe")[0].contentDocument.body.innerHTML += "your HTML signature";})())

Where your HTML signature can be a hand-made HTML/CSS code or an auto generated by a WYSIWYG editor like in the tool's page.

So all you need to do is create a new bookmark to this Javascript, and click on it whenever you'd like to add your signature to the mail you're currently sending.

Yeah, it's a hack, so use it on your own risk, blah blah blah.

Saturday, November 8, 2008

The End of Annoying OTP's

If you're a student in CS at the Hebrew University of Jerusalem, you're familiar with OTP's (one time password) used to connect to the university servers from remote, submitting exercises, receiving grades and so on.

There are currently two ways to generate OTP's:
  • If you have a java-enabled phone (Nokia only) you can download an application called HOTP which will allow you to generate an OTP with each button click.
  • If you don't have a Nokia phone (like I do) you have to enter a website, fill your unix username and password and answer a CAPTCHA. Then SMS is sent to your cellphone, including 5 OTP's.
Needless to say, the latter option is really annoying, especially when you need to use the OTP 4-5 times in a row while submitting an exercise (connect to an FTP server, use SSH, enter the submission system and so on).

So I decided to create my own OTP client which will be able to generate OTP's locally. The main target was to create a program that will copy the next OTP to the clipboard, which will allow easy transportation of the 5-digit password.

I simulated a download of the HOTP program, and decompiled it (Jad rules). The code was scrambled, but I figured out by using the koders search engine that Java's bouncycastle package is used there. This package gives a lot of encryption services, and here they use the Rijndael (original AES) and the HMAC SHA-1 encryption in order to generate the OTP.

I won't go into further details. If you're really interested in how it works, you can go over the script's source - it's not that complicated.

Some installation details:
  • Very important note: if you're currently using the HOTP application, installing this script (requesting a new HOTP application download) will make your cellphone HOTP application broken. This is caused because the key counter is randomally selected each time an application is generated for download.
    If anyone of you sees this as an important issue, leave me a reply here or send me an email.
  • You'll need ActiveState Python (version 2.4 and up).
  • If you're using other operating system than Windows, you can still use the script, but the clipboard option will not work (only printing to stdout).
  • After installing python and downloading the script, run it without parameters and installation will begin.
  • For further options, use the --help or -h switch.
You can download NOTP from here.

Have a great semester :)

Monday, September 22, 2008

Job Proposals Everywhere

While working I was checking some HTTP headers of random sites, and I stumbled upon these headers:

Server: nginx
Date: Mon, 22 Sep 2008 11:17:12 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: close
Vary: Cookie
X-hacker: If you're reading this, you should visit automattic.com/jobs and apply to join the fun, mention this header.
X-Pingback: http://developerinsight.wordpress.com/xmlrpc.php
Content-Encoding: gzip
Vary: Accept-Encoding

So who wants a job? :)

Thursday, August 7, 2008

New Facebook Worm?

I got this mail from Facebook today, notifying about a new private message:


*** sent you a message.

Subject: Hi my friend.


"This is you on hidden cam. lol:

http://myvideo.d9.pl/"


The site is currently giving a page in polish, but no malware or exploit whatsoever. It probably went down.

The message did not appear in my Facebook's private messages list nor in the notifications, which means that Facebook somehow deleted it from their database.

Beware.

Wednesday, July 2, 2008

Job Market

There was one, today at the university.

And I stumbled upon this advertisement:


And then I began to ponder... :)

Tuesday, July 1, 2008

Ynet are Ignorants

Quoted from this URL:

What the hell is colliding there?

Credit goes to Segal.

"Being an Adult" Course

It's almost a year since I left home, living here in Jerusalem, and from time to time a thought about a course for "being an adult" pops in my mind.

The last time the thought popped was yesterday night, when I found out that our electricity bill is extremely large than it is supposed to be. So while walking like a ghost in the apartment on 1am while trying to forget about my insomnia, I found out that there are small letters in the bill that says the bottom line it is an "estimation" of our electricity usage (only it's a *7 one).

So, why are there colleges who teach about financial investments, raising babies and so on, but they don't teach you how to be a grown up?

I thought about these subjects as a basic discussion for a curriculum:
  • How to deal with bureaucracy.
  • Taxes.
  • Contracts (work, rental, etc.).
  • Fixing stuff in the apartment (such as blocked sink).
  • Paying bills.
  • Handling car issues (tests, bills, fixing basic problems).
If you think of something else, comment :)