Monday, September 15, 2008

Having the right tool for the job

As I wrote before, in the past several weeks I've been looking for a job. Since I have quite a lot of experience (at least I'd like to believe so) in several IT fields (SysAdmin, DBA, developer, management and so on), I decided it'll be nice to add something extra to my resume, and find a job which involves stuff which previously were my hobbies (developing was and still a hobby). This lead me to find a job in the security field. In my new job I'm responsible of both research (which is very important for me) and development of complamentry tools.

I guess that the research part would influence my blog in the future, since finding new and exciting stuff is a good reason to blog. This is why now I'll concentrate on the development part.
Developing software in my group is quite a versatile task. This is due to the fact that every tool developed, has to be very oriented to it's purpose, and most tools won't be used outside my group (though some tools does). The meaning of all this is that I get to choose how to develop each solution. If Python's quick modeling ability is required - Python it is. If it's Perl's regular expression power - Perl it is. Heavy lifting? - .NET or Java would do.

Just as the research part of my job involves me using the right security tools (sandboxes, forensic tools, decompilers etc.), so does the development part. This lead me to look for a good place for resources and Q&A, so I could complete my programming tasks faster. As I wrote before about stackoverflow, this is the right tool for the job. It think it'll grow very rapidly, and would be a great place for a great community to develop.

Last, what facinated me most, is the fact I didn't have to register to stackoverflow. I'm already registered via the same account from which I blog right now. That's right - stackoverflow uses OpenID, so I feel safer and there's one password less to remember. Great work.

Saturday, September 6, 2008

DNS query in Perl

As mentioned before, I'm doing a project which involves email spam research. Part of the project requires me to query DNS servers for their TXT and SPF records, since they contain valuable information regarding which servers from a specific domain are allowed to send mail.

When we (my partner and I) started coding the project, we decided Python would be our primary language, since we both know it, and it makes life easy. This was true, even on the difficult parts of using a database (MySQL), connecting to SMTP/IMAP/POP3 server, etc.

Last week I stumbled into a block, when querying a DNS server was required. Usually, I'd use the output of 'dig' or 'host', but I cannot be sure the project would run on a platform that has those tools. My second try was to use Python modules (pydns etc.) which should solve this problem, but they were all buggy/undocumented/not-working/too-complicated-to-use.

The annoying part is that I know how to do what I want in Perl:

use Net::DNS;
my $res = Net::DNS::Resolver->new;
my $answer = $res->search('gmail.com', 'TXT');
print $answer->string;

And that's it. 4 lines of code. Still I hadn't found a decent Python-way to do this. So now I'm using Pydig to query DNS servers. Over 1200 lines of code. Pretty big hammer to solve a tiny problem.

If any of you know a better way to do this in Python, I'd love to hear about it.

Great music service

The first time I heard of Pandora, was few years ago, when it was still accessible to users outside the US. I used it for some time, and stopped using it when it stopped "choosing" music I like. The concept of listening to music on-line is something I like since it's a very convenient way to discover new music, or have your music wherever you are (assuming you have an internet-connected PC).

About a year ago, a friend told me about deezer. Ever since, I'm using it regularly. It works pretty well, has huge database of songs, sound quality is good and it has nice features. Every once in a while I find myself looking for some old songs that there's no way I'd find in other places, and then I sit back and listen to it... that's fun. You should all try it. Opening an account would allow you to store playlists and enjoy several more features.

A nice feature of deezer allows me to play to the song I was listening to when writing this post, so you could enjoy it as well:


Discover Extreme!

Wednesday, September 3, 2008

Bureaucracy vs. Technology

Sometimes I think I grumble to much in my blog, since there are more posts in which I say bad things about stuff that annoys me, that there are about pure technology or CS related stuff. Unfortunately, this one would be no different. But I'll try to connect it to technology as much as possible.

Today I went to buy a used (second hand) car. The person from whom I'm buying the car is a real nice person, who wishes to sell the car due to relocation to the US. After going through the standard procedures of checking that the car is alright mechanically and electronically, we agreed to meet this morning at the post office, for conveyance ("ownership transfer"). As this is not my first vehicle, I'm familiar with this procedure, and thought everything would be just fine, and I'll be driving home with my new car. So I thought.

At the post office, they check whether there are any limitations regarding selling the property, such as whether it is confiscated or stolen. Since I already checked it beforehand, I knew there shouldn't be any problem. After they ran the check in their computer, they told us "sorry, you cannot convey this vehicle, we don't know why". We asked what the problem is, but they kept repeating that sentence, without supplying any reason. We both thought it was weird, so we headed to the closest ministry of transport office.

At the ministry of transport office there were HUGE lines, unlike any other office in Israel, including banks, post offices, etc. Since we had no choice, we stood there. That took about an hour. As our turn finally arrived, we thought we're gonna find out what is this all about, and close the deal. Unfortunately, we got a new answer "The police have ordered to remove the car from the road, we don't know why". Again, they looped that answer several times, without further explanations. 

At this point, I returned back home, with my old car (luckily it's still going), while the selling person had to drive to the traffic-police station (somewhere not very close to the rest of the offices), in order to check what is wrong with the car, and why the hell did the police ordered to remove his car from the road, without him ever getting any ticket or ever being arrested even for a regular check. After two hours he called me and said that it all was a big mistake. The police wrote the ticket with the wrong number and ordered to stop the wrong car (they actually arrested a truck!). So now he has a letter to the MOT that says they we can complete the transaction in their office (and not the post office, which means HUGE lines again).

I've been dealing with technology for quite a while, and I was responsible for research and modeling of SOA (service oriented architecture) and connectivity between different systems. This made me think about several problems that arose from bureaucracy and could be easily solved with technology:
  • If there's already a network between the police to the MOT, and between the MOT to the post office, why can't they pass a simple string saying what's the problem with the car? That would have saved us at least an hour.
  • Why can't the lines in the MOT be better organized, like in modern banks, medical centers and post offices?
  • If there is connectivity as described above, why can't the police update the record about the car, so we could go back to the post office? Why would we need a letter if we have
    computers?
  • Why do they still trust the hand writing of police officers and volunteers, instead of equipping them with cameras, and using OCR software (the same which is being used for toll roads, such as road 6)? That could have saved us the entire day, and the day after.
If I owned a company, at which SOA and such other products were the line of business, I'd volunteer to implement these products at the MOT/police/post-office, so that every citizen could see it in action (everyone visits these places). I think it'll bring me a lot of customers, perhaps world-wide. As for the typo in the car number, this is plain stupidity: A tiny little check would have shown this number doesn't belong to a truck. Simple input validation that every programmer could've implemented.

Edit: Since everyone is talking about Google's chrome (the new browser), and since this is a technology blog, I can't stop myself from writing something about it. This post was written using chrome, and I must say it was quite fluent, although not that much of a difference from Firefox. I'll be using it for some more time, and try to stress it out.
Tip: If you close a tab by accident, simply click the (+) sign at the tab bar (is this how it is called?), and the newly opened page (assuming it's the home page built into the browser) would suggest you to open the recently closed tab.

Sunday, August 31, 2008

My Blog Day

There aren't many anniversaries I celebrate. When it's work-related, I think the only one I care to mention every year is SysAdmin Day. This year, I decided it'll be nice to mention the Blog Day.

The "celebration" instructions are pretty simple: tell your blog visitors about at least 5 blogs you read, so bloggers could get to know each other better. Following is the list I compiled. I'll try it'll be as novel as possible, as I guess most of my blog readers are already familiar with most of the stuff I read (since we have same interests and we are part of the same planet).

  • SysAdmin Tales. Been a sysadmin myself for quite a long time, I know most of the frustrations told about in this blog. Very recommended.
  • Paul Graham Essays. This one is recommended even if one doesn't plan to start a start-up company, as it contains many insights and things to think about when it comes to the software industry.
  • StackoverFlow. This blog was created by Joel Spolsky (joel on software) and Jeff Atwood (coding horror), as part of a common project they started: StackOverflow. I guess most people are familiar with these two blog's (Jeff is making a living from his blog), but stackoverflow adds even some more insights about the creation of computer software, building a commercial web site, starting a company etc. Although this is mainly a podcast, one doesn't have to listen to it, since there are transcripts available.
  • xkcd. Funny (if you're a mathematician or computer scientist). Period.
  • The last one is not a blog (although you can RSS it), but rather a share of Yevgeny's favorite blog posts (via his Google Reader). I think this is the best way to get to know new stuff: becoming a "subscriber" for stuff that somebody else has already filtered for you. Yevgeny is doing good job at this.

Most interestingly, this post made me go through my Google Reader reading list, and made me realize there are many blogs I hadn't been reading for quite a while. Perhaps I should clean it up a little.

Monday, August 25, 2008

Schizophrenia

Not very long ago I started looking for a job. The searching->finding->getting-interviewed loop, exhausts itself quickly. Since I'm not used to looking for jobs, and I wasn't sure in which particular field I want to work, I decided it'll be a good idea to mass-send my CV. Mass-sending means more than a dozen companies receives your CV in the same time, and then you expect a blitz of phone calls from them.

Among others, I sent my CV to Microsoft (their new R&D center), as I heard so many good things about working there. At this stage, no phone call was made by MS. Few days later, via an alternate route, my CV reached MS the second time. This route probably had higher priority, as I got a phone call the day after. This phone call lead to a series of very interesting (and difficult) interviews, which ended with a job offer. In the mean while (about after the first interview) I got this mail:
Thank you for sending us your CV.



While we are very impressed with your skills and qualifications, we regret to inform you that we don’t have a suitable position for you at the moment.

We will keep your resume on file for any opportunity that may come up in the future.

This mail was regarding the first time I sent them my CV.

So what we have? Me sending my CV to the same place twice. While the second time got me interviewed, the first one got me (a gentle) "we don't want you" letter. More important, these events happened in parallel. How does this makes sense? Different recruiters (small department so small chance)? Does getting your CV via different persons gets different attitude? Perhaps, but that doesn't sound good. So it must be some kind of schizophrenia...

Wednesday, August 13, 2008

Interesting bug solution

Every once in a while I get to thinking "hmmm... what shall I write in my blog? I don't have any muse right now, but I want to write about something". To my surprise, each time that happens, I accidentally find an interesting topic, which is derived from things I stumble upon while surfing the internet.


Last week I've been configuring my not-very-powerful laptop, so it'll be able to remotely connect both my Windows and my Ubuntu. The Ubuntu connection is done via freenx server, while the Windows connection is done through Terminal Services. Actually, I'm writing these lines from a TS session. Most of the time I'm quite happy with this setup. I have full access to my desktop, I can work concurrently with my girlfriend (which is using the desktop, and which I taught the magic ways of using Ubuntu), and I can sit wherever I want, as the data is being encrypted over SSH over my wireless network.


Not all went clear, and both freenx and Terminal Services has some major bugs. The freenx bugs were solved after a short google search, and after hitting the "connect" button enough times (so the Ubuntu realized I'm serious about my intentions to connect). Terminal Services gave me a much harder time. It appears that if you own a powerful nvidia or ATI graphics card, and you work with high-res, TS won't work. This can be solved with some tweaking of the Windows registry, and messing with kernel parameters (what the hell does this have to do with being able to use TS?).

Now, I have a new syndrom: every once in a while Windows decides this is a good time to reboot after a DCOM server crash occurs. This is quite annoying, and I haven't found a good solution for that, yet. In the mean while, I type quickly 'shutdown -a' to abort the annoying reboots, afterwards I restart the DCOM service and the TS service, and everything is back to normal. Awkward.

Me saying I don't have a good solution is only partially true, as I found this web page describing my problem. For some reason, it exists only in the google-cache (I don't know how much longer it'll be there), so I'll quote the solution part:
"
I have put Ubuntu on a second partition and that solved my problem for
now. I still can access my files from the first partition and it
doesn't reboot randomly.
Thanks for all your help!
"

Interesting! Installing Ubuntu solved the reboot issues. How come I didn't think about it.