Older blog entries for saju (starting at number 12)

16 Feb 2008 (updated 16 Feb 2008 at 15:58 UTC) »

Just got a shiny new Dell E248WFP monitor. Awesome good. Hooked up my Macbook Pro to the monitor and everything works great. Well almost everything. "Mirror mode" forces the monitor resolution to drop to the macbook's resolution.

I will get myself a nice USB mouse and keyboard tommw and run my macbookpro in "clampdown mode". That should make me happy mmmm..

15 Feb 2008 (updated 15 Feb 2008 at 15:41 UTC) »

javax.net.ssl.SSLEngine adventures

I recently had to write a server in java that can speak SSL/TLS. The actual application protocol is handled by classes upstream to the SSL/TL layer. For scalability I decided to use Java NIO - which implied using the javax.net.ssl.SSLEngine.

The SSLEngine api is pretty cool though could possibly be a bit better designed. Essentially the application needs to manage 4 buffers of data, 2 of which are read by and 2 of which are written to by the SSLEngine. Sounds easy, infact it is, if it were not for the Handshake and renegotiation. Calling an api on the SSLEngine can cause it to ask you to call another api which may in turn ask you to call the original ... and so on.

I first wrote the SSL layer using recursion but with upto 5 exit points and special code to take care of stack unwinding and having to manipulate global buffers this was deemed too risky. So I re implemented the SSL engine via state transition. Since I was already playing with NIO and had to use a thread pool to handle concurrent clients, I decided to make the SSL processing asynchronous. Essentially I broke down the SSL processing (including breaking down the handshake and app layer protocol parsing) into various states, the currently executing thread would finish executing 1 state and hand over the "session" to the thread pool where another free thread will finish the next state. Ofcourse I have coded in optimization where an implementation of a state can decide whether to transition over a thread boundary or force the current thread to execute the next state.

Long story short. It works andit fits very nicely into the server's threading model.

My VLC player is tuned to Gothic and Darkwave radio stations while I hack a working AES implementation in Actionscript 3. Coincidence or what ?

Dear ECMA people please please provide us mortals with byte addressing

1 Jan 2008 (updated 1 Jan 2008 at 15:01 UTC) »

Joel Spolsky's "Travel Survival" tips.

Tip #2 : Fly first class.

Right. That's when you stop reading.

The Leopard and The Tata Indicom Plug and Surf thinggy; a story.

Well actually not much of a story. I got my hands on a "Tata Indicom Plug and Surf thinggy". This is really a Sungil cdma usb modem using Qualcomm's mobile station modem (MSM) chipset. Darwin groks the msm chipset alright.

So I plugged in the modem into the USB port, pulled up "System Preferences", selected "Networking", filled in the account details - which should be same for all tata subscribers i.e dial #777, creds are internet/internet. Then I went to the "Advanced" menu section and changed the "Vendor" and "Modem" from "Apple" and "Apple Modem v34" to "Generic" and "Dialup Device". Hitting "Connect" should now get you online.

ps: i am posting this over the "tata indicom thinggy"

framework HELL

and what's with the java community and flashy library names ?

So I tried running Leenux on my shiny new dell d620 laptop. Since my linux skills suck and specifically since the 4th FC4 CD was fubar, I ditched the whole "put linux on my laptop" experiment and turned to FreeBSD.

fbsd 6.2 is lovely !. I used the 24 MB "boot" only iso image to get a install kernel on my box and performed the ports/packages install over the net. Very nice !

After spending a day configuring stuff I finally have the following working (or almost working..)

  • Video @1200x800 - thanks to 915resolution - which was in "ports" yeah
  • Sound ! - had to get the snd_hda.ko driver.
  • Skype !!!! - yeah baby - (linux abi ofcourse :D)
  • xmms for my lovely mp3's
  • mplayer for all those pron mpegs.
  • firefox with flash7 (linux binaries). The flash 9 crashes :( and there are no native flash binaries...
  • Java ! - yeah both the linux and native jdk
  • wired NIC - bge
  • USB - works like a charm
  • Wireless - if_wpi - maybe works maybe not - don't know - have to test yet - saw a bunch of mem align warnings on console though
  • fvwm2 -- mmm
  • acpi - well atleast I have it configured in my custom kernel

So - freebsd is going to stay on my new laptop from now on. Feeling happy!

2 Mar 2007 (updated 2 Mar 2007 at 15:17 UTC) »

char *a;

int **b;

b = &(int *)a;

The last line is ofcourse wrong, casting operation returns a value, & of a lvalue doesn't make any sense.

gcc catches this properly but icc 8.0 compiles this and the compiled code works.. Hmm...

"Skype is not compatible with system debuggers like SoftICE."

grrrrr.

http://www.google.com/search?hl=en&q=%22skype+is+not+compatible+with+system+debuggers+like+softice%22&btnG=Google+Search and the 4th link tells me how to workaround this.

I discovered "man 7 packet" last week and have been having a evil fun filled week disrupting the local network @work.

http://saju.pillai.googlepages.com/pong.c.txt spoof's an ARP packet. If the target of the spoof is a Win32 or WinXP box - interesting things happen - possibly including complete disruption of networking on the target box (I found that out the hard way)

No Malice. Just world peace.

3 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!