Saturday, September 10, 2011

TTLS/PAP authentication in Nokia smartphones

Our college revamped the authentication mechanism of our campus wifi recently: instead of WPA2-PSK, it is now EAP-TTLS. The authentication is done by a central LDAP server, so one uses his common college network uid/password for authentication. Really neat.
But I had some trouble getting it to work on my Nokia 5800 smartphone, although a firmware upgrade added native EAP support. I changed the security settings of the wifi to EAP, selected all the right options, but still it would obstinately show the message: "TTLS/PAP authentication failure" or something like that.
I almost gave up hope, when I learnt from prof. Golam Mortuza Hossain that Nokia doesn't allow TTLS/PAP authentication unless an authority certificate is installed. So I promptly transferred the CA certificate to my phone over bluetooth. But the phone didn't even detect it as a certificate.
Then I learnt that Nokia phones only allow certificates of DER format. The conversion is easy enough, provided that openssl is installed on your computer:
That's it. Finally I can connect to the college wifi.
I wish it were that simple for Kindle 3! For some inscrutable reason, amazon doesn't allow kindles to access WPA-enterprise or ad-hoc networks. Even on jailbroken kindles, the process to make it work is very messy:one has to create a WPA wifi with the same ssid first, so that it is added to the list of 'Known' wifi networks, and then install a wpa_supplicant script. I haven't managed to do all that yet. Besides, kindle has free 3g anyway.

Monday, March 28, 2011

Rendering TeX using MathJax in Wikipedia

Today I came across this awesome javascript based solution to enable MathJax in Wikipedia : http://en.wikipedia.org/wiki/User:Nageh/mathJax. This trick works because you can tell wikipedia to leave the equations as TeX source (You just have to specify it in the preference page). Then MathJax takes care of all the rest.

Saturday, March 19, 2011

Getting gnuplot wxt terminal in Mac OS X

It's not difficult to install gnuplot on Mac OS X. Getting the source from sourceforge and performing the usual ./configure -> make -> sudo make install dance gets the job done.

But the the number of terminals you get in this method is pitifully small: the only interactive terminal available is x11. This is quite unbearable for anyone who had used wxt perminal in linux before: it's not even possible to zoom in to any particular area of the plot, let alone copying the plot to clipboard.

However, the easiest way to get the wxt terminal in Mac OS X is to install through fink. I should mention here that fink insists on installing about everything except the kitchen sink if you try to install gnuplot, though. It took almost 3 hours on my machine for the whole bunch to get compiled. Wish fink had a repo of binary packages for snow lwopard.

Tuesday, January 11, 2011

Merging Two Google Calendars

I regularly use Mail for Exchange to sync my phone with my Google Calendar account. It's awfully useful but there's one catch : you can't set it up to sync with two google calendars. It'll always sync only your primary calendar.

Now, I have a personal calendar with entries for my classes etc. Apart from that, I have also subscribed to another public calendar for keeping track of the activities organized by various clubs of IISER Kolkata. But the default-calendar-only policy of Mail for Exchange meant I was unable to get the second calendar to sync with my phone.

I googled for finding some solution for the issue, but it didn't yield any useful information. I had almost given up when I came across a not so well-known service from google called Google Apps Script. As the name suggests, It lets you run scripts written in JavaScript on google's server and the script can access many of google's popular services, including calendar.

That solved my problem completely. All I needed was a script which will add all the events of the second calendar to the primary calendar, with some background checks to avoid adding duplicate entries. That was pretty easy: as per google's standards, the documentation was excellent, with ample examples too. So I had a working version of the script ready within very little time.

The code:

You can add triggers for the script as well. I added a daily trigger, so it will run once a day and sync the secondary calendar. Problem solved!