Software
How to get logged-in username in Hudson?
Mar 3rd
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>”.
HowTo: Enable Aero mode in Windows server 2008 R2
Feb 17th
I recently was setting up a build server and chose Windows Server 2008 R2 to be the OS. Since I was also looking for something like a centralized deployment server for my development team to quickly reflash their testbeds, I was very h appy to see the 2008 R2 server’s “Deployment server” role…but, wait, this is a big saga and is for another post. This one is all about “Aero”!
After installation, I noticed my Windows server 2008 R2 booted in “Windows classic” mode. This was an eye sore, to say the least, after having used Windows 7’s themes. My machine has GeForce 9500GS along with the proper x64 driver. So I know it is capable of doing Aero. But, Windows “Personalization” option was not allowing me to select any Aero theme.
Quick googling showed me that I was not the first person trying to solve this – Here’s the link I used & found very helpful – http://software.intel.com/en-us/blogs/2009/01/09/windows-server-2008-r2-beta-aero-enabled-workstation/. Though I had “Desktop experience” feature installed, my “Themes” service was not enabled.
I set it to “Automatic” and started the service. But, still Windows was not allowing me to set the Aero theme. If you are facing the same issue, remember to reboot at this point — that is after enabling the “Themes” service, do reboot once. Once logged in again, you will be able to switch to Aero!
BTW, its been close to 2 years now since I posted here — was heads down on a project all the time
. We did a Wireless Display solution that recently hit the market. Will post more on it soon.
HowTo: Streaming music/photos/videos to Wii
Aug 31st
Wii doesn’t have in-built media client or DMA capabilities, but there is a workaround…
If you don’t have Xbox360/PS3 or a dedicated DMA device, you can try out streaming from your PC to your TV via Wii using a program called Wiisic [Doesn't mean you cannot do this with Xbox360/PS3 in place]
Note that, you need to have Wii Internet Channel installed in your Wii. If you are trying to use your US-bought Wii outside US, with out a US credit card,try to use this trick.
How to setup Wiisic:
- Download latest version of WiiSic [Direct link to 0.815 / Home page
- Make sure you have a compatible JRE. All JRE1.5+ versions downloaded from Sun website are ok. Microsoft's JVM may not execute this JAR. At least, it didn't work for me under Vista.
- Double click on Wiisic.jar. You should see the launch dialog shown below [for v0.815]. If it gives an error, make sure you are using the proper Sun JRE (not Microsoft’s).

- Now you need to configure the settings. Choose the folder containing your media files first. Make sure you choose your network card from the drop down list in (3). Also. change the port to something like 8081. If you have a 16:9 supporting TV, choose the 16:9 proper player in (2). Following screen shown the settings I used in my computer.
- Now switch on your Wii. Open the Wii Internet channel. Type the IP that is shown under (4) in Opera’s address bar. Wiisic should load now and start playing the stuff you chose under (1) above.
This has to proved to be the most effective inside-LAN-streaming-solution for me, till now. Let me know if you come across any other solutions.
HowTo: Buy Wii points online from India
Aug 5th
Though Nintendo hasn’t officially launched Wii yet in India, the number of Wiis in India *is* increasing. 3 of my friends, who returned from US last week, bought Wii
I don’t know how they got hold of one, as it is in extremely high demand over there now!
One of the initial problems you’d face trying to setup the Wii in India is the power converter. You *cannot* plugin Wii directly in to one of our power sockets, it will just burn! Unless you want to do the burn-in (!?) test with your Wii, I suggest you go out and buy a 220-110v power adapter (stepdown). It is available in many wattages, for Wii a 50W or 100W should suffice.
The only other thing you’d find a bit problematic is buying Wii points. Mine is a US Wii, so whenever I try buying Wii points online, it asks for a credit card along with the US address / Zip code blah blah…this one can be real irritating! Don’t lose heart though. There is a simple/effective method (Based on this post). The trick is to find a region which accepts Indian credit cards with out asking too many questions
The region found by the original poster is Brazil.
How to buy Wii points from India (Thanks to StringFellow):
- Change your Wii country to Brazil. You will find this option in Wii Settings section. Wii will now ask you to confirm the user agreement for the new region. Do press ACCEPT here, else you will get an error later when accessing the Woo shop.
- Go to Wii Shop. If you already have “My Nintendo” account at Nintendo.com linked to your Wii shop account, Wii will warn you that the link will be broken. Don’t worry about this message. You can set this up again later.
- Once in, click on the “Add Wii points”. Enter your CC number, name, expiry date and CVV. In the next screen enter any random Brazilian postal code. I used Brazilian Discovery Channel postal code. You can find more of these postal codes in Google.
That’s all, it should work! I bought USD30 worth of Wii points and it worked flawlessly. Once you have the points, you can reset your Wii country to USA (if yours is a US Wii like mine) and reconnect the Wii Shop login with your Nintendo.com login.
What to do with the Wii points?
You can buy Wii Channels, Virtual Console games or WiiWare games online from the Wii shop, using the Wii points. I strongly suggest you buy Wii Internet (Opera) channel. It costs only 500points (USD5.0) and it is worth it. Quickly checking the Orkut, sitting in the couch is bliss, I tell you
No..not another Wordpress version!!
Aug 4th
I logged in to my blog account 2 days back, after a verrry long time (I blame my project move in the professional world). I was surprised to find out so many things have happened in the Wordpress world. A new version has been released, many more vulnerabilities have been found and fixed…WAIT…a NEW version?? NOOOO! It feels like I just updated to a new version…is there a new one already!???
Wordpress is churning out new versions faster than my C2Duo / Vista machine can boot
Don’t believe me? Look at these dates:
| Wordpress version | Release date |
| 1.5 (Strayhorn) | mid-Feb 2005 |
| 2.0 (duke) | Dec 2005 |
| 2.1 (Ella) | 22 Jan 2007 |
| 2.2 (Getz) | 16 May 2007 |
| 2.3 (Dexter) | 24 Sep 2007 |
| 2.5 (Brecker) | 29 Mar 2008 |
| 2.6 (Tyner) | 15 Jul 2008 |
Who is the real worker & some personal tales!
May 28th
Its been a while since I posted. What have I been doing? Apart from the occasional tennis sessions in Wii, I am kinda stuck in the work (if you thought it sounded like "stuck in the rut", you have a warped mind!
). Its already 12 in the night here, me feeling very sleepy. But wanted to finish up this toon below. I guess it is a reflection of my current mind state.
I read Matthew Reilly’s "Seven Ancient Wonders" last weekend. Book is on my favorite topic – Egypt!! Unfortunately this one reads like a kid’s book. The ease with which the main character of the book solves/crosses all those complex pyramidal snares/traps is ridiculous, to say the least. Anyway, I learnt something about the early water traps and Reilly’s description of Hanging gardens of Babylon was highly imaginative; I’d rate this book 2/5 – you can read it probably once, over flight or when waiting for your wife to finish her shopping
I have started on his "Ice Station" next, lets see how it reads.
Last weekend, I also spent lots of time watching the entire 16 season of Survivors : Fans vs Favorites. I have never seen Survivors before, though I knew what the concept was. But, at no point of time I expected it to be so well made and so captivating! I thoroughly enjoyed the isolated environment, the idea of tribes/tribal council and the human dynamics that played out for survival. Wow…an amazing reality show. I personally liked Ozzie a lot in the show, very unfortunate Parvati fooled him in to quitting. I cannot wait for the next season to start!!
In the Wii front, today I got my Carnival games collection. My first impression: I don’t like many of the games included, hopefully multi-player will prove otherwise. Enough of my whining now…time for bed!
HowTo: Use Dosbox as a Quick & Dirty disassembler
Apr 19th
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.
WinSAG: Windows GUI for Simian (& other tools)
Apr 12th
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
21 Virus and other Malware payload videos
Mar 26th
When I was uploading my Cascade virus video yesterday, I found a lot of interesting videos on the same topic. I enjoyed them thoroughly. I am listing the ones that I found interesting here to make things easy for others to find these videos easily. Hope you like this list too.
Do let me know if you come across any such videos online, I am a big sucker for these
Following "In Action" videos were all uploaded by onNeutral. Professionally done. excellent stuff! I haven’t included any info on the worms/virii he talks about, as he has added more than enough info in the videos (read the red ticker bar to the bottom in all these videos)
1) In Action: Blaster Worm
See the Blaster worm attack another computer and how both of them attack a simulated http://windowsupdate.com server.
2) In Action: Melissa Worm
HowTo: Fix "The response to the metaWeblog.newMediaObject method received from the weblog server was invalid"
Mar 18th
Today I got this error message from WLW: “The response to the metaWeblog.newMediaObject method received from the weblog server was invalid“. Why did WLW think the response was “invalid“?? What exactly did it receive from Wordpress??
Luckily, WLW logs a lot more in the background. You can access that log file via Help -> About WLW. Click on the “Show Log Results” link in the dialog box. This will open the log folder.
Mine had this trace dump:
WindowsLiveWriter,21504,Fail,00020,18-Mar-2008 14:00:01.479,"WindowsLive.Writer.Extensibility.BlogClient.BlogClientInvalidServerResponseException: Invalid Server Response - The response to the metaWeblog.newMediaObject method received from the weblog server was invalid:
Invalid response document returned from XmlRpc server
at WindowsLive.Writer.BlogClient.Clients.XmlRpcBlogClient.CallMethod(String methodName, XmlRpcValue[] parameters)
at WindowsLive.Writer.BlogClient.Clients.MetaweblogClient.DoBeforePublishUploadWork(IFileUploadContext uploadContext)
at WindowsLive.Writer.PostEditor.WeblogBlogFileUploader.DoUploadWorkBeforePublish(IFileUploadContext uploadContext)
at WindowsLive.Writer.PostEditor.BlogPostReferenceFixer.FileUploadWorker.DoUploadWork(BlogFileUploader fileUploader)
at WindowsLive.Writer.PostEditor.BlogPostReferenceFixer.LocalFileTransformer.Transform(String reference)
at WindowsLive.Writer.CoreServices.HTML.HtmlReferenceFixer.LocalFileReferenceFixupFilter.FixReferences(String reference)
at WindowsLive.Writer.CoreServices.HTML.HtmlReferenceFixer.OnBeginTag(BeginTag tag)
at WindowsLive.Writer.CoreServices.LightWeightHTMLDocumentIterator.Parse()
at WindowsLive.Writer.CoreServices.HTML.HtmlReferenceFixer.FixLocalFileReferences(String html, ReferenceFixer fixer)
at WindowsLive.Writer.PostEditor.UpdateWeblogAsyncOperation.LocalSupportingFileUploader.UploadFilesBeforePublish()
at WindowsLive.Writer.PostEditor.UpdateWeblogAsyncOperation.DoWork()
at WindowsLive.Writer.CoreServices.AsyncOperation.InternalStart()"," at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at WindowsLive.Writer.CoreServices.Diagnostics.LogFileTraceListener.Fail(String message)
at System.Diagnostics.TraceInternal.Fail(String message)
at System.Diagnostics.Trace.Fail(String message)
at WindowsLive.Writer.PostEditor.BlogPostEditingManager.UpdateWeblog(Boolean publish)
at WindowsLive.Writer.PostEditor.BlogPostEditingManager.PostToWeblog(Boolean publish)
at WindowsLive.Writer.PostEditor.PostEditorMainControl.commandPostAndPublish_Execute(Object sender, EventArgs e)
at WindowsLive.Writer.ApplicationFramework.Command.RaiseEvent(Object eventKey, EventArgs e)
at WindowsLive.Writer.ApplicationFramework.Command.OnExecute(EventArgs e)
at WindowsLive.Writer.ApplicationFramework.CommandBarButtonLightweightControl.OnMouseUp(MouseEventArgs e)
at WindowsLive.Writer.Controls.LightweightControl.RaiseMouseUp(MouseEventArgs e)
at WindowsLive.Writer.Controls.LightweightControlContainerControl.OnMouseUp(MouseEventArgs e)
Pretty neat stack trace,eh?
It clearly shows that DoUploadWork() (Invoked by UpdateWebLog()) method fails for some reason. Armed with this knowledge, I took a look at my post. I had many pictures in that and my WLW was setup to upload pictures through XML RPC. So, obviously that was causing some kind of trouble. I traced down the big picture (size: ~0.7MB) in my post, resized it to 40K and published again. Voila, things worked perfectly!
I googled for the error message, since I wanted to know how other people solved this. Looks like increasing the memory size for PHP in the server side will also help. So, one of the following things should help you to solve this problem:
- If you have images embedded that need to be uploaded to the server, make sure they are not big. I don’t have any idea on the *optimal* size. I guess anything less than 100K should be ok.
- If still you are getting the same error, try increasing the memory_limit value in php.ini to 12M or 16M. Check this page for info on memory_limit. If you don’t have access to your server, you may have to talk with your host provider.
I believe the first solution will fix this error, in most of the cases. Do let me know in the comments, if you come across any other solutions.
