Tuesday, April 28, 2009

love imap for a short while

saw this script and literally fell in love with it ;).. just changed the interpreter to /usr/bin/python,
./imap.py -a -e --server "IMAPSERVER:993" -u "MyID" -f "INBOX/OPENSOURCE/Linux-OMAP" and bingo give my password and it saves the entire folder as INBOX.OPENSOURCE.Linux-OMAP.mbox -> search in vi for ^From: and bingo you can copy entire patch files for git am to use.. ;)

meanwhile you can easily split the mbox to maildir (multiple files) using mbox2maildir

[Update] I thought it was a good idea, instead of trusting msexchange wordwrapping everything around... I am pretty darn irritated and switched to using mutt instead :(.. except I am DUMB.. i could have used the 'e' and saved what i see where ever i wanted it to be... :(... mutt is pretty darn easy!! all i needed to do was setup a ~/.muttrc as follows:

set realname='Name'
set from="Name <MAILID@SOME.COM>"
set imap_user="ID"
set imap_pass=Password

set folder="{IMAPSERVER:993/ssl}"
set postponed="=postponed"
set record="=Sent Items"
set spoolfile="=INBOX/OPENSOURCE/Linux-OMAP"
set mailcap_path="~/.mailcap"
set sendmail="/usr/sbin/sendmail -oem -oi"

and it is done.. mutt worked with my mail transmitter configured using postfix ;)

Friday, April 24, 2009

Synergy cool swapping b/w desktops

I have a windows laptop and a ubuntu desktop sitting next to each other and i would like to use my keyboard and mouse accross both without switching accross... here is the solution: SYNERGY!!!

step 1 - ubuntu:
sudo apt-get install synergy
vim ~/.synergy.conf
section: screens
section: links
right = linuxserver
left = winlaptop

Winlaptop is the name of my windows machine -> ipconfig /all should show the HOSTNAME for the same. linuxlaptop is the name of my machine without all the .x.y.z suffix.. Note the left and right depends on where your laptop and desktop sits.. suite which ever you want.. you can have multiple boxes if you like too... just sync them up in the config above..

next you need to get synergy start up when your login happens, you can do it multiple ways -> the one i did was to setup a short cut in my desktop for use when i want it.. - the short cut is to "synergys --config synergy.conf"

Now on windows, go here and download the exe. once you install, setup the "Use another computer's shared keyboard and mouse (client): " as linuxlaptop (full domain name)..

Start the server on linux and then click on start on windows and voila, switching your machines is as simple as turning your head.... for the lazy characters ;)..

mail reply styles

> it is interesting why you write at the end of the email?
> is this an email style?
There are three styles of email replies that I follow:
a) Follow bottom posting -> this is used by most linux opensource community: http://www.arm.linux.org.uk/mailinglists/etiquette.php#e3
b) For internal emails with respect to a topic, I retain top posting - since it can get forwarded to others who have no clue about the previous discussions, as bottom posting will remove the previous mail context.
c) Mix of both - esp in internal email discussions -> this is when there is multiple responses -> in which case, I copy the contents of the email and paste it again in body of my reply to it. This allows:
i) for people interested in the discussion to get the exact context of my reply without having to refer to the mailchain below to remember what they said..
ii) for people who get the email forwarded to get a context of the email by reading the previous chain..

general style I follow for opensource emails is:

> Original email
> some info
My reply
> some other info
My reply with a link [1]
Nishanth Menon
[1] url to the webpage I refered to

The above format allows for people using Braille or mail to text readers to not listen to conversion of http://someotherpalce/asdasd/asdasdasda.... while listening to the context.. I am just being nice ;)..

Thursday, April 09, 2009

simpler alternative to minicom

Tired of setting up and switching ports in minicom and want something simple? welcome to picocom

setup a script such as ~/bin/ttyUSB0
picocom -f n -p n -b 115200 -i -r -l /dev/ttyUSB0

and next time, just run ttyUSB0 and viola u have a terminal.. ctrl+a followed by ctrl+q quits..

mtd partitions in u-boot

With the recent merge of mtdparts patch for beagleboard u-boot

Texas Instruments X-Loader 1.4.2 (Jan 30 2009 - 19:16:17)
Loading u-boot.bin from nand

U-Boot 2009.03-00325-gf75a729 (Apr 09 2009 - 13:36:05)

OMAP3530-GP rev 2, CPU-OPP2 L3-165MHz
OMAP3 Beagle board + LPDDR/NAND
DRAM: 256 MB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Board revision C
Die ID #0a8600030000000004013f780600a00e
OMAP3 beagleboard.org #

you can now do cool things without having to remember the offsets of which partition was where.... (lets say you want to copy the kernel to nand flash)

Step1: setup the partitions

OMAP3 beagleboard.org # mtdparts default

Step 2: erase the nand flash for kernel partition

OMAP3 beagleboard.org # nand erase kernel

NAND erase: device 0 offset 0x280000, size 0x400000
Erasing at 0x660000 -- 100% complete.

Step 3: copy the kernel from RAM to the kernel partition in nand flash:

OMAP3 beagleboard.org # nand write 0x80000000 kernel

NAND write: device 0 offset 0x280000, size 0x400000
4194304 bytes written: OK

and you are done..
lets say you want to copy the kernel from flash back to ram....
OMAP3 beagleboard.org # nand read 0x80000000 kernel

NAND read: device 0 offset 0x280000, size 0x400000
4194304 bytes read: OK

oh and if you want to checkout what are the available partitions, then:
OMAP3 beagleboard.org # mtdparts

device nand0 , # parts = 5
#: name size offset mask_flags
0: x-loader 0x00080000 0x00000000 0
1: u-boot 0x001e0000 0x00080000 0
2: u-boot-env 0x00020000 0x00260000 0
3: kernel 0x00400000 0x00280000 0
4: fs 0x0f980000 0x00680000 0

active partition: nand0,0 - (x-loader) 0x00080000 @ 0x00000000

mtdids : nand0=nand
mtdparts: mtdparts=nand:512k(x-loader),1920k(u-boot),128k(u-boot-env),4m(kernel),-(fs)

See http://www.denx.de/wiki/DULG/UBootCmdGroupFlash#UBootCmdFlMtdparts for more info

Tuesday, April 07, 2009


The following instructions are for 2.6.28 linux omap pm branch + tidspbridge
Few links:
* http://gitorious.org/projects/tidspbridge/repos/mainline - TIDSP Bridge codebase
* http://patchwork.kernel.org/project/linux-omap/list/?q=DSP - pending patches on linux-omap mailing list
* http://git.kernel.org/?p=linux/kernel/git/khilman/linux-omap-pm.git;a=summary - kevin's tree for Power management

git clone git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git
cd linux-omap-pm
git checkout -b pm-2.6.28 --track origin/pm-2.6.28
git checkout -b tidspbridge
git pull git://gitorious.org/tidspbridge/mainline.git tidspbridge-pm-2.6.28

make omap_3430sdp_defconfig

for powermanagement:
CONFIG_MPU_BRIDGE=m or y which ever is your preference..
enable BRIDGE_DVFS as y
make uImage;make modules

and bingo you should have arch/arm/mach-omap2/dspbridge.ko and arch/arm/mach-omap2/dspbridge.ko if you have dspbridge as a a module ;)...

insmod dspbridge.ko
insmod bridgedriver.ko shm_size=0x400000 phys_mempool_base=0 base_img=baseimage.dof should have the bridge driver running with a baseimage..

[Update: As Ragha mentioned in his comment, the other way would be to set up a reserved memory using mem=XYZM and allocate the remaining memory as statically allocated memory to the bridge driver -> there is a linux-omap post somewhere which I need to dig up for details :( ]

(okay, i need to figure out where baseimage.dof or other dofs can be got from.. but checkout the pointers felipe says here: http://elinux.org/BeagleBoard/DSP_Howto)