sudo NOPASSWD in ubuntu

In Ubuntu, do

1. sudo visudo
2. Go to the last line and add
username  ALL=(ALL) NOPASSWD: ALL


I could not change the default editor to use vim by exporting the EDITOR variable. I had to use nano only, which has some quirks like it asks you the save in DOS Format or Mac Format ( I choose Mac). Btw, while using uxterm, you cannot use nano editor, because the Meta key is  bound by uxterm and you wont be able to save it. I had to xfce4-terminal to do the first step. Phew!

Installing VirtualBox Guest additions on Ubuntu Guest

1. Mount the cdrom from within the Guest OS, so that the guest additions will be available.

sudo mount /dev/cdrom /mount/cdrom

2. There is a VBoxGuestAdditions.bin script which you will have to execute.


Accessing the Shared Folder. From the VirtualBox Interface, a select folder in your Host Operating System as the folder which you would like to share on the Guest OS.

Remember the name of the shared folder and access it from within the Ubuntu Guest OS like this.

sudo mount -t vboxsf  sharedfoldername mountpoint


Twice I made a mistake of typing vboxfs instead of vboxsf , so be careful with the spelling.


Virtualbox Tip (Ubuntu Host, Windows Guest)

Accessing a Shared Folder from a Windows Guest

On Windows guests, the shared folder should appear as a standard Windows network share listed under VirtualBox Shared Folders, accessible from the Network option in the Start menu. If the shared folder is not visible within the Network window (as can sometime be the case), it may be mapped to a disk drive in a command prompt window by issuing the following command:

net use : \\vboxsvr\

where : represents the drive letter to be mapped to the shared folder and > is the name assigned to the shared folder during the creation process outlined above. For example, to map a shared folder named TempFiles to the S: drive on the guest operating system:
C:\Users\vbox> net use s: \\vboxsrv\TempFiles
The command completed successfully.

My Ubuntu Install

  1. Install Ubuntu using Ubuntu mini iso
  2. sudo aptitude install xorg
  3. sudo aptitude install ratpoison
  4. sudo aptitude install build-essential checkinstall
  5. sudo aptitude install vim
  6. sudo aptitude install subversion
  7. sudo aptitude install chromium-browser
  8. sudo aptitude install mutt
  9. sudo aptitude install ssh
  10. sudo aptitude install socat
  11. sudo aptitude install msmtp
  12. sudo aptitude install fetchmail
  13. sudo aptitude install virtualbox-ose
  14. sudo aptitude install flashplugin-nonfree
  15. sudo aptitude install openssl ca-certificates
  16. sudo aptitude install procmail and follow http://ubuntuforums.org/showthread.php?t=565326
  17. sudo aptitude install alsa and alsactl init
  18. sudo aptitude install xfonts-terminus-oblique xfonts-terminus-dos xfonts-terminus console-terminus
  19. sudo aptitude install irssi
  20. sudo aptitude install ttf-inconsolata
  21. sudo aptitude install fortune fortunes
  22. search and run google-repo-setup.sh
  23. sudo aptitude install picasa
  24. sudo aptitude install cowsay xcowsay
  25. sudo visudo and then write senthil ALL=NOPASSWD: ALL
  26. sudo aptitude install urlview
  27. sudo aptitude install xscreensaver xscreensaver-data                                                               

Making xterm beautiful

I thought it was not possible. I was pleasantly surprised to be proved wrong.

Do the following steps.

sudo aptitude install ttf-inconsolata

Open your .Xresources file and type


XTerm*faceName: Inconsolata
XTerm*faceSize: 16


Do an

xrdb -merge .Xresources

Thanks to levin, this answered my question on "What's there in a font and why are so many of them?" very well.

Remote empty directories

find -depth -type d -empty -exec rmdir {} \;

Jump in and Code



Complete the Projects which you want to do.

Cyanogen Mod Upgrade on ADP2

Android 1.6 OS
Dimension (LxWxTmm) 113 x 55.56 x 14.65
Display Size 3.17
HVGA Resolution
Capacitive touch screen
512MB FLASH Memory
192MB RAM
MSM7200A,528MHz chipset
GSM/GPRS/EDGE Quad band
850/900/1800/1900 MHz
WCDMA 1700/2100 MHz : BC4
2100 MHz : BC1
HSPA Speed HSDPA 7.2 Mbps
HSUPA 2 Mbps
Blutooth 2.0 with EDR
WiFi 802.11b/g
3MP Auto Focus Camera
1340 Battery(mAh)
microSD Memory Slot
USB 2.0
GPS/AGPS
Mailing list
----
ADP2 is SAPPHIRE PVT 32B DEV S-ON G
HBOOT-1.33.3007 (SAPP30000)
CPLD-10
RADIO-2.22.19.26I
Sep 25 2009, 16:22:56
----
PVT32B handsets have 192MB total RAM (96MB usable by OS) and use the Qualcomm MSM7201A CPU.
----

Follow the instructions here:
http://wiki.cyanogenmod.com/index.php?title=Full_Update_Guide_-_HTC_Magic_(32B)

startopenbox

When using Ratpoison, I have F8 set to openbox Window Manager.
This is what my settings are. I do a startopenbox.sh to load the second window manager.

File: openbox.xinitrc

xrdb -load $HOME/.Xresources
xsetroot -solid gray &
feh --bg-scale /home/senthil/sentosa.jpg &
xclock -g 50x50-0+0 -bw 0 &
xterm &
openbox


File: startopenbox.sh

#!/bin/bash
xinit ./openbox.xinitrc -display :1 -- :1 2>/dev/null & 

Any Advice for young programmers ?


Wired.com: Any advice for young programmers?
Stroustrup: I guess giving advice is easy compared to taking it. Know your fundamentals (algorithms, data structures, machine architecture, systems) and know several programming languages to the point where you can use them idiomatically.
Know some non-computer field of study well — math, biology, history, optics, whatever. Learn to communicate effectively in speech and in writing. Spend an unreasonable amount of time on some difficult topic to really master it. Try to do something that might make a difference in the world.


Read More http://www.wired.com/thisdayintech/2010/10/1014cplusplus-released/all/1#ixzz12dSGVsJC

Bjarne Stroustrup's old interview

Computer: I know you've been heavily involved in the C++ standards process, but what other projects are you involved in currently and how will you continue working to evolve C++?

Stroustrup:  I'm suffering from having successfully completed a very large project. The ISO C++ standard is done. The third edition of The C++ Programming Language is there to acquaint serious programmers with what Standard C++ has to offer and how best to use it. And The Design and Evolution documents the design decisions that shaped C++. There is more to be done, but nothing that requires a full-time language designer. Now is the time to enjoy the flexibility and power of C++ by writing code, rather than focusing on possible changes.

Apart from that, I'm taking the opportunity to learn a few things-a couple of new languages and something about how software is used in a large business-and planning some experiments in distributed computing.

C++ Standard Library

Computer: How was the Standard Library defined and what impact will it have on the C++ community?

Stroustrup: The most novel and interesting part of the standard library is the general and extensible framework for containers and algorithms. It is often called the STL and is primarily the work of Alex Stepanov (then at Hewlett-Packard Labs, now at Silicon Graphics).


Alex worked on providing uncompromisingly general and uncompromisingly efficient fundamental algorithms which, for example, find an element in a data structure, sort a container, or count the occurrences of a value in a data structure. Such algorithms are fundamental to much computing.

recording script using recordmydesktop command

#!/bin/bash
#
# Warning: this does not have robust error checking!

bad=67
if [ $# -lt 1 ]
then
echo "Usage: $0 [filename] [[optional time]]"
exit $bad
fi

if [ $# -eq 1 ] #check for arguments
then
time=3 #if one (only filename) exists, sleep for 3 seconds
filename=$1 #set filename
else
time=$2 #else, we'll sleep for $2 seconds
filename=$1 #set filename
fi

recordmydesktop -windowid `xwininfo |grep "Window id:"|sed -e "s/xwininfo\:\ Window id:\ //;s/\ .*//"` -o $filename.ogv -delay $time --no-sound

ffmpeg -i $filename.ogv -b 384000 -s 640x480 -pass 1 -passlogfile log-file $filename.flv

SSH - Swiss Army Knife

Doing remote file operations using SSH is covered well in this link: http://ultra.ap.krakow.pl/~bar/DOC/ssh_backup.html

Download Picasaweb Album on Linux

Using this project: http://sourceforge.net/projects/picasaalbumdown/

Direct download to Picasa does not work. It works on Windows.

James Gosling on Development of Java


James Gosling:So long as they do that. The development of Java is not an inexpensive thing. It takes a fair amount of funding. It's not just about writing code. Learning the code is two or three percent of the expense. You're shipping fifteen million copies a week, just the bandwith is horrible. The QA when you have to worry about something that has thirty issues. When you've got everything, every stock exchange, every phone company on the planet. Their security depends on Java. So it's not a causual piece of testing.

You know, when it comes to open source contributions, our history with contributions over the years have been kinda snarky. We'd get lost of people sending code and fixes. But on average, we'd get a submission that fixed the bug but it caused three or four more. And it probably didn't fix the bug for everybody. It probably only fixed the bug for their one case. And trying to get people in the community to actually think about the whole code base and not just their particular issue today. Doing one line of change means an immense amount of testing.

Most open source projects are way too casual for that. Sometimes when you get bugs that are potential security issues, you have to move fast, you have to put immense resources on getting it done. Maybe it's just one engineer fixing one character in one line, but then testing it and making sure you didn't introduce a bug. The harder stuff is if you have a bug, there are probably people out there who have worked around that bug, so how many of the workarounds are you going to break. And when you've got nine or ten million in the developer community you have enormous applications, trivial fixes are not trivial. And open source projects, the way the average open source projects are constituted. IT's easy to get people to do the fun stuff. It's hard to get people to do the hard stuff.

Like QAing the math libraries. Like doing QA on sine and cosine, you absolutely have to have a PHd in Mathematics. Sine and cosine: it sounds really simple, but there is unbelievable amount of depths of subtlety in there. There are extraordinarily few people on the planet qualified to QA that type of stuff.

http://www.basementcoders.com/transcripts/James_Gosling_Transcript.html

Quote HTML Function in python

def _quote_html(html):
return html.replace("&", "&").replace("<", "<").replace(">", ">")

Android Dev Phone 1

For all purposes, it is same as HTC Dream or G1

Additional X Server on Ubuntu

xinit -display :n+1 -- :n+1

-bash: /bin/ls: Argument list too long

In bash, doing a
ls *-output.log
on directory containing 7000 files fails with the error

-bash: /bin/ls: Argument list too long

The best way to go about with this is:

find . -name '*-output.log' | xargs ls -l