Skip to main content

Posts

Showing posts from 2010

Pusilience and snakes

Pusilience - I swear that I saw this word in GRE list but could not find it in the online dictionaries. Anyways it means the behavior that a coward exhibits in times of crisis, (being a pussycat). 
Today I caught two non-poisonous snakes back to back. One small Trinket (http://en.wikipedia.org/wiki/Coelognathus_helena) and one medium sized Wolf snake.

As soon as I was notified about the first snake I asked the reception to send someone with the snake catching net so that there is no delay. Many times before it has happened that by the time I went to reception, got the net, ran for the snake. And reaching the spot, found that the snake is long gone. In meantime, nobody bothers to inform that the snake has left and you have no need to come. We have to start charging for every call, and then people would actually take this seriously. Anyways, I asked for someone to reach with the net. But apparently, Mr. Bosgo has made it clear that no one would help the snake catchers. Whet…

Howto extract audio from flv

To extract audio from a flash file downloaded from Youtube or Google video use ffmpeg.

Install ffmpeg and related decoders by :

 apt-get install lame mpg123 ffmpeg

Now convert flv -> mp3 :

ffmpeg -i inputfile.flv -f mp3 -vn -acodec copy  outputfile.mp3

Note :- Lame is needed for mp3 encoding to work.

Speed up the Gnome

Gnome menu loads the menu icons as needed causing a delay before you can see the icons.

 FIX :

gtk-update-icon-cache -f /usr/share/icons/THEMENAME/

 Replace the THEMENAME with the actual icon theme set you are using. The default is ‘gnome‘.

echo gtk-menu-popup-delay = 100 >> ~/.gtkrc-2.0

 Gnome also hogs resouces my animations that are barely noticeable.
To enable these resource saving features open gconf, from terminal:
gconf-editor
from there go to:
/apps/metacity/general and check on reduced_resources
also:
/apps/panel/global and uncheck enable_animations
also:
/desktop/gnome/interface and check off the box for accessibility

 source: http://www.marksanborn.net/linux/turn-off-gnome-animations-and-hide-window-contents-while-dragging/

The other less known issues are  compcache / ramzswap and clamd.

Ramzswap uses physical memory as swap space thereby causing memory lock-ups. It is vestiges of the Live-CD which requires this feature when no swap space exists on the HDD. But once instal…

Wrap lines while printing from gedit

Gedit by default do not wrap lines while printing. It justs cuts off the sentence when it runs into the margin.
This default behavior could be changed by editing the value of /apps/gedit-2/preferences/print/page/print_wrap_mode in the gconf-editor.

$ gconf-editor &

 Goto /apps/gedit-2/preferences/print/page/print_wrap_mode

"GTK_WRAP_NONE" for no wrapping.
"GTK_WRAP_WORD" for wrapping at word boundaries.
"GTK_WRAP_CHAR" for wrapping at individual character boundaries.

source : http://people.gnome.org/~bmsmith/gconf-docs/C/

Creating djvu documents (ebooks) from scans

The best way to make ebooks would be to scan and then convert them to djvu. Not pdf because pdf is very bad when it comes to packing images. Djvu on the other hand is more optimised to handle scanned documents. It could generate a small file without losing quality of the output.

After getting all the scans in place there are a few things to do to get the final djvu document.

Rename all files in the following order
book-001.jpg book-002.jpg...... book-024.jpg book-025.jpg.... book-165.jpg book-166.jpg
It can be anything instead of book-
But the crucial thing is that the numbers should be padded to facilitate numerical sorting otherwise if it is like 1.jpg 2.jpg ... 10.jpg 11.jpg ... then 10.jpg would occur before 2.jpg.
We do not want that. Hence naming should be such.

If it is already in the format : 1.jpg 2.jpg ... 10.jpg 11.jpg ... : then put 1-9 in one folder, 10-99 in another , 100-999 in another and so on. Now, go to each folder and just bulk rename them using

rename -v 's…

Plot the zeros of transcendental equations in Mathematica

A transcendental equation is defined as function f.It is solved not by the usual Solve routine but by the new Refine routine because it includes all the different possibilities of the unknown variables the equation has. Assuming is used to tell the kernel that the variables XX and YY  are always positive. Note the way the two conditions are clubbed. With an &&.Now, we have to set XX and YY to some value, otherwise Mathematica would not be able to Plot it. Then to evaluate at what point the zeros of the function f occurs using the {v,f(v)} and setting v= {the solution}.Now, we can inject this point into the Plot by the Epilog command.  Epilog command is an option for graphics functions which gives a list of graphics primitives to be rendered after the main part of the graphics is rendered. The options used for the point size / color are standard commands.Now mathematics plots the function f. Then renders the points of its zeros directly into the plot. So, the end effect is that…

How to use Latex formulas with xfig

Source : http://graphics.stanford.edu/lab/howto/xfig_latex.html

Use the normal method in xfig for adding text, but set the "special text" mode using the "Text flags" menu at the bottom of the screen for math mode.To input LaTex set the "special text" mode using the "Text flags" menu at the bottom of the screen.Then use text tool and write $...$ to switch to math-mode. Type the equation.Export the figure from xfig : using the format "Combined PS/LaTeX (PS part)".Two files would be created: foo.pstex and foo.pstex_tNow save the following as some file, say create-xfig-eps and make it executable -

cp $1.pstex_t temp.pstex_t
cp $1.pstex .temp.pstex
echo "\documentclass{article}
\usepackage{epsfig}
\usepackage{color}
\setlength{\textwidth}{100cm}
\setlength{\textheight}{100cm}
\begin{document}
\pagestyle{empty}
\input{.temp.pstex_t}
\end{document}" > temp.tex
latex temp.tex
dvips -E temp.dvi -o $1.eps
rm temp.*

cp the files file.…

Evince and Firefox

Follow link in Evince :

Evince fails to follow a link to Firefox with the following error :

Failed to execute child process "/usr/lib/firefox35/firefox" (Permission denied)

Some people suggest to set the path correctly by creating a soft link.
For example if the Firefox is now in the directory /usr/local/bin/firefox then create the following soft link: ln -s /usr/local/bin/firefox /usr/lib/firefox35/firefox

This DOES NOT work.

The correct way to do this is to set the path correctly in the gconf-editor.

Open gconf-editor .Goto /desktop/gnome/url-handlers/http/.Change the command to just firefox "%s".The OS would figure out where the Firefox is installed and act accordingly.To open the pdf's in the Firefox window with Evince instead of acroread :

The mozplugger does not work.

The best way is to goto Firefox -> Preferences -> Applications.
Change the Adobe documents handler to use Evince.

newcommand in LaTeX

New commandsTo add your own commands, use the
\newcommand{name}[num]{definition}\newcommand{\wbal}{The Wikibook about \LaTeX}This is ‘‘\wbal'' \ldots{} ‘‘\wbal''=> This is “The Wikibook about LaTeX” … “The Wikibook about LaTeX” The next example illustrates how to define a new command that takes one argument. The #1 tag gets replaced by the argument you specify. If you wanted to use more than one argument, use #2 and so on, these arguments are added in an extra set of brackets.

\newcommand{\wbalsup}[1]{This is the Wikibook about LaTeX supported by #1}\newcommand{\wbalTwo}[2]{This is the Wikibook about LaTeX supported by #1 #2}% in the document body:\begin{itemize}\item\wbalsup{Wikimedia}\item\wbalsup{lots of users!}\item\wbalTwo{John}{Doe}\end{itemize}This is the Wikibook about LaTeX supported by WikimediaThis is the Wikibook about LaTeX supported by lots of users!This is the Wikibook about LaTeX supported by John Doe
But there a lot of caveats :-

LaTeX ignores the…

Changing the font size of section headings in LaTex

You have several ways to do so:
1.- A direct redefinition of \section:
\makeatletter \renewcommand\section{\@startsection{section}{1}{\z@}%                                   {-3.5ex \@plus -1ex \@minus -.2ex}%                                   {2.3ex \@plus.2ex}%                                   {\normalfont\large\bfseries}} \makeatother
2.- By means of the titlesec package:
\usepackage{titlesec} \titleformat{\section}{\large\bfseries}{\thesection}{1em}{}
3.- By means of the sectsty package:

\usepackage{sectsty} \sectionfont{\large}source : http://www.latex-community.org/forum/viewtopic.php?f=4&t=3245



Now, I would explain the titlesec package a bit more (because it seems easier to me and with more options) :

To change the section fonts with this package put the following lines in the preamble -

\usepackage{titlesec}
\titleformat{\section}{\large\bfseries}{\thesection}{1em}{}


Options available are-

a> Font size -

\normalsize \large \Large \huge \Huge
 Increasing size ->

Script for dictionary lookup

#!/bin/bash
# dictionary v1.5.5 - to dump dictionary outputs from the web. Uses the google dictionary but can be used for any other online dictionary.
# Needs lynx to work.
# by JOnes ( August 16, 2010 )

# ANSI Color -- use these variables to easily have different color
#    and format output. Make sure to output the reset sequence after
#    colors (f = foreground, b = background), and use the 'off'
#    feature for anything you turn on.

initializeANSI()
{
  esc=" "

  blackf="${esc}[30m";   redf="${esc}[31m";    greenf="${esc}[32m"
  yellowf="${esc}[33m"   bluef="${esc}[34m";   purplef="${esc}[35m"
  cyanf="${esc}[36m";    whitef="${esc}[37m"

  blackb="${esc}[40m";   redb="${esc}[41m";    greenb="${esc}[42m"
  yellowb="${esc}[43m"   blueb="${esc}[44m";   purpleb="${esc}[45m"
  cyanb="${esc}[46m";    whiteb="${es…

Ubuntu in Compaq nc6220

Ubuntu in Compaq nc6220 (Lucid)

Everything works out of the box except the sleep and wake.


1. After closing the lid and re-opening it, the screen might flicker badly. To resolve that put the laptop to sleep and wake it again (use the fn key). The flicker should be gone.

2. After waking up from sleep/ screen lock, the wireless would be disconnected. Just re-connect it from the network manager applet located in the main panel.

3. Sometimes, the password login stos working. This is because some hidden characters are being spontaneously generated. This is realted to the screen flicker issue. So do the sleep + wake up drill.

4. Over-heating issue - There are 4 thermal zones. See the applet in the panel to see how hot they are getting. If it crosses 50C it is time to slow down. Stop all intensive jobs and put the laptop upside down because its lower part gets too hot and its ventilation is poor. Only by inverting it will get some cool air.

5. Always make sure that the fan on the left side …

Make firefox faster

1.Type “about:config” into the address bar and hit return. Scroll down and look for the following entries:

network.http.pipelining network.http.proxy.pipelining network.http.pipelining.maxrequests

Normally the browser will make one request to a web page at a time. When you enable pipelining it will make several at once, which really speeds up page loading.

2. Alter the entries as follows:

Set “network.http.pipelining” to “true”

Set “network.http.proxy.pipelining” to “true”

Set “network.http.pipelining.maxrequests” to some number like 30. This means it will make 30 requests at once.

3. Lastly right-click anywhere and select New-> Integer. Name it “nglayout.initialpaint.delay” and set its value to “0″. This value is the amount of time the browser waits before it acts on information it receives.

If you’re using a broadband connection you’ll load pages MUCH faster now!

3. Faster loading

If you haven't moved your mouse or touched the keyboard for 0.75 seconds (the content switch thr…

Compiz-Check

source : http://forlong.blogage.de/entries/pages/Compiz-Check

Compiz-Check is a script to test if Compiz is able to run on your system/setup and if not, it will tell you the reason why.

Additionally you can use the output of the script to look for support in the official Compiz Fusion forums or the mailing list / forum of your distribution, which will make it much easier to locate your problem.

The script is suitable for GNOME, KDE and Xfce users and is not limited to a specific Linux distribution – in fact, the script lists those infos for you.

The test consists mainly of three parts:

   1. List relevant system information
   2. Run several Compiz related checks
   3. Check for problematic hardware and problems with the setup in use.

Download & Usage
Do not just copy & paste the following to your blog/forum – find out why

The script is available here.
You can use this command to download it to your home directory:

wget http://blogage.de/files/9124/download -O compiz-check


Aft…

Commands to create CSV file of contacts

Terminal commands to create CSV file of contacts out of list of names and phone numbers from website.

The idea is to copy paste the file list from the website onto a openoffice spreadsheet document. now save it as a CSV file.

Now, use the following commands in terminal (to remove the unnecessary whitespaces.).

cat a2.csv | sed 's/ //g' | sed 's/\" /\"/g'  | sed 's/ \"/\"/g' > contacts.csv

Some simple scripts about how life is

$ cat husband.sh

#!/bin/bash
while (! dead || ! beggar)
do
wife.speak > /dev/null
chmod 707 me.c
rm -rf wife/
echo -e "relief"
mkdir newgirlfriend
wait 946707779000
./marriage newgirlfriend
done

read this as
1. Start loop.
2. anything wife says goes to junk.
3. The groups are (yourself, your woman, other women). chmod 707 => Make yourself available to yourself and other women but not to your wife.
4. Finally get rid of her.
5. Sigh of relief.
6. Make new girlfriend.
7. Wait three years (in seconds).
8. Execute marriage with newgirlfriend. marriage is a separate script with different commands.
9. Repeat process till not dead or not a beggar.

$ cat marriage.sh

#!/bin/bash
 if [[ "$gender" == "male" ]]
   then
echo "Todo : Buy a ring, be on time and remember to say the right name."
 else
echo "Todo : .... Stack overflow ...."
 fi

Self-explanatory.

I got the idea of writing these scripts while reading the boring Tips & Trick…

Longest words

http://en.wikipedia.org/wiki/Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon

It is a transliteration of the Ancient Greek word

λοπαδο­τεμαχο­σελαχο­γαλεο­κρανιο­λειψανο­δριμ­υπο­τριμματο­σιλφιο­καραβο­μελιτο­κατακεχυ­μενο­κιχλ­επι­κοσσυφο­φαττο­περιστερ­αλεκτρυον­οπτο­κεφαλλιο­κιγκλο­πελειο­λαγῳο­σιραιο­βαφη­τραγανο­πτερύγων 

in the Greek alphabet (1169–74). Liddell & Scott translate this as "name of a dish compounded of all kinds of dainties, fish, flesh, fowl, and sauces."
The original Greek spelling had 171 characters (something which is not obvious in the Roman transcription, depending on the variant) and for centuries it was the longest word known and it is considered the longest word ever to appear in literature.

Another word is Pneumonoultramicroscopicsilicovolcanoconiosis

I experienced Pneumonoultramicroscopicsilicovolcanoconiosis …

Draws chessboard on a maximised linux terminal using a bash script

Open a new terminal.

Save the following as a file "chessboard" -

vim chessboard 

and paste -

for (( i = 1; i <= 49 ; i++ )) ### Outer for loop ###
do
  for (( j = 1 ; j <= 49; j++ )) ### Inner for loop ###
  do
       tot=`expr $i + $j`
       tmp=`expr $tot % 2`
       if [ $tmp -eq 0 ]; then
           echo -e -n "\033[49m  "
       else
           echo -e -n "\033[40m  "
       fi
 done
echo -e -n "\033[49m" #### set back background colour to black
echo "" #### print the new line ###
done
echo -e -n "\033[49m \n" #### set back background colour to white

Make it executable -
chmod 755 chessboard

Run the script -
./chessboard

The terminal must be maximised.

Stare at the pattern for some time. Does it move ?

latex error .sty not found in Cadabra

"latex error your-new-file.sty not found"
while building your .tex files, and you are sure you've just put them in some sort of directory like:
/usr/share/texmf/tex/latex/your-new-directory


After that run the command
$ texhash
and then, latex should be ready to find your style files

Foe example, xcadabra showed the error breqn.sty not found. I downloaded it from
http://www.ctan.org/tex-archive/help/Catalogue/entries/breqn.html?ref=darwinports.com
and copied it to /usr/share/texmf/tex/latex/cadabra
Still it was not working. Then I used texhash and it worked.

Sometimes then it might miss some other .sty file and even after adding that file manually from CTAN it keeps on adding up. More and more sty files are not found.

A fix would be to delete the directory /usr/share/texmf/tex/latex/cadabra

then reinstall cadabra

sudo apt-get install --reinstall cadabra

It should work now.

If that does not work and there is error that flexisym.sty not found andeven after adding that s…

Customising Nautilus in Lucid Lynx

The new Nautilus is very annoying . The first thing i missed was the ability to type the path directly into the browser rather than keep clicking till I reach there. The location bar which was it is called, is just not available in default Nautilus installation (maybe just in my installation). It can be brought back temporarily with Ctrl+L, but its temporary. I want a permanent fix.

So, I had to manually modify the configurations options for Nautilus through gconf-editor. And I liked it. It gives explicit control over Nautilus. Everything can be changed. I had it look like Dolphin at some point of time. It shows how flexible Nautilus can be. The default installation is for the novices, to mimic the Windows explorer. I do not care about that.

So, lets see what changes we can do to Nautilus to make it outright funky.

I wrote these following options to a text file and saved it as nautilus.sh. Made it excutable (chmod 755) and ran it. It sets the values for Nautilus in gconf-edi…

Fixing AVIs with broken index or interleaving

Easiest thing. We simply copy the video and audio streams, and MEncoder generates the index. Of course this cannot fix possible bugs in the video and/or audio streams. It also fixes files with broken interleaving, thus the -ni option won't be needed for them anymore.
Command: mencoder -idx input.avi -ovc copy -oac copy -o output.avi

But it failed after 10 mins. of video for me.

To find duplicate entries in filenames

I have used a script to convert pictures from a party to two different sizes 640 and 1024. I have kept the right resolutions of chosen pictures and deleted the rest. But as usual duplicates remain.

My ls command gives a list similar to the following.

-rwx------ 1 aaaa aaa  39191 2010-06-28 22:49 2010-IMG_4354-640.JPG
-rwx------ 1 aaaa aaa  41129 2010-06-28 22:49 2010-IMG_4355-640.JPG
-rwx------ 1 aaaa aaa  46668 2010-06-28 22:49 2010-IMG_4356-640.JPG
-rwx------ 1 aaaa aaa 121721 2010-06-28 22:49 2010-IMG_4359-1024.JPG
-rwx------ 1 aaaa aaa 104468 2010-06-28 22:49 2010-IMG_4360-1024.JPG
-rwx------ 1 aaaa aaa 164638 2010-06-28 22:50 2010-IMG_4361-1024.JPG

I would just use this list to find the duplicates. My task is greatly simplified because of the great naming scheme. Same picture with different resolution only differ by the tag 640/1024 at the end.

A single command finds our duplicates.

 ls -l | cut -d "_" -f2 | cut -d "." -f1 | sed 's/-/\t/' | cut -f1 | …

Charge mobiles with your kinetic energy

The new PEG uses kinetic energy to create juice for your gadgets and by placing the PEG in your pocket, bag or briefcase you should always have enough power to charge your cellphone, MP3 or other gadgets on the move. The PEG is compatible with over 3,000 hand-held electronic devices.

To learn how it works read --

http://www.npowerpeg.com/tech/how

Laptop lid state

Laptop lid state is given by,

cat /proc/acpi/button/lid/state

To test if it works try,

sleep 2 ; cat /proc/acpi/button/lid/state

Now, close the lid and open after 2 secs.

It will tell that the lid was closed.

Http proxy settings

Even after resetting the proxy setting sometimes there are some hidden  files where the old values can stay behind.
I list some common places to look --

System -> Preferences -> Network proxy.
Open terminal.

$ echo $HTTP_PROXY

If it still shows the old value reset it by the command

$ set HTTP_PROXY=""
$ export .bashrc

Do the similar thing for other shells csh etc.
The settings for KDE ~/.kde/share/config/kioslaverc

$ cat ~/.kde/share/config/kioslaverc

If it still shows the old value in httpProxy then edit it. Do not forget to change the value of PersistentProxyConnection.

Must have gmail mods

1.   Activeinbox

http://www.activeinboxhq.com/install.html

Turn emails into actions for easy email managementManage your emails as a flow of actions to get absolute control, minimize email overload and achieve inbox zero. Built using GTD® concepts.Always have a clear vision of things that need your attentionFocus on high priority emails and see all the different projects flowing through your email.Build stronger relationships with replies that meet contact's expectationsServe contacts better with deadlined emails, complete control of current emails and by easily building on previous conversations.Effortlessly keep your email organized to stop Gmail becoming a blackholeNever forget an important email, retrieve knowledge stored in the depths of your archive and track every email you send. Nothing falls through the cracks

2. Gmailfs

http://sr71.net/projects/gmailfs

This is a Debian package which allows you to use GMail storage as a filesystem. Needs python-fuse installed to work.

For Ub…

Good and bad dietary choices for the prevention of diabetes

The most important thing to keep in mind when eating is to control your blood sugar. A relatively stable blood sugar is essential in preventing or reversing diabetes.

Make sure you read this article before moving on.  Diabetes prevention diet

Good dietary choices:

1. Whole grains (brown rice, whole grain pasta, unprocessed oatmeal) , legumes, fruits (not so many bananas), vegetables,

2. Olive oil, Salmon, Tuna, Flax seed oil.

3. Lean chicken breast, tofu, whey protein powder

4. Green tea, cinnamon

5. Water

Poor dietary choices:

1. Junk food: Chips, crackers, cake, chocolate, candy, soda, cookies…

2. White flour or white rice: bread, pasta, pastry,

3. Saturated or hydrogenated fats: red meat, cheese, dairy, ice cream, pie, peanut butter (100% natural is ok)…

Mangos all the way

Some interesting stuff I learned about mangoes --

Mangoes are naturally low in fat and are an excellent source of vitamin C. Just half a mango provide almost 40 percent of a woman's daily vitamin C requirements.

They're also a source fibre and potassium, a mineral that helps keep blood pressure numbers in check.

Nutrition Information per ½ fruit (103 grams):

Calories 67
Fat 0.3 grams
Fibre 2 grams
Beta Carotene 461 micrograms
Vitamin C 29 milligrams
Potassium 161 milligrams


All mangoes have a large oversized seed. Because the mango seed is so oversized, the larger the mango, the higher the fruit-to-seed ratio.So, always buy a medium sized one.

 Ripening of mangos --


How a mango or any other fuit ripens 
Ethylene is the hormone that is particularly responsible for causing mangoes (and other fruit) to ripen. It is also produced when plants are stressed by injury, infection or environmental factors such as drought or flooding. Fruit ripens when seeds are mature, in order to encourage a…

Playing with video files in Linux

1. To extract audio from a video file --

$ mplayer my_video_file.avi -ao pcm:file=file.wav

$ lame -f file.wav file.mp3

This creates a small size high quality mp3 file but it is very slow particularly if extracting the entire audio track of a movie. Mplayer takes ages to do the extraction. SO, it is better to use ffmpeg instead.

$ ffmpeg -i my_video_file.avi extracted_audio.mp3 2. Convert any audio format to wav/mp3 --
$ mplayer file.rm -ao pcm:file=file.wav $ lame -f file.wav file.mp3  3. Convert any video format to avi --

FLV to mpg :

Using ffmpeg :
libavcodec is a library containing all the FFmpeg audio/video encoders and decoders. Most codecs were developped from scratch to ensure best performances and high code reusability.libavformat is a library containing parsers and generators for all common audio/video formats.
$ ffmpeg -i jokes.flv -ab 56 -ar 22050 -b 500 -s 320×240 jokes.mpg

jokes.flv is the file you want to convert, so the name must be the same as the source file.You can name jok…

Disabling compcache for good

If a Ubuntu is installe from a CD or DVD chances are that along with the swap disk which physically exists on the hard drive Ubuntu also uses a RAM SWAP. This is a most annoying behavior because it leads to serious slowdowns and locks ups of the system.
If you are one of those poor souls whose Firefox freezes up regularly after prolonged use even when not too many tabs are open then you are a victim of the Compcache. Even though it is boon for Live CDs it becomes the unwanted child in an installed Linux distribution.

What do Compcache do ?
I quote the webpage dedicated to Compcache (https://wiki.ubuntu.com/Compcache)
"Compcache provides a possibility of using parts of the memory as virtual compressed swapdevice." 

So Compcache creates a virtual drive in memory called the ramzswapfound at /dev/ramzswap0 and makes programs trick into storing their swap data there.
This is not at all needed if a dedicated swap partition exists in a system. It interferes with the swapping mechan…

Change desktop folder and relocate music (due to space constraints) and still have the system recognise them

After I foolishly wiped my home folder clean (don't ask) my home folder became the Desktop. Whatever file I save there started to appear at the Desktop. Even after i created a folder called /home/me/Destop this continued. Also, due space constrainst I have moved my Music, Picture folders elsewhere. But I wanted my system to locate them.

So finally I had to do something.

 All I had to do was to edit the file ~/.config/user-dirs.dirs .

-------------- before editing --------------
 # This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/"
XDG_DOWNLOAD_DIR="$HOME/"
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE…

Cool links to top 10 lists that I found

One problem I faced is that even after setting IP statically with ifconfig it was getting reverted to its original IP after network restart.

 The command I used were -

ifconfig eth0 down 

to bring the default ethernet link down.

/etc/init.d/networking stop

for stopping the network daemon.

ifconfig eth0 192.168.xx.xx netmask 255.255.255.0 broadcast 192.168.xx.xx

to set the IP of my machine to 192.168.xx.xx statically.

ifconfig eth0 down

to bring up the ethernet interface.

ifconfig

to show what is my new IP. And it shows the IP correctly. But when I restart
the network with the command.

/etc/init.d/networking start

It reverts back to the original IP. I finally realized what is happening. This is because the IP is set by the NetworkManager which pulls the IP information from the file /etc/network/interfaces. So as long as this file contains the old IP  NetworkManager would keep changing the IP to the old one.

So, I manually edited the file -


# original file
auto lo
iface lo inet loopback


auto et…

Footnotes in LaTeX

Footnotes Adding a footnote in text is easy. For example: The article\footnote{Haptonstahl, 2002.} was pretty good.shows the text "The article1 was pretty good." and adds a numbered footnote at the bottom of the page reading "Haptonstahl, 2002."
If you want to add a footnote in a "forbidden mode" like in math mode, tables, or boxes, you have to do it in two easy steps. At the place you want the little superscript number (in the equation, for example) put
\footnotemarkThen, right after the "forbidden mode" ends, put the text of the footnote in the command
\footnotetext{The text of the footnote goes here.}Admittedly, if there are multiple footnotes in the same "mode," this can get a little messy, but it can be done. Check the appropriate references. Suffice to say it can be done.
Endnotes: Use the footnote commands as above. If you want all of the footnotes displayed in their own section at the end of the document -- endnotes -- …

Convert mp4 to mpg

Use ffmpeg

ffmpeg -i strong.mp4 -ab 56 -ar 22050 -b 200  str.mpg

See explanation of the parameters in the post http://kheyali.blogspot.com/2010/05/convert-flv-to-mpg-using-ffmpeg.html

But this gives a blocky ouput. To finely control the quality of the output use -qscale option. -qscale 1 gives best image quality 2 ,3 ... are progressively worse but generate files of smaller size. It is all a size and quality balancing game.

ffmpeg -i strong.mp4 -ab 56 -ar 22050 -qscale 6  str6.mpg

Find files of particular size

Use find with the size option. The size option takes one argument. -5000k means less than while +5000k means greater than 5MB.

Examples -

To find mp3 files of size < 5 MB
$ find /mp3collection -name '*.mp3' -size -5000k




To find file of size > 10MB
$ find / -size +10000k



To find file of size > 180MB but < 190 MB.
For example if I want to find files for the Friends episodes in my hard disk which I know are approx. ~ 185MB.

$ find / -size +180000k -and -190000k



Practice -

Guess what the following command does?
$ find /mp3-collection -name 'Metallica*' -and -size +10000k


For more, see http://www.codecoffee.com/tipsforlinux/articles/21.html

To increase volume of mp3 in Linux

To increase volume of mp3 in Linux install the lame package.

To install lame first add the Medibuntu repos (https://help.ubuntu.com/community/Medibuntu) if it is already not added.

Install lame as -
$ sudo apt-get install build-essential checkinstall
$ sudo aptitude install lame

The volume of a mp3 can be adjusted by playing with the replaygain using the scale option.

$ lame --scale 15 in.mp3 out.mp3

This command scales the audio from in.mp3 by 15 and saves it in the file out.mp3.

For more, see  http://linux.die.net/man/1/lame

Convert .flv to .mpg using ffmpeg

Using ffmpeg :
libavcodec is a library containing all the FFmpeg audio/video encoders and decoders. Most codecs were developped from scratch to ensure best performances and high code reusability.libavformat is a library containing parsers and generators for all common audio/video formats.
ffmpeg -i jokes.flv -ab 56 -ar 22050 -b 500 -s 320×240 jokes.mpgjokes.flv is the file you want to convert, so the name must be the same as the source file.You can name jokes.mpg whatever you want as long as it has the .mpg extension.-b bitrate: set the video bitrate in kbit/s (default = 200 kb/s)-ab bitrate: set the audio bitrate in kbit/s (default = 64)-ar sample rate: set the audio samplerate in Hz (default = 44100 Hz)-s size: set frame size. The format is WxH (default 160×128 )Using mencoder :
This might not work.
To convert flv (flash video) files to AVI using open source mencoder. To perform the conversion, you just need to type :mencoder -oac copy -ovc lavc -o video.avi video.flvYou can convert t…

বনলতা সেন - জীবনানন্দ দাশ

বনলতা সেন

জীবনানন্দ দাশ

হাজার বছর ধরে আমি পথ হাঁটিতেছি পৃথিবীর পথে,
সিংহল সমুদ্র থেকে নিশীথের অন্ধকারে মালয় সাগরে
অনেক ঘুরেছি আমি ; বিম্বিসার অশোকের ধূসর জগতে
সেখানে ছিলাম আমি ; আরো দূর অন্ধকারে বিদর্ভ নগরে;
আমি ক্লান্ত প্রাণ এক, চারিদিকে জীবনের সমুদ্র সফেন,
আমারে দুদণ্ড শান্তি দিয়েছিলো নাটোরের বনলতা সেন।

চুল তার কবেকার অন্ধকার বিদিশার নিশা,
মুখ তার শ্রাবস্তীর কারুকার্য; অতিদূর সমুদ্রের 'পর
হাল ভেঙে যে নাবিক হারায়েছে দিশা
সবুজ ঘাসের দেশ যখন সে চোখে দেখে দারুচিনি-দ্বীপের ভিতর,
তেমনি দেখেছি তারে অন্ধকারে; বলেছে সে , ' এতোদিন কোথায় ছিলেন?'
পাখির নীড়ের মত চোখ তুলে নাটোরের বনলতা সেন।

সমস্ত দিনের শেষে শিশিরের শব্দের মতন
সন্ধ্যা আসে; ডানার রৌদ্রের গন্ধ মুছে ফেলে চিল;
পৃথিবীর সব রঙ নিভে গেলে পাণ্ডুলিপি করে আয়োজন
তখন গল্পের তরে জোনাকির রঙে ঝিলমিল;
সব পাখি ঘরে আসে--সব নদী--ফুরায় এ-জীবনের সব লেনদেন;
থাকে শুধু অন্ধকার, মুখোমুখি বসিবার বনলতা সেন।

Answers to some crazy questions

If swimming is a good exercise to stay fit, why are whales fat? Why is that everyone wants to go to heaven but nobody wants to die? Shall I say that there is racial discrimination in chess as white piece is moved first? In our country,we have freedom for speech,then why telephone bills? If money doesn't grow as trees then why do banks have branches? Why does a round pizza come in a square box? Why doesn't glue stick to its bottle? Why do you still call it building when its already built? If its true that we are here to help others, for what others are here for? If you aren't suppose to drink and drive why do bars have parking lots? We are FUNNY People LIVING IN A SERIOUSLY FUNNY WORLD :- |)

Answers -
Q : If swimming is a good exercise to stay fit, why are whales fat?
A : Because they always tend to overeat after a good swim.

Q: Why is that everyone wants to go to heaven but nobody wants to die?
A: Because Charon's fees has increased a lot lately. It is like wanting to go t…

Okular does not exit full screen mode

See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508634

Description : Once the fullscreen mode is turned on in Okular it refuses to go back and hides even the menubar. Even pressing ctrl+shift+f does not help. Closing Okular and opening another file does not help. It stays in that fullscreen mode.

Workaround : I am posting the workaround here. Unfortunately you have to manually edit the okularrc file each time you go fullscreen.

Goto the folder $HOME/.kde/share/config (or a similar folder for kde4- .kde4/share/config/).
Open okularrc in gedit.

It would show something like -

[Desktop Entry]
FullScreen=true

[MainWindow]
Height 900=901
MenuBar=Disabled
State=AAAA/wAAAAD9AAAAAAAABaAAAAOEAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAEAAAAWAG0AYQBpAG4AVABvAG8AbABCAGEAcgAAAAAAAAAFoAAAAAAAAAAA
Width 1440=1441

[MainWindow][Toolbar mainToolBar]
Hidden=true

[Notification Messages]
presentationInfo=false


Enable the menubar : MenuBar=Enabled.
Disable fullscreen :FullScreen=false

Fire up Okular again. Now see the okula…

Linux keyring trouble

I keep getting this notice some time now while using Nautilus and Evolution.

Enter password for default keyring to unlock

Gnome Keyring is the method how Nautilus stores the passwords like the password manager in Firefox. And it needs a super pass for doing that.
Just move the ~/.gnome2/keyring to somewhere else. If it still creates problems then more elaborate procedure is needed. See here - http://ubuntuforums.org/showthread.php?t=192281&highlight=GNOME+session

How Hamilton invented the quaternions

VOB file merger for Linux

This can be done in a variety of ways.

1. cat file01.vob file02.vob >newfile.vob

2. mpgjoin file01.vob file02.vob -o newilfe.vob

3. mpgcat file01.vob file02.vob -o newilfe.vob

4. mpgtx -j file01.vob file02.vob -o newfile.vob

You can also look into GOPChop and/or DVBCut,

vobcopy -i /path/to/ripped/dvd/files/VIDEO_TS -n1 -l -o /path/to/put/files/file.vob

^^ -i = input path. The complete path
-n = title number, if your not sure, use lsdvd or vobcopy -i /path/VIDEO_TS -I
-l enables large file support.
-o is the path to output the files.
You can also use vobcopy to rip from the DVD driver.

Realmedia (rm) to mp3 conversion in Linux

mplayer file.rm -ao pcm:file=file.wav

lame -f file.wav file.mp3

I wrote a quick script to convert rm to mp3 and copied it to /usr/local/bin
so that it can be run from any directory.
Here's the commands to do that.

$ vim rmtpmp3

#------------------------------------------
#!/bin/sh
mplayer $1 -ao pcm:file=temp.wav
lame -f temp.wav $1.mp3
rename 's/\.rm\.mp3/\.mp3/' *.rm.mp3
rm temp.wav

#-----------------------------------------

$ chmod 755 rmtomp3
$ su
$ cp rmtomp3 /usr/local/bin

dS as FRW

deSitter spacetime in the representation as a spatially flat
Robertson-Walker universe, its metric is



See eqn. 3.24 of Ford : arXiv:gr-qc/9707062v1

These coordinates cover one-half of the full deSitter space, but this is not a serious
problem for our purposes. But in the context of inflationary models, one is interested
in spacetimes which involve only a piece of deSitter space.See for example Kima, Oh and Park ( arXiv:hep-th/0212326v1 ) for discussion on relation between dS and FRW.