Posts tagged programming

How to get logged-in username in Hudson?

Quick background

Have you ever thought your manager keeps shelling out more on your plate other than the officially tracked tasks? Do not feel bad. You are not alone :)

My manager recently asked me to clean up the build server we use for our project. To put simply, it was a mess. I ended up deciding to start from scratch. Looking around, we quickly zoomed in on Hudson. A great build/CI server. Met literally all my requirements (one of which is extensibility – with the source for Hudson available as open source, we could not have asked for more!).

After many Hudson code changes and UI customizations, we now have a great CI server up and running. One of the code changes I did is to a plugin called email-ext. This enables customizing many aspects of e-mail notification that gets triggered. Unfortunately the stock plugin missed one important thing (at least to us!) – no way to get the user name who triggered the build.

I added a new variable called BUILD_USER to email-ext. When used in the email-ext mail template, this will get replaced by the user who triggered the build. Our server is plugged in to our corporate active directory and this plugin will pick up the logged in user name.

You will find the source code and binaries down below. Note that this is based off 1.3.4.2 Hudson code and is running in our snapshot very well. YMMV and do enough testing before putting in production. Do send me any bugfixes you make, I will make them available for download.

How to use this?

Copy the HPI file to your Hudson web apps folder. Restart Hudson. Go to <your job> => Configure. Scroll down to “Editable EMail Notifications” section. Click on “content reference” help to make sure BUILD_USER is showing.

See the highlighted text shown below.

Any instances of BUILD_USER will be replaced by the current logged in user. In case of timer activated builds BUILD_USER will show “timer”. In case the build trigger reasons cannot be found out, BUILD_USER will be replaced with “<unknown>”.

More >

HowTo: Use Dosbox as a Quick & Dirty disassembler

Dosbox is an open source DOS emulator available for many OS flavors. Dosbox allows you to run any old DOS game, relive some of the golden games of DOS era. It has full support for multiple video standards (VGA, CGA, Tandy,…) and sound cards (Adlib, SB, …). Amazing program! I was even able to bring up Windows 1.0 under that :)

Not many use this powerful emulator as a disassembler though. I have used this technique to disassemble many programs with out resorting to IDA or Sourcer.

More >

WinSAG: Windows GUI for Simian (& other tools)

WinSAG_Star Recently one of my peers inherited some legacy code from an Israel team. It had around 800 C/C++ language files and 30 ASM files. The task for my peer was to somehow make sense out of it and port that to an embedded environment with a big size restriction. The size of the code had to be reduced by at least 40%. Just to get him started on that, I thought of developing a new tool that could find the code duplicates. A quick Google search revealed the excellent Simian. Since, it met all our needs, my colleague has decided to buy a license to the tool and use it for his needs.

I spent a day trying out all it’s options. They have a neat ANT task, as well as an Eclipse plugin for Java developers, while nothing for any of the VisualStudio.NET IDEs! There is a command line tool though, thankfully. I put together a small GUI front end for this tool. Check it out if you are interested. Note that this tool was put together in a very short time and so didn’t go through any proper testing & I don’t intend to put it through one, in the near future. I have used this in my house for 2 days now and it hasn’t crashed yet.

This tool is in public domain and totally free. You can do whatever you want to with the source, though a line of credit will be nice. A post card or an email will be appreciated too. You cannot hold me responsible for any damage caused by this tool or the source code :)

 WinSAG MainScreen

More >

Virus group 29A disbanded – who’s next?

29A Labs

Couple of weeks back, 29A officially shut down business. 29A’s published work was one of the best (IMHO) sources for cutting edge virus technologies. Their e-zines provided a sampling of what was happening in the Virus underground during that period.

This was the last message posted by VirusBuster in their site:

I tried to contact ValleZ for some time in order to take a decision together about the future of 29A with no luck therefore I decided to take the decision alone. And my decision is that 29A goes officially retired. I feel this is fair because I am kinda the alpha and the omega of the group. 29A was born in Dark Node, my BBS, and I am the last active member of the group. My last words as 29A member are for all the people that worked hard to make of this group the best one: Thank you very much! Regards, VirusBuster/29A

29A has left the building!

Kind of sad.

I came to know of 29A when I was in my 2nd year UG, around 1997. 29A was a new group then (If I am right, the group formed only in the mid of 1996). BTW, if you are wondering why they named it so, 29A is the hex representation of 666 decimal.

More >

Chessbase Light 2007 Activation – eh?!

Chessbase Light 2007I love the work being done by the good folks in Chessbase; IMO they have the coolest jobs, they get payed to develop software for CHESS :-) Ohhhh, I wish I had some kinda day job like that! I know video game development is as interesting, but anyway gaming has never been one of my serious interests. Anyway, coming back to CB…I check the Chessbase site more than my Gmail, sometimes, which reminds me of the lack of RSS in their site…but I am not going to complain about that ever, as I feel it is worth visiting their site for the excellent articles they post. I am not sure if Fredrick Friedel ever thought of creating a business model out of the Chess news network they can easily build. Ok, again I am digressing…

I read with interest the article on their Chessbase Light 2007 software. It provides nearly all the functionalities of the full-fledged Chessbase DB software, one of their flagship products, for FREE. Of course, the catch word in the above sentence is “nearly all“. BW, CB Light allows only viewing, you cannot create databases or save games using that. For that you need to upgrade to CB Light Premium, which I guess is the same as Chessbase starter pack minus Bigdatabase 2007/Player encyclopedia/CB Magz.

Chessbase Light 2007 Activation screen

The activation screen looks like the above screenshot (NOTE: I am using the screenshot provided by CB). When I saw this I was like ‘Eh?? What stupidity!!”…Do you see the captcha field in that window? Captcha are used for preventing the bots doing automatic signups, spams et al. Is there any sane reason why the user has to type the code shown in the image????

“Oh, ok…may be this code is part of the activation process”, I thought.

Chessbase Light 2007 Web Activation

When I went to the site meant for generating Activation key, I didn’t find a field for entering the abovementioned captcha code. Then why the heck the CB Light programmers decided to show the captcha code in CB Light? Beats me!

Note that I may be totally missing a valid reason behind having that captcha in a desktop program, if so I’d appreciate if you’d enlighten me!

Wordpress plugin for Thamizmanam toolbar

Update (22/03/2007): Latest version 0.9 has been uploaded. This adds support for Blogdesam aggregator.

This plugin is the outcome of spending three days with Wordpress and Thamizmanam toolbar code :-)

This plugin inserts automagically the Pathivu toolbar code (both part1 and part2, as listed out here) at proper places. This supports both Thamizmanam and Blogdesam. The plugin adds the code only to SINGLE post pages. Note that, no template file changes are needed. Just install this plugin and everything should be fine!

How to install the plugin?

  • Download the file (see the bottom of this post)
  • Upload this to your <wordpress_root>/wp-content/plugins folder. NOTE: Replace <wordpress_root> with your WP installation directory.
  • Unzip the file to create tbToolbar sub directory, under plugins folder. Overwrite the old files to upgrade. NOTE: Make sure tbToolbar folder is immediately under /wp-content/plugins folder.
  • Go to Plugins page in your WP control panel and activate the plugin.
  • Now, go to Options > Thamizmanam WP Plugin page. Here you can choose the image for showing in Thamizmanam. You can also leave this blank for the plugin to submit with the default picture.

Thats all!

Screenshots:

Click to enlarge

More >

Windows Beginner Developer Learning Center – Gr8 idea!

Microsoft has come up with a website totally dedicated to getting the programming newbies up and running (Of course, using MS technologies! :p )

BDLC covers both web and desktop applications. The best part is, it doesn’t assume any prior programming knowledge. I am pretty sure this is a great resource and is gonna boost the Windows developer base exponentially!

Some interesting topics from BDLC

I have bookmarked some for my wife to go through, this weekend. I am pretty sure I will be directing her to this site more often from now!!

Some links …

Have you ever wondered how many key presses you make every day? What if you can calculate how many characters you type across weeks, months and even years? Try this link.

http://dolphin.twistification.net/

You need to download and install the Pulse client and create an account with them (all free). It sits in the background and counts the number of characters you type. Now, we can know when we are gonna get CTS….

Links to nearly all subjects in programming

http://www.geocities.com/kannanmr/extpgml.htm

Links to help you prepare for interviews (Found in SriHari’s blog)…

General Category:

1. http://www.cetus-links.org

C/C++ Interview Questions: More >