BlueProximity

BlueProximity is a cool GNOME application that detects the proximity to a Bluetooth device to determine whether the user is in proximity. If the user is way the screen will be locked (or any command be run), when the user is in proximity the screen will be unlocked (or any command be run).

However if the screen is manually locked it will not be unlocked because the Bluetooth device is in proximity. Should the screen be locked because the Bluetooth device is away, you can manually unlock the screen.

Blueproximity allows you to secure your machine while not going through the inconvenience of locking the screen when you are leaving the machine and then unlocking it when you are back. BlueProximity, Leave it – it’s locked, come back – it’s back too…

Using Nokia N70 to connect to internet with Ubuntu 8.04

Recently I bought a Nokia N70 Music Edition. It was mainly for internet on the go; to check mail, browse the net, receive and make VOIP calls. Just to see whether it would work, I tried to connect to internet via 3G using the N70. To much to my delight I was successfully connected to internet without any issues using the GNOME network applet/admin. I have a Dialog Broadband connection, and download speeds were in the range of 25KB/s-40KB/s, pretty good on WCDMA 2100. Best part of all was that I didn’t have to touch the command line. So all not so technically inclined folks can make it work as well without glitches.

Bellow you will find the steps. Please make sure you can browse the net with the phone to make sure you are in a service area ;).

Step 1

Connect the phone to the PC. I used USB but Bluetooth is reported to be working on Ubuntu 8.04 as well.

Step 2

Start the network admin application (System -> Administration -> Network), you’ll have to unlock it if you are not root (most likely you are not).

Step 3

Select “Point to point connection” and open up the properties.

Step 4

In the General tab make the following changes. Check/select “Enable this connection”. Select GPRS/UMTS as the Connection type. Set the Access point name to what’s provided by your service provider (In my case it was www.dialogsl.com). Under account data put your username and password provided by your service provider if any.

Step 5

In the modem tab select/type in the correct modem port, in my case it was /dev/ttyACM0. If it doesn’t work for you, plug the phone usb cable while monitoring /var/log/messages, you can see where the phone is being mounted.

Step 6

Save the settings by pressing Ok, then activate the connection by checking the check box against “Point to point connection”.

That’s it, now you should be connected to the internet via 3G if there is coverage in your area or else via GPRS. Hope you will find this post helpful.

Epiphany Anti-Phishing extension

I’m happy to announce the release of safe-browsing 0.0.1 for Epiphany, the GNOME Web browser. It will try match the url you are trying to access with the Google Safe Browsing black list of urls. If it is a match the view pane will be disabled such that the user can only view the page but not interact. The user will be free to browse away from the page by typing a new url. The extension will also add a indicator to the browser status bar. In the next relase an error page will be displayed instead of even displaying the evil page.

You can also report phishing sites by clicking Help -> Report Web Forgery…

You can download the extension safe-browsing-0.0.1.tar.gz

Follow the steps bellow to install the extensionn. I’m assuming you have already installed epiphany and epiphany-extensions.

Step 1 – Download the extension archive

 $ wget http://www.mohanjith.net/downloads/gnome/epiphany/extensions/safe-browsing/safe-browsing-0.0.1.tar.gz

Step 2 – Extract the extension archive to epiphany extensions directory

 $ cd /usr/lib/epiphany/2.20/extensions/ $ tar -xzvf [Location_to_archive] .

Step 3 – Restart epiphany and enable Safe browsing extension

Goto Tools -> Extensions and then select the check box against Safe browsing.

Step 4 – Goto a phishing site

Goto a phishing page, e.g. http://202.168.224.161/c.html at the time of posting.

Hope this extension will make your browsing experience safer.

GNOME Web browser Creative Commons extension

I’m happy to announce the release of cc-license-viewer 1.1.0 for Epiphany, the GNOME Web browser. It is capable of detecting Creative Commons licensed web pages either with rdf meta data or with the license badge from creativecomons.org and displaying an icon on the status bar.

This is a modified version of cc-license-viewer released by Jaime Frutos Morales. Jaime Frutos Morales extension is not capable of detecting web pages with the Creative Commons license badge.

You can download the extension cc-license-viewer-1.1.0.tar.gz

Follow the steps bellow to install the extensionn. I’m assuming you have already installed epiphany and epiphany-extensions.

Step 1 – Download the extension archive

 $ wget http://www.mohanjith.net/downloads/gnome/epiphany/extensions/cc-license-viewer/cc-license-viewer-1.1.0.tar.gz

Step 2 – Extract the extension archive to epiphany extensions directory

 $ cd /usr/lib/epiphany/2.20/extensions/ $ tar -xzvf [Location_to_archive] .

Step 3 – Restart epiphany and enable CC extension

Goto Tools -> Extensions and then select the check box against Creative Commons license viewer.

Step 4 – Goto Creative Commons page

Goto a CC licensed page, e.g. http://creativecommons.org

My next plan would be to extend the functionality of this extension such that more informative icon is shown at the status bar. For the time beign have fun with this extension.

The Google Highly Open Participation Contest

Following on from the success of the Google Summer of Code program, Google is pleased to announce a new effort to get young people involved in open source development. Google has teamed up with the open source projects such as Apache Software Foundation, Drupal, GNOME, Joomla!, MoinMoin, Mono, Moodle, Plone, Python, and SilverStripe to give student contestants the opportunity to learn more about and contribute to all aspects of open source software development, from writing code and documentation to preparing training materials and conducting user experience research.

If you’re a student age 13 or older who has not yet begun university studies, you could help out these projects. In return, you’ll learn more about all aspects of developing software – not just programming – and you’ll be eligible to win cash prizes and the all important t-shirt! You will, of course, need your parent or guardian’s permission to participate where applicable.

To Read more and take part go to http://code.google.com/opensource/ghop/2007-8/.

If you have already begun university studies like me you could always spread the word 🙂

Using GNOME remotely via SSH

Have you ever wished that you had a GUI on a remote Linux server without using VNC? Actually you can use GNOME or any other GDM on a remote server via SSH, yep I’m not joking.

You need to have SSH and X11 running on both the client and the server. In addition on the server GNOME should be installed and SSH daemon should be running.

Step 1 – Turn on X11 forwarding on the server:

Add the following if it doesn’t exist or just change no to yes in /etc/ssh/ssh_config and save it.

ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes

Add the following if it doesn’t exist or just change to yes in /etc/ssh/sshd_config and save it.

X11Forwarding yes

Step 2 – Connect to the remote server viw SSH with X11 forwarding

In order to enable X11 forwarding when you connect to a remote server via SSH you need to provide the commandline option -X. See the example bellow.

 $ ssh -X username@server

Step 3 – Start GNOME Session

You need to start the GNOME session for the GUI to show. By default GNOME session is not started for remote connections. It might take a while for any change to appear, you should notice GNOME startup sequence appearing in the client and couple of messages in your terminal.

However I do not recommend running X11 or GNOME on a production server, but this should be handy if you want to connect to your home computer from office for example.

Blogging from the GNOME blog

It feels really good to blog from the desktop it self. I used to dought that some of my friends were saying the world is moving to the desktop from the web. Now I see the truth.

To make this post I’m using GNOME Blog (gnome-blog), it is a simple desktop client which supports multiple blogging platforms including Blogger, Livejournal, MovableType and WordPress.

Main advantage of a blogging client is that you don’t have to click through a bunch of links and wait for a slow WYSIWYG editor to load.

If you are using Ubuntu just run:

$ sudo apt-get install gnome-blog

See the magic!

Edit:
Used blogger to edit the post to insert the <pre> tags

Adding color to subversion

If you love the command line and svn but would like to add some color as well, you could try colorsvn.
colorsvn is identical to svn when it comes to commands, but the results are shown in color.

colorsvn is particularly handy if there are any conflicts created during an update.

See http://colorsvn.tigris.org/ for more.

svnserve Init script

I was annoyed to have to start the svnserve as a daemon everytime I restarted the machine. I also wanted to use service configuration(GNOME) to deal with the service.

I looked all over the web and failed to find the a good one. So I thought of writing it my self. Last weekend I sat down and wrote the script. Here is the result.

This was tested on fc6 running kernel 2.6.20-1.2962.fc6. Subversion 1.4.2 (subversion-1.4.2-2.fc6). It should work in any distro with init.

To make service configuration aware of svn serve you will have to first copy the script to /etc/init.d and then run the following.

$ /sbin/chkconfig ---add svnserve

Also remember to create the configuration(/etc/sysconfig/subversion) file with the following lines in it to enable threading.

OPTIONS="--threads"

You can put any options you could send to svnserve in the configuration file.

PS: here is the Init script it self for your viewing before downloading

#!/bin/bash
#
# /etc/rc.d/init.d/subversion
#
# Starts the Subversion Daemon
#
# chkconfig: 2345 90 10
# description: Subversion Daemon
# processname: svnserve
# pidfile: /var/lock/subsys/svnserve

source /etc/rc.d/init.d/functions

[ -x /usr/bin/svnserve ] || exit 1

### Default variables
SYSCONFIG="/etc/sysconfig/subversion"

### Read configuration
[ -r "$SYSCONFIG" ] && source "$SYSCONFIG"

RETVAL=0
prog="svnserve"
desc="Subversion Daemon"
pidfile="/var/run/$prog.pid"

start() {
echo -n $"Starting $desc ($prog): "
daemon $prog -d $OPTIONS --pid-file $pidfile
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
touch /var/lock/subsys/$prog
fi
echo
}

obtainpid() {
pidstr=`pgrep $prog`
pidcount=`awk -v name="$pidstr" 'BEGIN{split(name,a," "); print length(a)}'`
if [ ! -r "$pidfile" ] &&amp;amp; [ $pidcount -ge 2 ]; then
pid=`awk -v name="$pidstr" 'BEGIN{split(name,a," "); print a[1]}'`
echo $prog is already running and it was not started by the init script.
fi
}

stop() {
echo -n $"Shutting down $desc ($prog): "
if [ -r "$pidfile" ]; then
pid=`cat $pidfile`
kill -s 3 $pid
RETVAL=$?
else
RETVAL=1
fi
[ $RETVAL -eq 0 ] && success || failure
echo
if [ $RETVAL -eq 0 ]; then
rm -f /var/lock/subsys/$prog
rm -f $pidfile
fi
return $RETVAL
}

restart() {
stop
start
}

forcestop() {
echo -n $"Shutting down $desc ($prog): "

kill -s 3 $pid
RETVAL=$?
[ $RETVAL -eq 0 ] && success || failure
echo
if [ $RETVAL -eq 0 ]; then
rm -f /var/lock/subsys/$prog
rm -f $pidfile
fi

return $RETVAL
}

status() {
if [ -r "$pidfile" ]; then
pid=`cat $pidfile`
fi
if [ $pid ]; then
echo "$prog (pid $pid) is running..."
else
echo "$prog is stopped"
fi
}

obtainpid

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
RETVAL=$?
;;
condrestart)
[ -e /var/lock/subsys/$prog ] && restart
RETVAL=$?
;;
status)
status
;;
forcestop)
forcestop
;;
*)
echo $"Usage: $0 {start|stop|forcestop|restart|condrestart|status}"
RETVAL=1
esac

exit $RETVAL