Nifty tidbits

Nifty tidbits and random thoughts on technology and anything else that catches my fancy

Archive for the 'Linux' Category


Compact Ubuntu

Posted by Raghu on June 23, 2008

I’ve always hated the fact that on Ubuntu with the default themes, there’s far too much space wasted. The buttons are too tall, the treeview wastes too much space so that if you’re on eclipse or some other ide, you see a precious few items on the screen.

I’ve been trying to tweak it to no end - even looking to see if there are any ~/.gtkrc-2.0 tweaks. Found a few links such as this Making Eclipse look good on Linux - Max’s blog - however, didn’t really satisfy my need.

And so it stayed until today when I came across Clearlooks Compact Gnome Theme.

I love it - one more for my list of must-haves!

Posted in IDE, Linux, Rant, Tips, Troubleshooting, Utilities | Tagged: , , , , | No Comments »

VPN into Windows VPN Server from Ubuntu Hardy

Posted by Raghu on June 12, 2008

Ok - this was easy - and while there’s some resources on google, I had to figure out a few itty bitty things for my work VPN setup.

install

  • network-manager-pptp
  • pptp-linux

Restart network manager with

killall nm-applet
sudo /etc/init.d/dbus restart
nm-applet –sm-disable &

Configure VPN settings

Click on the network manager applet and click on VPN connections

  1. Create a new VPN connection
  2. Ensure that you select Refuse CHAP  in the authentication tab.
  3. In the routing tab, you can give netmasks that need to go through VPN - for my work network, I have: 10.10.5.0/24 172.16.106.0/24

That’s it. Now click on the Network applet, and connect to your VPN. In the authentication dialog, use <domain>\username and your windows domain password.

Posted in Linux, Tips, Tools, Utilities | No Comments »

Hardy heron - first impressions

Posted by Raghu on March 31, 2008

He he :-) - finally got Ubuntu Hardy heron beta on my home and work laptop. first impressions below:

1. Wubi install from within windows is easy and works great. If after setting up so many boxes, I can go on and on about it, I’m sure that its great help for anyone who’s on Windoze. I mean, the barrier to entry has never gone down so much.

2. I guess once you’ve installed via Wubi and configured your system to your liking, you can uninstall and take an image that you finall install to a dedicated partition - isn’t that just awesome.

3. Comes installed with Firefox 3b4 -which is awesome. Given that FF crashes badly on yahoo, this might be a bummer for many people. Should probably have some first time customization that will let you install Opera.

4. Installation is super fast - took about 10 mins for wubi to install, reboot once, finish installation and reboot again. Grub default to Last selected would probably be a better idea.

The not so good

1. Wifi doesnt work out of the box - didn’t on my Dell Inspiron 1501 or the Dell Latitude D620. Its the ye olde broadcom problem. This is really the BIGGEST turn off. Hope it will get fixed by the time the final release is out. Meanwhile, had to jump through hoops getting ndiswrapper in. I didn’t go the broadcom fwcutter way since that only allows a 802.11b connection from what I read. I’m still not sure what fixed the issue - irrespective, I had to update the system and then things started working like a charm.

2. Compiz configuration isnt installed by default. If this is your first time on Ubuntu and you’ve come this way to see the awesome 3D desktop, then this is a bummer. Finding out what you need to do is a pain too.

I think that’s all there is to it. Its great once wifi starts working normally.

Posted in Linux, Tips, Troubleshooting | No Comments »

Gnuplot, dstat - easy graphing on Linux

Posted by Raghu on March 28, 2008

Recently, started fiddling around with how to monitor and graph performance data on linux boxes. Other than the usual tools like top and vmstat, which are either interactive (top) or too textual to do anything much.

First off, vmstat, doesnt lend itself well to graphing without additional scripts to lay out the data so tools like gnuplot can be used. Secondly, and more seriously, it doesn’t include a timestamp in the output.

Looking around a bit found that dstat seems to be a good replacement to vmstat (and iostat) - and the generated data is consumable with gnuplot.

Here’s a quick example of generating graphs for CPU user, system and idle times

dstat -tc 5 500 > dstat.raw

now fire up gnuplot and go ahead and plot it

gnuplot> set xdata time gnuplot> set timefmt "%s" gnuplot> set format x "%M:%S" gnuplot> plot "dstat.raw" using 1:2 title "User" with lines, "dstat.raw" using 1:3 title "Sys" with lines, "dstat.raw" using 1:4 title "Idle" using lines

To make gnuplot generat an output file, you need

gnuplot> set term png

gnuplot> set output “dstat.png”

gnuplot> replot

dstat png - User, system and Idle times

And you’re done. here’s the graph generated on my machine. There’s loads more that you can do - and admittedly, you can do everything by dumping your file to excel. However, that doesn’t lend itself well to a completely automated process. When you’re doing performance testing and such like, you will likely repeat this enough number of times. Not having to do it manually helps big time!

Posted in Cygwin, HOWTO, Linux, Tips, Tools, Utilities | 1 Comment »

HOWTO: Access your machine from the internet without a static IP

Posted by Raghu on January 10, 2008

For machines to be accessible on the internet, usually you need a static IP that’s leased from your ISP so that when someone types in your IP address, so that packets can be routed over to your machine. However, getting a static ip is costly and for the most part, internet users have dynamic IP address that the ISP allocates each time an end user connects to the internet. Since the ip address keeps changing on each connection, there’s no straightforward way to connect to the machine without knowing the IP address that’s been allocated - or so it was at least till Dynamic DNS came along (it isnt new - has been around for ages, but for some reason isn’t that well known)

Typically, when you type in www.google.com in your browser, your machine performs a DNS (Domain name service) lookup with the DNS servers from your ISP to find out the IP address corresponding to www.google.com. With DDNS (dynamic DNS) this is made to work with your dynamically allocated IP address also. Here’s how it works

  1. Register with a DDNS service provider. Service provider provide free accounts for personal use - go to www.dyndns.org
  2. Once you’ve created your account, go ahead and set up your hostname. DDNS service providers will have some domains that you can choose from and you get to choose the host part. For a fee, you can also use a domain name of your choice.
  3. If your set up has a router at your end, check your router administration page if it supports dynamic DNS. If it does, you need to enter the hostname, account and password. Everytime your router connects to the internet, it sends an update notification to the DDNS service notifying the new IP obtained from your ISP. The DDNS service takes care of sending update notifications to routers on the internet.
  4. If you dont have a router, then download the DDNS client software from the service provider. Most DDNS providers have windows, mac and linux clients. These run on your machine and do the same thing - notify the DDNS service provider of your new IP whenever you establish a connection with your ISP.
  5. If you’ve got all this set up, then you can reach your machine from the net - try ping <your host name>

If you’re running Linux/Ubuntu, make sure your’re running SSH service and try ssh <your host name>. If you have a router setup, then you will need an additional step - basically the DDNS name refers to your router IP - and not the machine behind the router that you wish to reach. You will also need to make sure that your machine has a static IP from your router. To set up your router, go to your router administration page.

  1. Go to the LAN section and give a range of IPs outside of the static IP. Most routers have lan addresses like 192.168.x.y - 192.168.x.z. If you want your host to have an IP address of 192.168.1.100, then give a LAN range that does not include this IP - say 192.168.1.110 - 192.168.1.200.
  2. Save and reboot your router.
  3. Now go to your network settings and enter your static IP (192.168.1.100), netmask 255.255.255.255, gateway (usually 192.168.1.1).
  4. Go to your router administration page and look for a section like virtual server - your router will allow you to forward packets received on a particular port to a host and port within your LAN. You will have to enter the external port (we’ll use 22), the internal machine to forward (192.168.1.100) and the port to forward to (22). With this in place, any packets received on port 22 (ssh) on your router will be forwarded to the 192.168.1.100 machine on the ssh port.
  5. Save and reboot your router.
  6. Give it a spin.

From a different machine (or from the same one -doesnt matter), try out ssh <your host> and you should be able to login to your machine - via the internet.

Posted in HOWTO, Linux, Tips | Tagged: , , | No Comments »

Building a FC6 server for Java development

Posted by Raghu on May 3, 2007

It has come upon me to build a FC6 server with a Java build environment that is going to serve as the build machine. This is the first time I’m coming to Fedora - always having used Debian in the past.

  1. OS installation was smooth. I installed with KDE since some folks prefer the GUI.
  2. During the installation, I chose Java Development - and all the gcj components got installed. Then post installation, I downloaded JDK from Sun and installed it too. The (gcj) tomcat of course didnt work very well in this mess. Fixing it was easy - just fired up yum via Add or Remove Programs and removed gcj - which removed all the other gcj tools and libraries too.
  3. Setting the host name - unexpectedly, had trouble doing this - finally used system-config-network.
  4. Environment variables - again a little digging around to figure out how to set environment variables so that they are effective for all users on the system - essentially JAVA_HOME, JRE_HOME, CATALINA_HOME, MAVEN_HOME etc. Finally found that this is best set in /etc/environment where it works for all users.
  5. Downloaded java tools and libraries - housed tomcat and maven under /usr/lib/java/maven-xxx and /usr/lib/java/apache-tomcat-x.xx and created symlinks. Placed symlinks to tomcat’s startup.sh and shutdown.sh in /usr/bin. Placing a symlink to maven doesnt work - but an alias works as well. To make it work for all users, simply put it in /etc/profile

    alias maven=/usr/lib/java/maven/bin/maven

  6. Created a group java and added users to the group. Set permissions on the maven installation folder so that java group has write access (this is so that maven plugin:download for additional plugins works properly and can write to the maven plugins folder)

That’s all there is to it. Just make sure that you do everything as the ‘application’ user - dont do it with your account or the root account.

Posted in Linux, Tips | No Comments »