Friday, October 2, 2009

My VIM .vimrc file for working with Python

Here is the VIM .vimrc file that I use to work with Python.
syntax on
set nu
set ts=4
set sw=4
set sts=4
set autoindent
set smartindent
set expandtab
set smarttab
It will

  1. Display the line number.

  2. Set tab stop to 4.

  3. Enable you to use < and > to indent or unindent a block in visual mode.

  4. Insert spaces instead of tab, when pressing the tab button.

Wednesday, September 30, 2009

Multiple column layout in LaTeX

To create a multiple column layout in LaTeX is easy. What you need is the multicol package.
\usepackage{multicol}


For example, to create a two column layout.
\begin{multicols}{2}
put the contents here
\end{multicols}


To manually break the column, use the \columnbreak command.
\begin{multicols}{2}
Column 1 \columnbreak Column 2
\end{multicols}


If you are using standard LaTeX class, such as "article", you can simple create a two column layout using the code below:
\documentclass[twocolumn]{article}

How to change Shiretoko codename to Firefox

Shiretoko is the development codename for Firefox 3.5.x.

To change the User-Agent identification to Firefox,

  1. Enter about:config in the address bar.

  2. Enter general.useragent.extra.firefox in the field at the top.

  3. Change its value from Shiretoko/3.5.4pre to Firefox.

Friday, September 18, 2009

LaTeX editor with live preview pane for Ubuntu/Linux

Gummi
Gummi is a lightweight LaTeX editor written in Python/GTK+ released as open-source software under a dual MIT/Beerware license, and was written by a BSc student of Artificial Intelligence at the University of Amsterdam, Alexander van der Mey.

The main feature of Gummi is that the Preview Pane will update as you are typing. In my opinion, this feature is good if you are learning LaTeX.

Give Gummi a try, and tell me your opinion.

Click here to download.

Thursday, September 17, 2009

Resize image using Imagemagick

Imagemagick is a powerful image manipulation program. This tutorial is about resizing image with Imagemagick.

Resize an image to 500px width.
mogrify -resize 500 image.png

Resize an image to 500x300, with aspect ratio preserved.
mogrify -resize 500x300 image.png

Force resize an image to 500x300.
mogrify -resize 500x300! image.png

Resize multiple images.
mogrify -resize 500x300 *.png

How to install Debian packages (.deb files) on Ubuntu

The most easiest way to install a debian packages on Ubuntu, is by double click on the .deb file, and then select Install Package.

However, you could also install a debian package by using a terminal using this command:
sudo dpkg -i package_file.deb

To uninstall, use this command:
sudo dpkg -r package_name