Wednesday, April 3, 2013

How to install packages with easy_install or pip through proxy

There are two easy way to install packages for python (regardless of the platform you're using), namely easy_install and pip. The later is actually an overlay on the former.

They work very nicely, except with pesky proxies. Both of them have the ability to download through proxy, but they use different syntax.

For pip you will simply add the option '--proxy' to indicate the proxy address like so:

Whereas easy_install will rely on environment variables, http_proxy, https_proxy , ftp_proxy
If you want those settings to persist, don't forget to add them to your bashrc, or through your windows settings

Monday, February 18, 2013

Enabling WebSSO / Kerberos Auth in Firefox

I've been using Chrome for a while, but i recently switched back to Firefox, at least for work (mostly for memory usage reasons).

 XMarks makes the back and forth transition a piece of cake. The only issue that i had was with Kerberos / WebSSO which was enabled by default on Chrome but not Firefox.

Its a simple configuration change though. all you need to do is access the settings by typing "about:config" in the address bar and search for the following items:
  • network.negotiate-auth.trusted-uris: value=,
  • network.negotiate-auth.delegation-uris : value=,

  • network.automatic-ntlm-auth.trusted-uris: value=,
  • network.automatic-ntlm-auth.allow-proxies: value=true

  •  network.negotiate-auth.allow-proxies: value=true

And you're good to go.

Monday, March 19, 2012

Control fan speed under windows 7 installed with bootcamp on mac

This week end temperature suddenly came back to 30s (Celcius) which mean winter seems to be over here (HK). Although this is fantastic new as the weather was gorgeous, my trusty mac wasn't so happy. I put him under very heavy load, and cooling didn't seem to work so great.

So i went trying to manually crank up the fan speed. I tried SpeedFan which is a very good tool, but unfortunately doesn't seem to be able to control fan speed on my Mac running windows 7 (from what I've read in various places  this is "normal").

Still I've found a work around, simple increase the default running speed of the fans. It doesn't make my box more noisy, but that's fine for me. Do do that you need to change the default running speed of the fan under MacOs and it'll carry over to Windows7.

I did that using a tool named "Fan Control". Install it, raise the speed to max and all the thresholds to the minimum.

Monday, February 20, 2012

Ant - setting Environment variables in a Hudson/Jenkins build

Today, while trying to setup Jenkins for a project, one of the job includes a ant build for a java project. This build has been working pretty well for some time, but i wanted to automate in inside Jenkins. I encountered a problem when i tried to create the new jenkins job, because the ant build references some environment variables.

Tuesday, February 7, 2012

How to display the top x biggest folder under unix linux

As the titles mentions here's a little one liner when you want to find out who's are the top disk space users under a certain directory:

du -sk * | sort -nr | cut -f2 | head -5 | xargs du -sh

The command above show the top 5 offenders in a nice readable way (i.e not in kb which i find hard to read):
$ du -sk * | sort -nr | cut -f2 | head -5 | xargs du -sh
 3.2G   Offender1
 1.8G   Offender2
 1.3G   Offender3
 1.1G   Offender4
 603M   Offender5