Tuesday, October 30, 2007

Foxy tips

Here are some tips for Firefox which will make your browsing a little more snappier. For this you have to launch Firefox and type "about:config" in the addressbar which brings you to your personalized configuration list.

  1. Restore your session when you repoen your browser (not when crashed)
    1. browser.startup.page = 3
  2. Address bar auto completion
    1. browser.urlbar.autoFill = true
  3. Disabling IPv6
    1. network.dns.disableIPv6 = true
  4. Download only what your specifically click (by default Firefox downloads links which it thinks you want)
    1. network.prefetch-next = false
  5. Stop that RAM hogging
    1. RAM size 128MB - 512MB : browser.cache.memory.capacity = 5000
    2. RAM size 512MB - 1GB : browser.cache.memory.capacity = 15000
Those are some of the more interesting tips from "about:config".

Here's another extremely cool feature to have. It basically lets you create keywords for sites your frequently visit i.e. g for searching through google or wiki for searching through wikipedia and you can create as many as you wish. I've been using this feature for some time and I hope this benefits someone else out there. So here's how you do it (using google as an example).
  1. Right click on the search box.
  2. Click 'Add a keyword for this search'.
  3. Enter a Name, your desired keyword and a location for your bookmark.
  4. Click OK
And now you're done. Go to your address bar, type in the keyword with your search query and watch as the magic unfolds. Experiment with other sites and see how can make this wonderful feature suit your needs.

Stay foxy ;)...

Tuesday, October 23, 2007

DVD not mounting?

Ever had this scenario happen to you? Place a DVD in your DVD-ROM only for the OS to spew out "mount: wrong fs type, bad option, bad superblock on /dev/sr0,
missing codepage or other error
...
". Well it happened to me and after going through the logs and forums, I finally found a solution. Apparently my /etc/fstab left out the filesystem for the CD so I had to add it in and everything started working again. Sheesh...

Original
/dev/dvd1 /mnt/dvd1 udf ro,user,noauto,unhide 0 0

Modified
/dev/dvd1 /mnt/dvd1 udf,iso9660 ro,user,noauto,unhide 0 0


Hope this helps someone out there ;)

Saturday, October 20, 2007

Slow X applications over SSH

Just a quick tip for those tunneling X applications over SSH and you experience slow responsiveness (not because of slow lines) or get the an error similar to the following
"Gdk-WARNING **: Connection to display localhost:10.0 appears to be untrusted. Pointer and keyboard grabs and inter-client communication may not work as expected."

try this "ssh -2 -4 -C -Y user@host". This enables trusted X forwarding which removes the message above and speeds things up

From the SSH man page
"
-X Enables X11 forwarding. This can also be specified on a per-host basis in a configuration file.

X11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the
user's X authorization database) can access the local X11 display through the forwarded connection. An attacker may then be
able to perform activities such as keystroke monitoring.

For this reason, X11 forwarding is subjected to X11 SECURITY extension restrictions by default. Please refer to the ssh -Y
option and the ForwardX11Trusted directive in ssh_config(5) for more information.

-x Disables X11 forwarding.

-Y Enables trusted X11 forwarding. Trusted X11 forwardings are not subjected to the X11 SECURITY extension controls.

ssh may additionally obtain configuration data from a per-user configuration file and a system-wide configuration file. The
file format and configuration options are described in ssh_config(5).

"




Monday, October 15, 2007

FTP me

If you're looking for a good FTP client but don't want to install more programs, check out FireFTP, a Firefox plugin. It's great, small and efficient. After installing it, you can access it using Tools->FireFTP. Alternatively, you can add it to your toolbar by right-clicking on the toolbar, choose 'Customize' and drag the FireFTP button onto the toolbar. That's it :D. FTP away.

Sunday, October 14, 2007

Wiki on the go

Plenty of people are looking for a program that lets them keep notes on the go. And there are plenty of applications out there which can do this already i.e Tomboy. As for me, I was looking for something which had the following criterias:-
  • It had to be small.
  • It had to be accessible from any platform.
  • It has to fit on a usbdrive.

This led me to MoinMoin Desktop Edition (MMDE). Its basically a wiki but one that sits on your desktop (or thumbdrive once you get Portable Python). However, its overkill (a full wiki for personal use???) and it does have a slight learning curve. Scouted around some more and found this little darling, TiddlyWiki.

Its a personal wiki writting 100% using Javascript and HTML thus all you need to use it is a modern browser i.e. Firefox or Opera. Installation is as simple as right clicking on the download link and choosing "Save link as" to your preferred location. And that IS all there is to it Now launch your browser, open the file you just saved and you're ready to start keeping notes. You can now copy the file to your usbdrive and carry it with you wherever you go. Heck, there are some people who are using this to even create a personal websites (don't worry. Once hosted, the editing feature is disabled). Neat huh :D


Saturday, October 13, 2007

Blogs of fire

I was recently looking for a tool to help with my blogging. It gets tedious at times when you HAVE to login to the blog before jotting down the ideas and then publishing them. Tried a few of them but nothing worked out well for me until i stumbled onto a Firefox extension called ScribeFire. It supports blogger, WordPress, LiveJournal and even Windows Live Spaces. After installing it, i tried adding a single blog and everything simply worked fine. You can create and save your blog as a local copy making it easier to edit it later.

All posts done via ScribeFire adds a "Powered by ScribeFire" at the end. Some people don't mind the promotion, others do. I have nothing against free software wishing to promote itself but I also believe that people should be allowed to make the decision for themselves. For those wishing to remove the link (or change it to something else) here's the tip.


  1. Go to your firefox extensions folder.
  2. Open up "editor.js" using your favorite editor.
  3. Look for "performancingUI.insertPoweredByPFF" (or similar). This is where you can edit and add your own stuff or remove the entire line completely.
  4. Save and quit.
  5. Restart your browser for the changes to take effect.

Now that it's done, you can blog away from your browser wherever you are. Blog away my pretty...;)

Read em CHM files

Sometimes we "acquire" some e-books in CHM format and have some trouble opening them up in Linux boxes. This is not a problem in Windows (CHM is a MS format) as it comes with the tools to open it but us Linux (and BSD) users can't open it up by default. So, what do we use to view it? Well there are 2 options.
  1. Using GnoCHM
    • A decent viewer (for GNOME) to open .chm files directly. You can install it using
      • sudo apt-get install gnochm
  2. Using archmage
    • It basically decompiles the .chm file and stores the contents in a folder of your designation
    • To install it
      • sudo apt-get install archmage
    • To use it
      • archmage file.chm output_name

Happy reading :D


Saturday, October 06, 2007

Pretty GUI apps over SSH

I've been running some of my X applications i.e. scite, kdevelop, etc over SSH on my work pc for a long time now. Recently a friend of mine asked me how it was done so I decided to post it here for those looking for a similar solution.

First, make sure your SSH server has this option enabled "X11Forwarding yes" in your /etc/ssh/sshd_config file and then restart the SSH server.

On your client machine, establish a connection using "ssh -2 -4 -C -X user@server". This effectively tells your SSH client to connect to the SSH server using protocol version 2 running on IPv4 with compression enabled and to allow X forwarding.

Alternatively, you can create a .ssh/config file on the client and add the following options to it which gives the same result as above
Protocol 2
Compression yes
AddressFamily inet
ForwardX11 yes



And you're done. You can now run remote X programs on Linux or Windows (using cygwin).

NOTE: 1 possible error that you might encounter is "Gtk-WARNING **:cannot open display:". If this happens, execute your ssh command with the following "ssh -2 -4 -C -X -v user@server" and look at the debug output. If you see something similar to "debug1: Remote: No xauth program; cannot forward with spoofing." make sure you have xauth installed. If you do, delete your existing .Xauthority file, logout and login again. This will cause a new .Xauthority file to be created and hopefully it will solve the annoying error message above. Enjoy ;)

Thursday, September 20, 2007

SVN tips

Ok here are some more tips in addition to the earlier ones. Sometimes, you want to create a copy of an existing directory to another one before making significant changes. I know that's why we have SVN in the first place, to revert to last known working copy, but at times (especially when it involves looks) it can be quite tiresome. However, SVN will not add the copied directory as it considers it already under version control. Hmm..a tough one. Actually, its pretty easy. Here's how I did it :-
  • cd /path/to/project/copied directory
  • find ./ -name ".svn" | xargs rm -fr
Now the directory is no longer under version control. You can run "cd /path/to/project/;svn add * --force" to add the copied folder to the version control. Thats all folks :D

Wednesday, September 12, 2007

Safeguard your streams

Question:
If you wish to secure a connection from 1 service to another, what would you use?
a.) Why would I want to do that?
b.) Set up VPN.
c.) SSH tunneling.
d.) Stunnel.

Answer
a.) There is no such thing as being too paranoid.
b.) Ever heard the phrase "using a nuke to kill an ant"?
c.) Same as above by replace nuke with high explosive.
d.) BINGO!!

Stunnel is an application which wraps your normal connection over SSL/TLS to make sure no one can eavesdrop on your connection. This is particularly useful when you wish to secure your mail (SMTP, POP3) or securing your SVN server (heh, its what I am using it for:P). Its main benefits is that its extremely easy to set up (within 5 minutes) and it
only establishes a connection when needed, and not
maintain its secure tunnel perpetually, which eats up
your bandwidth unnecessarily.

This is my instruction on setting it up (for Ubuntu) on the server (svn as an example). Feel free to change the location and/or configuration to suit your needs.

  • sudo apt-get install stunnel
  • mkdir -p /home/shinning/secure_services/pid
  • mkdir -p /home/shinning/secure_services/service
  • cd /home/shinning/secure_services/
  • [create server cert] - openssl req -new -days 365 -nodes -out newreq.pem -keyout stunnel.pem
  • vi /home/shinning/secure_services/service/svn.sh
  • stunnel -P /home/shinning/secure -p /home/shinning/secure_services/stunnel.pem -d 4000 -r localhost:3690

And that it. Your SVN server is now running securely on top of SSL/TLS making it hard for anyone to sniff your traffic. You can also make your client authenticate itself against your server if you want to by following this guide. There are also tonnes of other examples here. Happy securing ;)

Monday, September 10, 2007

Fortune, meet planning

"Good fortune is what happens when opportunity meets with planning - Thomas Alva Edison"

The above saying is SOO true. How many times have we had the oppurtunity to do big things, but we failed because we didn't have a proper plan. And NO, I'm not talking about a bid to take over the world. Unless that's your plan of course, then I ain't gonna stop you. Perhaps the following tool can help you list out the things you have to do and set a timeline for it :P

The tool I'm talking about is called Planner which exists for both Linux and Windows. Think MS Project, but cross platform. Having never used MS Project before, its hard for me to say what are its limitations. However, its been really useful to me so far and far easier to use than some other project management software i.e. TaskJuggler.

For those using Linux, you can probably find it in your repository. In Ubuntu "sudo apt-get install planner" is sufficient to download and install this nifty software. Happy planning :D

Some screenshots are below for your viewing pleasure
Task allocation


Resource allocation and usage


GANTT chart

Saturday, September 08, 2007

My first version control

Ok, now we've got our versioning control server up and running. Now what? Now we start using it. I'll list the more basic command/uses here using the CLI. If you like, you can check out some other documentation on SVN.

  • Creating a repository
    • Log in to svn_srv
    • svnadmin create --fs-type fsfs /path/to/svn/repository_name
    • chgrp -R svn /path/to/svn/repository_name
    • cdmod -R 770 /path/to/svn/repository_name
    • cd /path/to/svn/repository_name/conf
    • Edit the svnserve.confauthz and passwd file appropriately if you wish to disallow anonymous access and only allow authorized users to access your repository (recommended).

  • Importing an existing project to the above created repository
    • svn import /path/of/existing/project/folder svn://svn_srv/repository_name --username user_in_authz_file -m "Log message"

  • Downloading a fresh copy of the repository
    • svn checkout svn://svn_srv/repository_name /destination --username user_in_authz_file

  • Sync-ing a local copy with the changes in the repository
    • svn update --username user_in_authz_file  [-r revision_we_want_to_sync_with]

  • Show exact changes in files which have changed from repository and your local copy
    • svn diff --username user_in_authz_file [-r revision_we_want_to_compare_with]

  • Show things which have changed on your local copy and the repository
    • svn status -u

  • Adding new files to be added to the version control (recursively adds files and folders)
    • svn add * --force

  • Merging changes from two sources to the current copy
    • svn merge --username user_in_authz_file --no-auth-cache -r revision_to_merge_to:revision_to_merge_from /path/to/changed/copy
    • svn merge --username user_in_authz_file --no-auth-cache  URL@revision_1 URL@revision_2 /working/copy/path

  • Deleting a file from the local copy or in the repository
    • svn delete svn://svn_srv/repository_name/file
    • svn delete path/to/file
  • Undo all local changes (does not work with removed directories)
    • svn revert --recursive
    • svn revert path/to/file
  • Commit your changes to the repository
    • svn commit


By no means is the above a complete list of options or things you can do with SVN. Read the documentation and try it out for yourself to see the power of this tool.Or, if all this looks too complicated, we could use a GUI for it. Some of the are listed below :-

So many versions, so much confusion

How many times have you worked on a project or document only to
accidentally delete a critical file, made a modification and wished you
had the original copy, or simply keep track of all the changes to your
project. The most common way is to create an exact copy before doing any changes. It works, but it takes up unnecessary space and unless you keep a good listing of your changes, you'll be scratching your head wondering where to begin.

Obviously there is a solution for this, otherwise it'd be pointless to
write this entry now wouldn't it:P The solution is pretty simple
actually. Install a version control software :D And yes it IS easy to
set up as it sounds. It's the using it that's slightly confusing, but
I'll address it in a later post. For those who don't know what version
control is, check out this Wikipedia article.

This HOW-TO is based on thw howto from this site. I DO NOT take credit for this work and I'd like to express my appreciation to all the people who made ubuntuguide.org possible. I'll be using the client/server version for this guide. It is also possible to set one up to be accessible via web but I'm not going to touch it here. The HOW-TO for that is already available.

On Ubuntu (regardless of version), follow the following step-by-step to
get your version control software up and running :-
  1. Install the necessary software needed.

    • sudo apt-get install subversion subversion-tools xinetd

  2. Create a user and group that will be have read/write access to the repository directory.

    • sudo adduser --system --no-create-home --home /var/svn --group --disabled-login svn

  3. Create the directory where the repositories will reside (your projects/documents)

    • mkdir /opt/svn
    • chown -R svn:svn /opt/svn

  4. Lets make the software listen on its own connection port.

    1. vi /etc/xinetd.conf/svnserve

      • add the following to the above file

      • service svn
        {
        port = 3690
        socket_type = stream
        protocol = tcp
        wait = no
        user = svn
        server = /usr/bin/svnserve
        server_args = -i -r /var/svn
        }
      • quit and save the contents. This makes our svn server listen to TCP connections on port 3690.

    2. vi /etc/services

      • Check if there is an entry similar to "svn 3690/tcp subversion # Subversion protocol". If you changed the port to something else, make the changes appropriately.
      • If it doesn't exist, add it in, otherwise just quit.
      • Note : If the above entry doesn't exist in /etc/services, the svn will not start.

    3. /etc/init.d/xinetd restart

    4. Check if our svn server is now listening on our
      designated port.

      • netstat -tuanp | grep 3690

And that's all there is to it. Now you have your very own version
control software ready to use. My next post will cover creating and
managing your repository.

I'm also thinking on how to make this also useful for incremental backups. Until then, stay sharp and lets support Open/Free software :D.

Rise of the Star

Gosh. It's been more than a YEAR since I last blogged. Damn where DOES the time go. Been caught up in some projects and getting distracted here and there ;) Well lets see how long I can keep this blogging thing again before I get lazy :P

P/S : I will also try to answer any questions or comments posted from now on. I apologize for the comments which have not been answered earlier.