Tuesday, April 17, 2012

Eat Food, Not too much, Mostly Plants

Recently read a very nice book on Food "In defense of food" by Michael Pollan. It is a wonderful book. As the author says, I also had a confusion on what to eat. There were contradictory advises from different corners, for example, some say dont eat fatty food while some one else says fats are alright. This book gives a very good description of how to go about in choosing ones food. A very good read.

The following gives a summary of what he says. However, in order to understand these ideas properly, one should read the book.


  1. Dont eat anything your great grandmother wont recognize as food.
  2. Avoid food products containing ingredients that are 
    1. unfamiliar
    2. unpronounceable 
    3. more than five in number
    4. in includes high fructose corn syrup
  3. Avoid food products that make health claims.
  4. Shop the peripheries of the super market and stay out of the middle.
  5. Eat mostly plants, especially leaves.
  6. Eat well grown food from healthy soils.
  7. Eat wild foods if you can.
  8. Take supplements.
  9. Eat like traditional Indians/French/Japanese/....
  10. Be careful about non traditional foods.
  11. Have a glass of wine with dinner.
  12. Consult your gut. I remember the Indian saying: Eat food half the stomach, fill one quarter with water and leave the rest empty.
  13. Eat slowly.
  14. Cook and plant a garden if you can.
I am sure, one has to read the book to make sense out of the above. I strongly recommend reading this book.

Monday, August 9, 2010

using tmpnam is dangerous. Use mkstemp

Whenever I used tmpnam my g++ compiler cribbed that its dangerous to use tmpnam and must use mkstemp. But mkstemp returned file id and as my language is C++, i never knew how to use the C file ids with C++ fstreams. Then I found out from the man page of fstream that,


explicit basic_ofstream(int fd);
explicit basic_ofstream(const char *s,
ios_base::openmode mode =
ios_base::out,
long protection = 0666);

I was familiar with the second usage but the first usage was new to me...So one can easily use ofstream with mkstemp as shown below.

char *tmpFileName= strdup("/tmp/tmpfileXXXXXX");
if(mkstemp(tmpFileName) == -1)
throw runtime_error("temporary file cannot be created");
ofstream out(tmpFileName);

Enjoy C++

Thursday, August 5, 2010

C/C++ interface for gnuplot

I think the C interface by N.Devillard is great! I just used it in my C++ code and it worked like a charm!

Please checkout gnuplot interfaces in ANSI C.

I also tried Gnuplot-iostream interface but somehow that did not work for me....

git

It was a big relief to see git. At last, I need not maintain a central repository and the git commands seemed so simple....

Once I went back to an older version - alas, all the later versions were lost. After reading some books in git, I realised that I should have branched from an older version. Thus if you are planning to experiment, it is better to branch to a new branch and experiment. If the experiment is successful, you can merge back into main stream. So easy!

The branch command is:

git branch branch_name tag_name(or commit hash)

to checkout the branch

git checkout branch_name

It is extremely comfortable to checkout branch and then merge into...

git merge for merging and for visualization of log, one can use
git log --graph --pretty=oneline --abbrev-commit

Now the eclipse git plugin provides branche/merge etc...making life more comfortable!

Thank you Linus Torvalds

Wednesday, January 13, 2010

How to display mathematica on a local ubuntu machine

When I first ran mathematica, I got the following errors in the server machine.
xset: bad font path element (#23), possible causes are:
Directory does not exist or has wrong permissions
Directory missing fonts.dir
Incorrect font server address or syntax

This problem can be solved very easily by doing the following in your local linux machine. This is what I did.


  1. Download and install mathematica fonts from
    here on your local machine.

  2. execute the following commands in local machine.
    xset fp+ /your_mathematica_fonts_directory/Fonts/Type1
    xset fp rehash

  3. ssh to your mathematica server using -X option and type mathematica at the command prompt.


  4. You can stop reading this blog at this point, because this is enough for you to go. However some interesting stuff is available below.

  5. Steps 2 and 3 must be executed every time you want to run mathematica.

  6. May be, you would prefer to write a script to do all this so that in one click you get into the server. My script (which I have named mathematica) is given below


  7. #!/bin/bash
    xset fp+ /your_fonts_directory/Fonts/Type1
    xset fp rehash
    ssh your_login_id@your_mathematica_server -X mathematica

  8. You may be wondering that you will need to type the server account password every time. You need not do that. If you follow the instructions in this link, you can set up an rsa public key and avoid typing password.

  9. Thus with the above steps, with a single command or click you can run mathematica on your ubuntu desktop !

  10. Enjoy

Friday, January 1, 2010

A student's creativity

The following concerns a question in a physics degree exam at the University of Copenhagen:

"Describe how to determine the height of a skyscraper using a barometer."

One student replied:

"You tie a long piece of string to the neck of the barometer, then lower the barometer from the roof of the skyscraper to the ground.

The length of the string plus the length of the barometer will equal the height of the building."

This highly original answer so incensed the examiner that the student was failed.

The student appealed on the grounds that his answer was indisputably correct, and the university appointed an independent arbiter to decide the case.

The arbiter judged that the answer was indeed correct, but did not display any noticeable knowledge of physics.

To resolve the problem it was decided to call the student in and allow him six minutes in which to provide a verbal answer which showed at least a minimal familiarity the basic principles of physics.

For five minutes the student sat in silence, forehead creased in thought.

The arbiter reminded him that time was running out, to which the student replied that he had several extremely relevant answers, but couldn't make up his mind which to use.

On being advised to hurry up the student replied as follows:

"Firstly, you could take the barometer up to the roof of the skyscraper, drop it over the edge, and measure the time it takes to reach the ground.

The height of the building can then be worked out from the formula H = 0.5g x t squared. But bad luck on the barometer."

"Or if the sun is shining you could measure the height of the barometer, then set it on end and measure the length of its shadow.

Then you measure the length of the skyscraper's shadow, and thereafter it is a simple matter of proportional arithmetic to work out the height of the skyscraper."

"But if you wanted to be highly scientific about it, you could tie a short piece of string to the barometer and swing it like a pendulum, first at ground level and then on the roof of the skyscraper.

The height is worked out by the difference in the gravitational restoring force T = 2 pi sq root (l / g)."

"Or if the skyscraper has an outside emergency staircase, it would be easier to walk up it and mark off the height of the skyscraper in barometer lengths, then add them up."

"If you merely wanted to be boring and orthodox about it, of course, you could use the barometer to measure the air pressure on the roof of the skyscraper and on the ground, and convert the difference in millibars into feet to give the height of the building."

"But since we are constantly being exhorted to exercise independence of mind and apply scientific methods, undoubtedly the best way would be to knock on the janitor's door and say to him, 'If you would like a nice new barometer, I will give you this one if you tell me the height of this skyscraper'."

The student was Niels Bohr from Denmark who won the Nobel prize for Physics.

Tuesday, December 29, 2009

Your weakness could be your real strength!

A 10-year-old boy decided to study judo despite the fact that he had lost his left arm in a devastating car accident. The boy began lessons with an old Japanese judo master. The boy was doing well, so he couldn't understand why, after three months of training the master had taught him only one move.

"Sensei," the boy finally said, "Shouldn't I be learning more moves?"
"This is the only move you know, but this is the only move you'll ever need to know," the sensei replied.

Not quite understanding, but believing in his teacher, the boy kept training. Several months later, the sensei took the boy to his first tournament.

Surprising himself, the boy easily won his first two matches.
The third match proved to be more difficult, but after some time, his opponent became impatient and charged; the boy deftly used his one move to win the match.

Still amazed by his success, the boy was now in the finals. This time, his opponent was bigger, stronger, and more experienced. For a while, the boy appeared to be overmatched. Concerned that the boy might get hurt, the referee called a time-out. He was about to stop the match when the sensei intervened. "No," the sensei insisted, "Let him continue."

Soon after the match resumed, his opponent made a critical mistake: he dropped his guard. Instantly, the boy used his move to pin him. The boy had won the match and the tournament. He was the champion. On the way home, the boy and sensei reviewed every move in each and every match. Then the boy summoned the courage to ask what was really on his mind.

"Sensei, how did I win the tournament with only one move?"
"You won for two reasons," the sensei answered. "First, you've almost mastered one of the most difficult throws in all of judo. And second, the only known defense for that move is for your opponent to grab your left arm."

The boy's biggest weakness had become his biggest strength.

"Sometimes we feel that we have certain weaknesses and we blame god, the circumstances and our self for it but we never know that our weakness can become our strength one day. Each of us is special and important, so never think you have any weakness, never think of pride or pain, just live your life to its fullest and extract the best out of it!"

The Mayonnaise Jar and 2 Cups of Coffee

When things in your lives seem almost too much to handle, when 24 hours in a day are not enough, remember the mayonnaise jar and the 2 cups of coffee.



A professor stood before his philosophy class and had some items in front of him. When the class began, he wordlessly picked up a very large and empty mayonnaise jar and proceeded to fill it with golf balls. He then asked the students if the jar was full. They agreed that it was.



The professor then picked up a box of pebbles and poured them into the jar. He shook the jar lightly. The pebbles rolled into the open areas between the golf balls. He then asked the students again if the jar was full. They agreed it was.



The professor next picked up a box of sand and poured it into the jar. Of course, the sand filled up everything else. He asked once more if the jar was full. The students responded with a unanimous "yes."



The professor then produced two cups of coffee from under the table and poured the entire contents into the jar effectively filling the empty space between the sand.

The students laughed.



"Now," said the professor as the laughter subsided,"I want you to recognize that this jar represents your life. The golf balls are the important things - your family, your children, your health, your friends and your favorite passions - and if everything else was lost and only they remained, your life would still be full.



The pebbles are the other things that matter like your job, your house and your car.



The sand is everything else - the small stuff. "If you put the sand into the jar first," he continued, "there is no room for the pebbles or the golf balls. The same goes for life. If you spend all your time and energy on the small stuff you will never have room for the things that are important to you. "Pay attention to the things that are critical to your happiness. Play with your children. Take time to get medical checkups. Take your spouse out to dinner. Play another 18.



There will always be time to clean the house and fix the disposal. Take care of the golf balls first-the things that really matter. Set your priorities. The rest is just sand."



One of the students raised her hand and inquired what the coffee represented. The professor smiled. "I'm glad you asked. It just goes to show you that no matter how full your life may seem, there's always room for a couple of cups of coffee with a friend."

Why It Is So Hard To Let Go

The cheerful girl with bouncy golden curls was almost five. Waiting
with her mother at the checkout stand, she saw them: a circle of
glistening white pearls in a pink foil box.

"Oh please, Mommy. Can I have them? Please, Mommy, please?" Quickly
the mother checked the back of the little foil box and then looked back
into the pleading blue eyes of her little girl's upturned face. "A
dollar ninety-five. That's almost $2.00. If you really want them, I'll
think of some extra chores for you and in no time you can save enough
money to buy them for yourself. Your birthday's only a week away and you
might get another crisp dollar bill from Grandma."

As soon as Jenny got home, she emptied her penny bank and counted out
17 pennies. After dinner, she did more than her share of chores and she
went to the neighbor and asked Mrs. McJames if she could pick dandelions
for ten cents.

On her birthday, Grandma did give her another new dollar bill and at
last she had enough money to buy the necklace.
Jenny loved her pearls. They made her feel dressed up and grown up.
She wore them everywhere - Sunday school, kindergarten, even to bed. The
only time she took them off was when she went swimming or had a bubble
bath. Mother said if they got wet, they might turn her neck green.

Jenny had a very loving daddy and every night when she was ready for
bed, he would stop whatever he was doing and come upstairs to read her a
story. One night when he finished the story, he asked Jenny, "Do you
love me?" "Oh yes, Daddy. You know that I love you." "Then
give me your pearls." "Oh, Daddy, not my pearls. But you can have Princess - the
white horse from my collection. The one with the pink tail. Remember,
Daddy? The one you gave me. She's my favorite." "That's okay, Honey.
Daddy loves you. Good night." And he brushed her cheek with a kiss.

About a week later, after the story time, Jenny's daddy asked again,
"Do you love me?" "Daddy, you know I love you." "Then give me your
pearls." "Oh Daddy, not my pearls. But you can have my baby doll. The
brand new one I got for my birthday. She is so beautiful and you can
have the yellow blanket that matches her sleeper." "That's okay. Sleep
well. God bless you, little one. Daddy loves you" And as always, he
brushed her cheek with a gentle kiss.

A few nights later when her daddy came in, Jenny was sitting on her
bed with her legs crossed Indian-style. As he came close, he noticed
her chin was trembling and one silent tear rolled down her cheek. "What is
it, Jenny? What's the matter?" Jenny didn't say anything but lifted her
little hand up to her daddy. And when she opened it, there was her
little pearl necklace. With a little quiver, she finally said, "Here,
Daddy. It's for you."

With tears gathering in his own eyes, Jenny's kind daddy reached out
with one hand to take the dime-store necklace, and with the other hand
he reached into his pocket and pulled out a blue velvet case with a
strand of genuine pearls and gave them to Jenny. He had them all the
time. He was just waiting for her to give up the dime-store stuff so he
could give her genuine treasure.

So it is with our Heavenly Father. He is waiting for us to give up the
cheap things in our lives so that he can give us beautiful treasure.

Isn't God good?

Are you holding onto things which God wants you to let go of. Are you
holding on to harmful or unnecessary relationships, habits and
activities which you have come so attached to that it seems impossible
to let go? Sometimes it is so hard to see what is in the other hand but
do believe this one thing.............

God will never take away something without giving you something better

Anger and Love have no limits

While a man was washing his new car, his 4 year old son picked stone & scratched lines on the side of the car.

In anger, the man took the child's hand & hit it many times, not realizing he was using a wrench.

At the hospital, the child lost all his fingers due to multiple fractures. When the child saw his father....with painful eyes he asked 'Dad when will my fingers grow back?'

Man was so hurt and speechless. He went back to car and kicked it a lot of times.

Devastated by his own actions..... . sitting in front of that car he looked at the scratches, child had written 'LOVE YOU DAD'.

The next day that man committed suicide. . .

Anger and Love have no limits, Choose the later to have a beautiful & lovely life....

Things are to be used and people are to be loved, But the problem in today's world is that People are used and things are loved.......

You are important for others

One day a teacher asked her students to list the names of the
other students in the room on two sheets of paper, leaving a
space between each name.

Then she told them to think of the nicest thing they could say about
each of their classmates and write it down.

It took the remainder of the class period to finish their assignment,
and as the students left the room, each one handed in the papers.

That Saturday, the teacher wrote down the name of each
student on a separate sheet of paper, and listed what everyone
else had said about that individual.

On Monday she gave each student his or her list. Before long, the
entire class was smiling. 'Really?' she heard whispered. 'I
never knew that I meant anything to anyone!' and, 'I didn't
know others liked me so much,' were most of the comments.

No one ever mentioned those papers in class again. She
never knew if they discussed them after class or with their
parents, but it didn't matter. The exercise had accomplished
its purpose. The students were happy with themselves and one
another. That group of students moved on.

Several years later, one of the students was killed in Vietnam and
his teacher attended the funeral of that special student.
She had never seen a serviceman in a military coffin before. He looked so handsome,
so mature.

The church was packed with his friends. One
by one those who loved him took a last walk by the coffin. The
teacher was the last one to bless the coffin.

As she stood there, one of the soldiers who acted as pallbearer
came up to her. 'Were you Mark's math teacher?' he asked. She
nodded: 'yes.' Then he said: 'Mark talked about you a
lot.'

After the funeral, most of Mark's former classmates went together
to a luncheon. Mark's mother and father were there, obviously
waiting to speak with his teacher.

'We want to show you something,' his father said, taking a wallet
out of his pocket 'They found this on Mark when he was
killed. We thought you might recognize it.'

Opening the billfold, he carefully removed two worn pieces of
notebook paper that had obviously been taped, folded and
refolded many times. The teacher knew without looking that
the papers were the ones on which she had listed all the good
things each of Mark's classmates had said about him.

'Thank you so much for doing that,' Mark's mother said. 'As
you can see, Mark treasured it.'

All of Mark's former classmates started to gather around. Charlie
smiled rather sheepishly and said, 'I still have my list. It's
in the top drawer of my desk at home.'

Chuck's wife said, 'Chuck asked me to put his in our wedding
album.'

'I have mine too,' Marilyn said. 'It's in my
diary'

Then Vicki, another classmate, reached into her
pocketbook, took out her wallet and showed her worn and
frazzled list to the group. 'I carry this with me at all
times,' Vicki said and without batting an eyelash, she
continued: 'I think we all saved our lists'

That's when
the teacher finally sat down and cried. She cried for Mark and
for all his friends who would never see him again.

The density of people in society is so thick that we forget that
life will end one day. And we don't know when that one day
will be. So please, tell the people you love and care for,
that they are special and important. Tell them, before it is
too late.

Saturday, December 19, 2009

A simple illustration on Boost::any

#include <iostream>
#include <vector>

#include <boost/any.hpp>

using namespace
std;
using namespace
boost;

int
main(){

vector<any> v1, v2;

v1.push_back(5);

v1.push_back('a');

v2.push_back(10);

v2.push_back(string("Amma"));

copy(v2.begin(),v2.end(),back_inserter(v1));

for
(vector<any>::size_type i = 0; i < v1.size(); i++){

if
(char * pc = any_cast<char>(&v1[i])) cout << *pc << endl;

else if
(int * pi = any_cast<int>(&v1[i])) cout << *pi << endl;

else if
(string * ps = any_cast<string>(&v1[i])) cout << *ps << endl;
}
}


Sunday, October 25, 2009

sound in dell studio 1550 (Ubuntu 9.04)

Struggled a lot with sound play back in dell studio 1550 with ubuntu 9.04. Finally it was solved with just one line in the /etc/modprobe.d/alsa-base.conf

options snd-hda-intel model=dell-m6.

How to make skype working?

Read the link http://www.pulseaudio.org/wiki/PerfectSetup

Sunday, July 5, 2009

Recursively removing empty directories using python


#!/usr/bin/python
import os
from os.path import join
def remEmptyDir(mypath):
for root, dirs, files in os.walk(mypath,topdown=False):
for name in dirs:
fname = join(root,name)
if not os.listdir(fname): #to check wither the dir is empty
print fname
os.removedirs(fname)

remEmptyDir('/home/suresh/photos')

Wednesday, March 25, 2009

Some LaTeX tips

1. How to typeset Exercise questions and answers in LaTeX?

Use the exercise package. It is available in texlive package in Ubuntu. The following customizations were done by me for typesetting it like a faq. The following would remove unnecessary frills from the typeset document.
\renewcommand{\ExerciseListName}{Que}

\renewcommand{\ExerciseListHeader}{\ExerciseHeaderDifficulty%
\textbf{\ExerciseListName\ExerciseHeaderNB%
\quad\ExerciseHeaderTitle}%
\ExerciseHeaderOrigin\ignorespaces}

\renewcommand{\AnswerListHeader}{\textbf{Answer\quad}}



2. How to include multiple authors in bibtex author field?

Use "and" between author names. For example,

@Book{stein2005,
author = {Elias M. Stein and Rami Shakarchi},
title = {Real Analysis},
publisher = {Princeton University Press},
year = {2005}
}


3. Using svn, svn-multi and eclipse

The documentation given in
 http://www.tug.org/pracjourn/2007-3/scharrer/scharrer.pdf

is excellent but one should be careful of the following:
  1. When you use the 'svn propset' command as mentioned, if you cut and paste from the pdf file be careful. The commas may not translate properly into the text terminal and I had to waste a lot of time in identifying this.
  2. The fink package that comes with ubuntu 8.04 is outdated. You may have to get the latest ones from say CTAN.
  3. If you do commit within eclipse, it does not work (unfortunate :( ). I had to commit from command line.
  4. Be careful to use \svnfilerev,\svnfileday,\svnfilemonth,\svnfileyear,\svnhour,\svnfileminute etc if you want the svn revision data belonging to each file to appear. If you omit the file keyword in the above commands you will only get the latest revision number and date, considering all your files together. If you want the details regarding the revision of each file to be kept (say as footer or so) use the commands with 'file' present in them.


    4. Referencing
I have been using fancyref. But I think cleveref is a much better package. The package and documentation are available from CTAN

Wednesday, February 18, 2009

Directory size listing

The following python code lists the subdirectories and files of the given directory in the descending order of their size.

#!/usr/bin/python
import os

# this function returns the size of the given directory or file.

def getDirectorySize(directory):
if os.path.isfile(directory):
return os.path.getsize(directory)
dir_size = 0
for (path, dirs, files) in os.walk(directory):
for file in files:
filename = os.path.join(path, file)
try:
dir_size += os.path.getsize(filename)
except OSError:
pass #to manage for exampling a missing link etc
return dir_size

#this function lists the directory contents of the
#given directory by calling getDirectorySize(directory)
#to get the size of each directories

def getDirectorySizeListing(directory):
filesize = {}
dir = os.listdir(directory)
os.chdir(directory)
for item in dir:
sz = getDirectorySize(item)/2**20 #for converting into megabytes
if sz: filesize[item] = sz

#to sort the dictionary based on values
from operator import itemgetter
filesize = sorted(filesize.iteritems(),key=itemgetter(1),reverse=True)

return filesize

#application code
d = "/home/suresh/"
x = getDirectorySizeListing(d)
for i,val in enumerate(x):
print val

Monday, January 26, 2009

How to use Reliance Data Card (ZTE modem) in linux

Reliance provides the necessary driver for windows but could not get any help in using the data card in linux from reliance web site. Spending half a day with info from various blogs I could set it up.

My operating system : Ubuntu 8.04, Data Card: Reliance, zte modem

Steps:

  • Make sure that the modem is detected by kernel.
  • Make sure that appropriate devices are created by the kernel
  • wvdialconf to get intial set up.
  • Additional commands to be inserted into the /etc/wvdial.conf file
  • You are done!

Is modem detected by kernel?

$ cat /proc/bus/usb/devices

You should get something like this:

:

T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 7 Spd=12 MxCh= 0
D: Ver= 1.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=16 #Cfgs= 1
P: Vendor=19d2 ProdID=fffd Rev= 0.00
S: Manufacturer=ZTE, Incorporated
S: Product=ZTE CDMA Tech
S: SerialNumber=Serial Number

C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA

:

If you do not get, this means that your modem is not recognised by linux.

If modem is not detected by linux kernel?

This section taken from Imtiaz Shabuz

sudo gedit /etc/init.d/mountdevsubfs.sh

and uncomment following lines from this file.

# Magic to make /proc/bus/usb work
mkdir -p /dev/bus/usb/.usbfs
domount usbfs “” /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount –rbind /dev/bus/usb /proc/bus/usb

Now start the service

/etc/init.d/mountdevsubfs.sh start and reboot your pc.

Then check if the USB device is detected properly

cat /proc/bus/usb/devices

The above output should be shown.

Now probe for this USB device
modprobe usbserial vendor=0×19d2 product=0×fffd

Now you can type $dmesg command and see if devices are created. For me they were, /dev/ttyUSB0, /dev/ttyUSB1 and, /dev/ttyUSB.

You may better enter the following in your /etc/modules file and reboot the machine.

usbserial vendor=0×19d2 product=0×fffd

After rebooting connect the card, the devices would be present.

Modem is recognized and devices created, then?

use wvdialconf to create the initial /etc/wvdial.conf .

Edit the /etc/wvdial.conf file and fill in the following entries:

Phone = #777

Username = your_phone_number

Password = your_password

Stupid Mode = 1
(For me, it didnt work without adding Stupid Mode = 1. The reliance ppp server on the remote side does not give login prompt unless we start ppp on the local machine)

You are done!!! type wvdial and ppp interface would be ready now!!!


Saturday, August 30, 2008

How to print to a windows printer from linux

I have been struggling to set this up. I found a nice tutorial in the Internet.

Printer Sharing: Windows Print Server for Linux Clients

In short, the steps are

  1. Enable Windows support for Unix printing: Open Control Panel --> Add or remove programs --> Add/remove windows components. Scroll down to "Other Network File & Print Services".icon Highlight that and select "details". Put a check mark in "Print Services for Unix" and OK/Next or whatever.
  2. Now that Unix services are installed, you activate them as a service: Open Control Panel --> Administrative Tools --> Services (Local) and find icon TCP/IP print server. It should be set to "Status= started" and "Start type=Automatic". To change settings you double click the line "TCP/IP print server" and adjust appropriately.
  3. Install CUPS and use lpd.
  4. You should be able to fire a test page from your linux machine.
I tested it from my ubuntu 8.04 to a windows XP machine having a HP LaserJet printer.

Wednesday, July 9, 2008

to Ubuntu from Debian

I was a strong debian user. Have been using it for the last 11 years. But then I moved to Ubuntu last week :)

All this started when I found ruby to be very interesting. As usual, I was an emacs fan and used emacs for ruby too. Problems came when I wanted to install some lisp package for rails support. The new package said, it will work with only emacs 22.

Ok, got an emacs22 backport but then it wont work with auctex, my favorite latex support package for emacs.

Installed eclipse. But then rdt and Aptana studio and radrails are not working. Downloaded the latest eclipse and tried the same..still not working...

It was then my friends said, they are using eclipse with Ubuntu.

In one day moved to Ubuntu.......after living with Debian for around 11 years :(

Had to spent a day for configuring my apps...I think it was worth. To quote my learned friend, "Ubuntu is better for developers while debian stable may be used for big servers". Thats it.

I think moving to ubuntu was a good choice....

:)
suresh

How to archive outgoing emails

Archiving incoming mails in a linux system is easily done with procmail. This article shows how to archive outgoing emails.

It is easy whether you have postfix or sendmail as your mail transport agent.

With Postfix

There is an option named "always_bcc". You may set it like this:

always_bcc = your_email_address.

In fact the above will archive all incoming and outgoing emails.

With sendmail

There is a tool called mimedefang. You can just add something like this in the /etc/mimedefang-filter, in the filter_begin function.

sub filter_begin {
#bcc to gmail
add_recipient( 'your bcc email address' );

:
: the remianing code without modification


The mimedefang approach archives only the outgoing emails.

The sendmail approach was tested in debian etch and the postfix based on one ubuntu 8.04.

suresh