Archive for the ‘Linux’ Category

Motersho’s GeoIP Lookup

I got bored the other day and decided that I wanted a page that I could query via a bash script and it would tell me my public IP address. Yes I know there are plenty of site that have this but I wanted my own.

Here is the lookup page: http://motersho.com/blog/index.php/geoip-lookup/

Well that idea then manifested itself to a place where I can get City, State, Country and Longitude/Latititude coordiates of that IP address. So, I wrote two pages one that uses the MaxMind API and thier Free IP to City database and the other uses HostIP’s API and their database to do Geo lookups and using the Google Maps API for maping that location.

The HostIP database is not as complete as the as MaxMind‘s so they as that if you come across an unknown address you help them out by updating that info. Please help them out.

My site still has the ability to to just return your public IP address for scripting, you just have to pass it the correct parameter.

For scripting: http://motersho.com/ip/?o

Here is the code to return you public IP in a bash script

curl http://motersho.com/ip/?o

Leave me a comment if you use this site in a script or if you have found it useful in any other way.

How To: Speed Up OpenOffice in Linux and Windows

Have you made the switch from Microsoft Office to Openoffice but are really annoyed with how long it takes to open even the smallest of documents?  Well here is a quick hack that you can do to decrease the time that it takes for OpenOffice to launch.

Step 1:
Launch any Open Office application.  In this example I will be using Writer

Step 2:
Click On Tools.
Then click Options

Step 3:
Under OpenOffice.org; click on Java
Then Uncheck Use Java runtime environment
And then Click OK


Evolution is Finally Useful

I have been using Evolution on and off for many years because of its ability to connect to Microsoft Exchange severs.  But I typically will use it for a few weeks only to get pissed off because of random crashes or lockups and go back to using Outlook in a Virtual Machine.  Even though Ubuntu 10.04 was released with Gnome 2.30 it held back the Evolution release to 2.28.  Stupid move IMHO but lucky I have told you all how to update to the latest release.

Well have been using the 2.30 release for several days on my work laptop connected to Exchange 2007 and as the title of this post says, It Finally Useful!  I have not had any lock ups or slow downs.  I did have an issue with it downloading all of my message headers from my inbox but I have over 5500 emails in there so I don’t blame Evolution.  I have since decided to have it download the full emails so that I can use it offline and that seems to have helped.  Also after a rocky start with the Exchange MAPI connector in Evolution 2.28, in 2.30 it works like a charm.  I can send and recieve email, add events to my calendar and query email address in Active Direcory with no issue.

Kudos Evolution Developers!

Update: (2007-7-26)
Looks like I spoke a little too soon.  It seems that Evolution will not send emails periodically.  I haven’t been able to pin point what the cause is but as soon as I do I will be filing a but report.

Review: KDE 4.5 beta on my Asus netbook

I have an Asus 1005ha netbook running Ubuntu 10.04 and last night I decided to install the lasted beta version of KDE 4.5 from the Kubnutu Experimental PPA on it.  The upgrade was very smooth but then again apt-get installs rarely fails or cause headaches.

Here  are the issues that I have come across.

1) KDM will show the login screen but will not login to either KDE or Gnome.  When you do login you are just presented with a terminal, thats it.  Kinda reminded me of the old days.  I haven’t really looked in to this issue because I just when back to using GDM instead.  I will have to tackle this here in the coming nights.

2) The process called virtuoso-t consumes way to much processor.  Some where in the neighborhood of 50-80%.  Whats worse is that after some Google searches it seems that this is a carry over issue from 4.4x series.  I really hope this gets fixed.  I was able to kill that process and then the processor drop to consuming a normal 3% or less.

3) Tweetdeck.  Yes I realize that this is not a KDE issue, but for some reason when I opened Tweetdeck there is an extra small blank windows that opens in the top left corner.  This windows also takes a place in the task bar, which might not seem like a big deal except that I am running a netbook and screen real estate is expensive.  I am still looking in to this.  Also Tweetdeck consumes way more CPU with KDE than Gnome so for the time being I switched to Gwibber to tweet with.

4) I love the transparent start menu and systray pop-ups but if you have a white window open behind them they are almost impossible to read.  This is an easy fix with them changes or modifications.

As for KDE itself.  I think after 5 revisions of the KDE 4 series I am finally drawn back to KDE.  Thank goodness because I felt like such a trader after using KDE since 1.0.  The desktop effects are awesome and very smooth even on my netbook.  I don’t want to say who is copying who but I have been using Windows 7 at work and some of the KDE effects are very similar to it.  For example being able to drag the window to the side of the screen to tile or maximize it or as you hover your mouse over the application title along the task bar it pops up a small window displaying that application.  But KDE has added many other windows effects goodies that blow Windows’ Win-Tab effect away.

There are many other little fixes and goodies stashed throughout this release.  I highly recommend this version of KDE once it is released in a few weeks and hopefully it will not disappoint you and will draw you back to the KDE project.

How To: Install KDE 4.5 beta on kubuntu 10.04

Open up a terminal session and type the following:

 sudo apt-add-repository ppa:kubuntu-ppa/beta
 sudo apt-get update
 sudo apt-get dist-upgrade

Remember this is KDE 4.5 BETA. Do NOT do this on a production system.

Check Gmail From the Command Line

Gmail provides the ability to view your new/unread email as an ATOM feed via https://mail.google.com/mail/feed/atom.  With cURL and some Perl we can check gmail from the Linux command line.

Just change the email address to your email address and when your hit enter you will be prompted for your gmail password.

#!/bin/bash
curl -u motersho@gmail.com --silent "https://mail.google.com/mail/feed/atom" |
 perl -ne \
  '
    print "SUBJECT: $1 \n" if /<title>(.+?)<\/title>/;
    print "RECEIVED $1 \n" if /<issued>(.+?)<\/issued>/;
    print "FROM: $1 " if /<name>(.+?)<\/name>/;
    print "($1)\n\n" if /<email>(.+?)<\/email>/;
  '