Basket : Note taker for linux

Basket is a note taking application for KDE. It is available for ubuntu also. It has a lot of features compared to other note taking applications.

Following are some of of it.
  • Add note at any location of the page.
  • Grab screen shots
  • Drag note entries
  • Tag each note entry (shortcuts are available for this)
    • important
    • todo lists
    • links
    • idea,information,personal
  • Collapse lists
  • Create links to files and urls
  • Export
For more details visit http://basket.kde.org/

Minimize firefox to system tray

It is desirable to minimize applications to system tray rather than messing up the task bar. In Linux many applications has its own extension to get minimized to system tray.

Browsers are application which is needed all the time. We would have at least some web pages opened in it if we are in a work. Opera has its extension to minimize to system tray, along with. For Firefox you have to add the extension (add on) FireTray (in linux). It will show a firefox icon in the system tray whenever firefox is opened. To minimize the browser, just click on that icon. To restore, click on the same icon.

Set up transparent proxy with Squid

Proxy server is as an intermediate for a machine(client) to connect to another machine or network. All outside connections of the client can be done by the proxy server. Proxy server can be used for setting firewall in a network.

Other than just forwarding requests from client, proxy servers can cache some data(web pages,DNS,network lookups) it has already retrieved. Such proxies are called caching proxy. The proxies which does not change the packets other than just forwarding it is called transparent proxy.

Squid is a free and open source web proxy server. Quick steps for setting up a transparent proxy server is given below.
  • Install squid
  • hash@ssl50:~$ sudo apt-get install squid squid-common
  • Configure /etc/squid/squid.conf
  • Squid configurations uses acl. To allow local machines to connect to it you have to add access right to localnet The file contain an acl called localnet representing the local network..
    acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
    acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
    acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
    You may change it or add your own network along with it. You can also see
    # http_access allow localnet
    Uncomment it. If the line is not there just add it.
    Note down the http_port given in config file. Usually it is set to 3128. You may change it. This is the port number to which clients has to connect to for using the proxy server.
  • Restart squid
  • hash@ssl50:~$ /etc/init.d/squid restart
Authentication can be enabled in squid. Timed firewalls can be set using Squid. Squid also permits to add our own scripts for managing things. For more details , visithttp://www.squid-cache.org/


How to samba : Windows shares in linux

Samba is a free software implementation of network file sharing application protocol (SMB/CIFS) of windows. It allows sharing of files, parallel port devices, printers in a network.

Some examples for using samba is given below.
  • Add a share

    • Edit the file /etc/samba.smb and append the following (modify according to your requirements)
      [Programs]
      path = /home/hash/Programs
      valid users = hash
      read only = no
      create mask = 0777
      directory mask = 0777
      [Collection]
      path = /home/hash/Store
      guest ok = yes
      read only = no

    • Restart samba server
      hash@ssl50:~$ sudo /etc/init.d/samba restart
      * Stopping Samba daemons
      * Starting Samba daemons


  • Adding a user
    • Adding the user hanoosh
      hash@ssl50:~$ sudo smbpasswd -a hanoosh
      New SMB password:
      Retype new SMB password:
      Added user hanoosh



Set Gmail as your default email client in Firefox 3

I don't have any mail clients configured. I used to get difficulties in sending mail by clicking mailto links. There is a solution in firefox 3 for gmail ( originally posted in lifehacker). Check it out


Official Gmail Blog: Tip: Set Gmail as your default email client in Firefox 3.

Know your linux distribution

lsb_release is a command which gives linux distribution related information of the current installation. For example the following command gives all description of the current installation

guest@debian:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 4.0r7 (etch)
Release: 4.0r7
Codename: etch

For more options check man lsb_release

Setting proxy for console(terminal) applications

Command line tools like wget,apt-get requires the variable http_proxy to be initialized , to access the internet if proxy only is available. The format is as follows
http_proxy=http://user:password@proxyhost:portnumber.
For example
$ http_proxy=http://hash:mypassword@192.168.40.1:3128
Then execute the applications needed.

Random quotes in terminal (console)

Do you like displaying random quotes(adage/epigram) on your terminal each time you open a terminal?

fortune is a utility which print a random, hopefully interesting, adage each time the command is executed.
hash@ssl50:~$ fortune
He who opens a school door, closes a prison.
-- Victor Hugo

To get the output displayed each time you start a shell append the fortune command to end of the file .bash_profile ( or .bashrc) in your home directory (create the file if it does not exist).

To get more variety of quotes install more fortune cookies.
In one of my earlier post, I mentioned how to set up an Ubuntu mirror and using it for installing Linux. There are many other ways to install Linux in more than one machine(as in the case of a lab).

Suppose you have one machine which has all the softwares installed and other necessary settings. This installation can be cloned to another using cloning tools like g4u.

g4u(Ghost for Unix) is a cloning tool, which comes as a live CD. Booting with g4u live cd will take to a terminal. Typing help will display the commands available. It has options to upload an image to ftp server, restore image from ftp server, copy from one hard disk to another. All the commands are self explanatory.

Multiple screens in linux

Other than the xserver which is currently you are using, there are other consoles where you can login and do your work simultaneously.

Key combinations
Ctrl+Alt+Fn(n starts from 1): For switching into virtual consoles
Ctrl+Alt+Fm(m starts from 7): For switching into different screens(If you have started many screens).

Compared to windows we can have more than one screen in linux (Don't confuse it with the concept of multiple desktops. Each of the screen can have more than one desktop !!!!).

For starting a screen, login into a virtual console, then give the command
$ startx -- :1



The last argument :1 is the screen number. If a new screen is to be started, another number should be used, say :2.

Multiple screens are useful in many occasions. For example during a presentation the faculty can start two screens. One screen for him to workout things which is not made visible to audience. Another screen to display things using the projector(by toggling the LCD/CRT button).

Set up an ubuntu mirror for installation

I wanted to install Ubuntu in more than one pc. Installing using CD in each machine is time consuming. Net installation is another option. I decided to boot from a CD and obtain install image and packages from another machine(let me call it 'server'). Server machine should should have an Ubuntu mirror. Preparing an ubuntu mirror using apt-mirror needes downloading a lot of packages from other mirrors. Alternatively ubuntu(alternate) cd could be used for the same puropse. The steps are given below.

Setting up the server


  • Obtain the ubuntu alternate install cd.

  • This is a text based (not commands) installation cd. The normal ubuntu cd, which is also used as live cd, can't be used for setting up the mirror.

  • Mount the cd in some apache accessible location
  • $ mkdir /var/www/ubuntu
    $ mount -o loop ubuntu-8.10-alternate.iso /var/www/ubuntu

Client

Obtain mini.iso for netinstall from ubuntu.Alternative a pendrive could be prepared for booting the client.
Boot with the CD and give the the options as and when required untill the installation mirror is asked. Scroll up to the top and select the manual install mirror. Give the server name, say server.yourdomain.com, directory , /ubuntu , as we had mounted it in the folder ubuntu. Give necessary proxy url in the next screen. Further steps are same as the normal installation.