15 February 2010

Configuring ISA Proxy in Ubuntu

Corporate policies have always been there. In my company, we’ve been forced to use Windows boxes and all other ports are blocked except for port 80, which is generally used for web browsing. Now, I am a developer and I love to explore things. Anyway, I needed to configure my workstation to suit my needs. I can’t defy company policies so I had to do some workarounds on it. Good thing I found this nice article on how to configure Ubuntu if you’re using an ISA Proxy. If ever the original authors of this how-to drop by my page and want this removed, please let me know. I’m just posting another article here so that people who are having the same problem as me will find the solution faster. I will put the links at the end of this article.

Environment:

  • Windows XP (Host)
  • Microsoft ISA Proxy
  • Ubuntu 9.04 (Guest) running on Sun Virtualbox

Download the NTLMaps Package:
In the reference link below it says you can download it here. But I think it’s broken so you can download it here in my repository.

Install the NTLMaps Package:

You can do this by simple double clicking the .deb file or by issuing this command:

dpkg --install <package_name>

Configure:

We need to fill-up some values in our settings. Take note that entries in bold are fix whereas those that are italicized are relative values that you need to obtain from your settings.

Listen port        :	 5865
Parent Proxy       :	 your.proxy.com
Parent Proxy Port  :	 port_number (in my case its port 80)
NT Windows Domain  :	 domain_name (your domain)
NT Windows Username:	 user_name (the user name you will authenticate with)
NT Windows Password:	 password (the password you will use to authenticate with the
ISA Proxy)

The installation will then restart the NTLMaps service and you should see something like this:

Stopping ntlmaps: ntlmaps.
Starting ntlmaps: ntlmaps.

Now let’s see if the service is running or not by issuing the ff commands:

ps aux | grep ntl

netstat -antpu | grep python

If installed and running correctly, you should be able to see something like these:

ridvan@Work-OZ-13MSX1-Vayeate:~$ ps aux | grep ntlmaps
root      1285  0.2  1.0   8236  5128 ?        S    12:05   0:00 /usr/bin/python /usr/share/ntlmaps/main.py -c /etc/ntlmaps/server.cfg
ridvan    1866  0.0  0.1   3040   776 pts/0    R+   12:06   0:00 grep ntlmaps

ridvan@Work-OZ-13MSX1-Vayeate:~$ sudo netstat -antpu | grep python
tcp        0      0 0.0.0.0:5865            0.0.0.0:*               LISTEN      1285/python

I’m hoping that everything went smoothly. So let’s move on to the next step.

Create a file:

We need to create a proxy file in /etc/apt/apt.conf.d/proxy and input the following:

proxy

Acquire::http::Proxy "http://127.0.0.1:5865/";

Reconfigure System Network Proxy:

In my settings, I didn’t go through this step but just in case it doesn’t work, you can proceed with this step.

Go to System ->Preferences->Network Proxy and point to localhost:5865 with _no_ authentication. Also reconfigure your GUI Package managers similarly.

Restart:

Just to make sure that everything will work fine, let’s restart our system.

Reconfiguring:

For cases that you need to reconfigure the settings, you can issue this command and you’ll be ask again to input the details of NTLMaps. Make sure to reconfigure also everything that was affected by the change.

sudo dpkg-reconfigure ntlmaps

So there, hope everything went well and you can now access your repositories via apt-get. Please message me for broken links and typographical or content error. :)

Reference:
http://www.linuxquestions.org/linux/answers/Networking/HOWTO_Install_and_Configure_NTLMaps_for_use_with_an_ISA_Proxy

16 December 2009

Switching Python Versions

Okay so I haven’t written an article for quite a long time and here I am surprisingly posting something about Python. Hell yeah I’m doing Python right now. In any case, there’s this program that I was tasked to modify. It is running on Python 2.6 but unfortunately the server to which it is going to be deployed is on Python 2.5. Don’t lecture on me about having the servers update its version because we don’t live in an ideal world and we live in a bureaucracy and there are some things that are not within our control.

So there, how would you be able to run two versions of Python in a single machine at the same time and being able to choose which one to use? I’ve googled an article on how to do this and here’s how you can do it:

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.6 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.5 10
sudo update-alternatives --config python

After issuing the last command, you’ll see a neat option screen like this:

ridvan@ridvan-work:~$ sudo update-alternatives --config python

There are 2 alternatives which provide `python'.

  Selection    Alternative
-----------------------------------------------
          1    /usr/bin/python2.6
*+        2    /usr/bin/python2.5

Press enter to keep the default[*], or type selection number:

So if you want to test some applications if it runs on a specific version, this is definitely very helpful. :)

(http://ubuntuforums.org/showthread.php?t=1190148)

1 November 2009

Happy Halloween!

Okay, I don’t really know when exactly is Halloween but earlier today around 2am, my friend Beryl sent me a message saying how beautiful the moon was. I opened up my curtains and saw the full moon. Immediately, I set-up my tripod and mounted my telephoto lens to take some shot.

Here’s a shot on how it looks like from my window:

Window View

Window View

And here’s a zoom view of the full moon:

Full Moon(300mm, f/18, ISO-800, 1/125sec)

Happy Halloween guys! :D