[Linux] Aventail VPN Client 8.90.263

In order to connect to my company’s intranet, I need to install an Aventail client. I downloaded the package, unzip it, and execute install.sh. The installation process it as easy as ABC. The applications is installed in the /usr/local/Aventail/ folder. You can run the client either by executing startct or startctui. The startctui is a Java GUI client.

When I tried to establish a connection, it just couldn’t connect to my company’s VPN gateway. The /var/log/AvConnect.log log file tells me that handshake failed. After some googling, I found the solution at http://just-another.net/2008/11/20/ubuntu-intrepid-and-aventail-ssl-client/.

The problem lies in libssl and libcrypto from OpenSSL package. I am running CrunchBang (Ububtu based distro). The OpenSSL offered in the repository is version 0.9.8g. You can verify it by doing a “ldd /usr/local/Aventail/AvConnect“. AvConnect depdends on /usr/lib/libssl.so.0.9.7, which is a symbolic link pointing to libssl.so.0.9.8. Likewise for libcrypto too.

Solution:

  1. Download OpenSSL 0.9.8i.
  2. Compile it, installation is not necessary.
    After compilation, it generates libssl.so and libcrypto.so.
  3. Unlink the original /usr/lib/libssl.so.0.9.7 and /usr/lib/libcrypto.so.0.9.7.
  4. Create symbolic links to the newly created libssl.so and libcrypto.so.

This is just a summary. The detail steps are documented at http://just-another.net/2008/11/20/ubuntu-intrepid-and-aventail-ssl-client/. When unlinking and creating links in /usr/lib, make sure you are doing it as root.

At the time of writing, the latest stable version of OpenSSL is 0.9.8l. It does not work. So you should stick to 0.9.8i! Version i works but not g and l. I guess something must be broken in the later build. Hope the OpenSSL team will retify the problem soon.

[Linux] Playing With Thinkpad Special Buttons

I am using a T60 laptop, the one without a fingerprint reader.  The 4 special buttons on the top left corner of the keyword are mute, volume up, volume down and ThinkVantage. The Window version came preinstalled with a program that displays a volume bar whenever any one of the volume controlling buttons is pressed. Unfortunately in a M$ dominated world, this program does not have a Linux version. There are applications that provide similar functionality, but I have decided to write a script myself.

Playing With Volume Buttons

ACPI (Advanced Configuration and Power Interface) is a wonderful standard, it makes programming devices easier. In Linux, information for some of the devices is made available in /proc/acpi/ibm/ folder. A simple cat /proc/acpi/ibm/volume tells you whether the speaker is muted, and the volume level (on a scale of 0 ~ 14).

I wrote the following script to display the volume level:

I used Python because I am not familar with Bash. I guess there may be 1-liner Bash commands that returns similar result. I am using CrunchBang distro, and it is preinstalled with Conky. I have added an entry to the Conky config file, and the volume information will be displayed on my desktop all the time.

Display volume using Conky

Display volume using Conky

Playing With ThinkVantage Button

After I am done with the volume buttons, I move on to ThinkVantage button. When I press the ThinkVantage button, I want to launch a Terminator terminal. With the help of xev, I discovered that the ThinkVantage button is binded to XF86Launch1. I added the following code to ~/.config/openbox/rc.xml config file.

Rubik Cubes For Geek

Just deleted another item in my wishlist. I gave a presentation at BarCampSingapore4 this morning. It was held at IDA Singapore (Suntec Tower 3). I contacted Preetam Rai on Thursday and ask for a slot to present, contacted Benson on Friday for help, created the slides on Friday night. It all happened within 72 hours, very last minute. Anyway I really have to thank Benson for this help.

I talked about Rubik’s cube, in a small meeting room. The room has about 10 chairs, but there were more then 10 people.The response was quite good :D . We planned to demo Fridrich and Lar Petrus method, but it wasn’t carried out due to time constraint. Some of them wanted a hands-on, I guess I can do that at the next barcamp. Anyway, these are the slides:

[Linux] Search File By Content

This is a short post, featuring a command to search file by content.

Update (2009-11-13): This is a better version from my cousin

Tags: , , , , ,

[PHP] Dynamically Modify URL Query String

I have to work with URL query string frequently. Often, I have to change and reconstruct the query portion based on certain rules. I wrote a function that takes in a URL string and an associative array, combines them and returns a new URL string. The resultant string can be used in <anchor> tags and also for HTTP GET request.

Usage example:

$url = 'http://www.example.com/index.php?id=123&name=orange#anchor';
$query1 = 'id=246&category=fruit shop';
$query2 = array('id'=>246, 'category'=>'fruit shop');
echo modifyQuery($url, $query1);
echo "<br />";
echo modifyQuery($url, $query2);

The $query parameter can be either a string or an associative array. In my usage example, both function calls return the same output.

NOTE: A valid URL string may contain username, password and port number. My function will not work with this information, but you can easily modify the function to retain these information. Have you noticed that the id has been changed from 123 to 246? The function’s $query parameter will appends+overwrites the query string.