Sunday, January 26, 2014

Kindle the fire

After a lot of efforts and fights with my laziness I have finally made a Facebook page Filter #9891409100. Though I am yet to add some content in it, but as they say it -
The first step is the biggest step.
So, it's still a long way till the page has some reasonable amount of content.
This is also kind of a step to fight my laziness, but I don't know how will I fare in this. Though what I am getting is as for fighting laziness something more basic is required, what I call is personal Fire.
People only work or becomes a doer (that reminds me of a great book The Path of a Doer) only when there is a fire within them or on their backs. When one works either they ignite the fire within them or somebody else sets their back on fire. As simple as that. But people set others back on fire usually for their own needs, seldom for helping others. Another problem of working with fire in the back is that it may not provide satisfaction. When people are not satisfied they start doing crazy things, like driving a car at 120kmph just because they are bored(sorry for the reference if you are reading it) or dive into mindless consumption of stuffs on the internet. But in the end we are the one who's losing.
Anyways, I have started the page with the hope of kindling the fire and each time I post there I will try to post some elaboration here in the blog. That's it for now.

Thursday, July 12, 2012

Locks in NFS, migrating to NFSv4, nobody:nogroup problem

The file lock handling mechanism is not very well in nfsv3. But for a long time this did not cause much problem in our lab setup, debian squeeze with nfs and nis, mainly because there weren't much students and such programs were not used that use locks. But things changed, and use of openoffice and iceweasel increased. Both the softwares create a lock file in the user's home directory and use exclusive locks on them. This caused frequent problems. When all the people are using any one the two software at the same time for some of them it worked and for others the software would just hang at startup. What actually used to happen is that after allowing a certain number of lock requests nfs would just make other requests wait, thereby hanging the programs.

When googling this site popped up-
http://www.crazysquirrel.com/computing/debian/servers/setting-up-nfs4.jspx
They were also facing the problem with locks and upgrading to NFSv4 solved it. So I decided to give it a try using the tutorial of crazysquirrel and ubuntu community documentation.

The setup of the server went smoothly. But configuring client did not went so smooth.

First of all, all directories and files on the client mounted from server using nfs are owned by uid/gid 4294967294:4294967294. Fixing that was easy because, it's already given there in ubuntu help.

In /etc/default/nfs-common set
NEED_IDMAPD=yes
and restart nfs-common
invoke-rc.d nfs-common restart

That solved uid/gid = 4294967294:4294967294 but now they are being shown as nobody:nogroup. Though this is also mentioned in ubuntu help, but their fix was not working.

Then in syslog(/var/log/syslog) I found idmapd was giving some errors.

rpc.idmapd[xxxx]: nss_getpwnam: name: 'username@domainname' does not map into domain 'localdomain'

So, here idmapd was trying to map the usernames to domain localdomain.
What I found in /etc/idmapd.conf this was written -
[General]
Verbosity = 0
Pipefs-Directory = /var/lib/nfs/rpc_pipefs
Domain = localdomain

[Mapping]
Nobody-User = nobody
Nobody-Group = nogroup

This Domain = localdomain was forcing idmapd to domain name localdomain. So I tried changing Domain to the domain of the lab. That did the trick and nfs was now working perfectly in all the other machines.

Saturday, September 10, 2011

Configuring Wacom Bamboo Pen and Touch(CTH-460) in Debian squeeze

Recently bought a Wacom bamboo pen and touch after searching many places. Here in Kolkata It was not available in the shop of Ganesh Avenue and Chandni Chowk. Most of them have never heard the name Wacom. In Supreme Computers only bamboo pen model was available. I was searching for pen and touch model because this 1024 levels of pressure sensitivity while the pen model has only half of it. Finally I got it in imagine store at salt lake city center.

I after i bought it I thought of giving it a try in my Debian squeeze. I searched for guides in the net but none of them was sufficient for squeeze. After trying for 2 days I got it working.

First of all the current kernel of squeeze (2.6.32-5) does not have driver of this model. So the kernel module need to compiled and xserver-xorg-input-wacom (0.10.5) does not support this as said here . So that is also need to be compiled.

As said in linuxwacom wiki for kernels between 2.6.26 - 2.6.36 you need to download the input-wacom driver. I downloaded input-wacom-0.11.1.tar.bz2 which is the latest one as of now.

Before compiling we need to install the build tools. So, do

$sudo aptitude install build-essential xorg-dev autoconf libtool
Get kernel version using
$uname -a
Then install,
$sudo aptitude install linux-headers-
Do,
$tar xjvf input-wacom-0.11.1.tar.bz2
$cd input-wacom-0.11.1
To compile
$./autogen.sh --prefix=/usr --libdir=/usr/lib  # for 32bit installations
or
$./autogen.sh --prefix=/usr --libdir=/usr/lib64  # for 64bit installations
This will generate wacom.ko. Now copy it to the default kernel modules location. Before that the previous wacom.ko at
/lib/modules/`uname -r`/kernel/drivers/input/tablet/wacom.ko can be backed-up.

$sudo cp ./2.6.30/wacom.ko /lib/modules/`uname -r`/kernel/drivers/input/tablet/wacom.ko
$sudo depmod -a
Now if the tablet is connected it gets attached to some /dev/input/eventX , one for pen and another one for touch. This can be seen using,
$dmesg|tail
But to use it in applications xorg driver also must be installed.
For this I downloaded xf86-input-wacom-0.11.1.tar.bz2. The latest one can be downloaded from here.
Before compiling this we need to install xutils-dev which provides xorg-macros.
$sudo aptitude install xutils-dev.
Now to compile the wacom input driver for X.
First,
$tar -xvf xf86-input-wacom-0.11.1.tar.bz2
$cd xf86-input-wacom-0.11.1
Then
$./configure --prefix=/usr --libdir=/usr/lib # for 32bit $installations
or
$./configure --prefix=/usr --libdir=/usr/lib64 # for 64bit installations
After that

$make
$make install
After installing the driver, restart X (by logging out and then logging in or by restarting the computer).

Now we need to configure X before we can actually use it.
First rename existing wacom configuration /usr/share/X11/xorg.conf.d/20-wacom.conf. The file 50-wacom.conf in xorg.conf.d is copied by xf86-input-wacom, that should be kept intact. If there are any files of wacom in /etc/udev/rules.d/ rename them.

Now create a new file 52-wacom-options.conf in /usr/share/X11/xorg.conf.d/
with the following content:
Section "InputClass"
 Identifier "Wacom Bamboo Presscurve and Area configurations"
 MatchProduct "Wacom BambooFun 2FG 4x5 Pen"
 MatchDevicePath "/dev/input/event*"

# Apply a custom configuration options. Any option will # also apply to all dependent devices, if applicable. So # e.g. the pressure curve
will be available on the      # stylus and the eraser (but not on the pad).
 Option "PressCurve" "0 10 90 100"
 Option "TopX" "0"
 Option "TopY" "0"
 Option "BottomX" "14720"
 Option "BottomY" "9200"
EndSection

Section "InputClass"
 Identifier "Wacom Bamboo Finger Area configuration"
 MatchProduct "Wacom BambooFun 2FG 4x5 Finger"
 MatchDevicePath "/dev/input/event*"

 # Apply custom Options to this device below.
 Option "TopX" "0"
 Option "TopY" "0"
 Option "BottomX" "480"
 Option "BottomY" "320"
EndSection

This is just copied form linuxwacom wiki custom options may be changed. See man wacom for details.
Now the bambooPT will work.
Here is picture drawn using it on GIMP by Gopal.

Thursday, March 17, 2011

Enable root login in GDM3

Recently, Debian has Released their next stable version (version 6) codename squeeze.
So, I updated my computer from lenny to squeeze. This has updated GDM to GDM3 the next generation
gnome display manager (as they say it).
But after that I'm missing the old GDM. Its themes, the old gdmsetup tool, and event the option to allow
login of local administrator. I had tried changing /etc/gdm3/daemaon.conf by adding a line AllowRoot=true
in the [Security] section.But without any help.

Today, i was checking the files given in the man of gdm3.
There is a file /etc/pam.d/gdm3
In it there is line that contains "user != root quiet_success"
Removing the "user != root" from that did the trick and I was able to login as root user in GDM3.

Wednesday, July 28, 2010

Update 28 Jul

Again failing to post topics and my assignments I said previously to post.
These days I am particularly busy with an assignment to implement a small dbms. Though a big task doing it as a part by part assignment. Hoping to post all my previous assignments, but main problem i am facing is where to upload the programs. I used ensips for my previous uploads but esnips is not working here at my univ as flash is blocked.
Any way that's for today.

Wednesday, July 21, 2010

GDB guide

Today I found a good short and quick introduction to gdb here.

This is a short preview of it -

Help Commands
help commandGet help on a certain command
apropos keywordSearch help for a particular keyword
Starting and Quitting
gdb [-tui] [-c core] [exename](Unix Command) Start gdb on an executable or standalone; specify "-tui" to start the TUI GUI; specify "-c" with a corefile name to see where a crash occurred
run [arg1] [arg2] [...]Run the currently loaded program with the given command line arguments
quitExit the debugger
file exenameLoad an executable file by name
Breakpoints and Watchpoints
break locationSet a breakpoint at a location, line number, or file (e.g. "main", "5", or "hello.c:23")
watch expressionBreak when a variable is written to
rwatch expressionBreak when a variable is read from
awatch expressionBreak when a variable is written to or read from
info breakDisplay breakpoint and watchpoint information and numbers
info watchSame as info break
clear locationClear a breakpoint from a location
delete numDelete a breakpoint or watchpoint by number
Stepping and Running
nextRun to the next line of this function
stepStep into the function on this line, if possible
stepiStep a single assembly instruction
continueKeep running from here
CTRL-CStop running, wherever you are
finishRun until the end of the current function
advance locationAdvance to a location, line number, or file (e.g. "somefunction", "5", or "hello.c:23")
jump locationJust like continue, except jump to a particular location first.
Examining and Modifying Variables
display expressionDisplay the value of a variable or expression every step of the program—the expression must make sense in the current scope
info displayShow a list of expressions currently being displayed and their numbers
undisplay numStop showing an expression identified by its number (see info display)
print expressionPrint the value of a variable or expression
printf formatstr expressionlistDo some formatted output with printf() e.g. printf "i = %d, p = %s\n", i, p
set variable expressionSet a variable to value, e.g. set variable x=20
set (expression)Works like set variable
Window Commands
info winShows current window info
focus winnameSet focus to a particular window bby name ("SRC", "CMD", "ASM", or "REG") or by position ("next" or "prev")
fsAlias for focus
layout typeSet the window layout ("src", "asm", "split", or "reg")
tui reg typeSet the register window layout ("general", "float", "system", or "next")
winheight valSet the window height (either an absolute value, or a relative value prefaced with "+" or "-")
whAlias for winheight
set disassembly-flavor flavorSet the look-and-feel of the disassembly. On Intel machines, valid flavors are intel and att
Misc Commands
RETURNHit RETURN to repeat the last command
backtraceShow the current stack
btAlias for backtrace
attach pidAttach to an already-running process by its PID
info registersDump integer registers to screen
info all-registersDump all registers to screen

Monday, July 19, 2010

After One Year...

Almost one year have passed since my college ended and I came to this new University.I don't know what have I really done during this time.Sometimes I feel I may have changed during this time.But things have not changed much though.

I said earlier that I would post here more frequently than ever, but something never change so easily.

By the way, I have only posted my programs from my first term. Posting programs from 4 terms is pending hoping to post that soon.

I know nobody reads this blog, but I am thinking to post things here just to practice writing.

Oh well. Thats for now...

Saturday, October 17, 2009

My works of 1st term

1.Logbook ADT - create an abstract data type for logbook.[download]
2.JParse -
JParse evaluates user expression till exit command.It supports variables.
operators:
()
/,*
+,-
<,>
!=,==
||
&&
=

Op:
jparse> 10-15/5
result: 7
jparse> b=1
result=1
jparse> a=b&&0
result=0
[download]

3.Program on Scheme
a)Binary Search Tree
b)List sum using lazy evaluation
c)Set operations:equal? , union , intersection.[download]
d)Breath First Search [download]

4.Weighted graph [download]
5.HashTable in java [download]
6.Jparse with exceptions to catch errors [download]
7.Presentation on Perl
part1
part2
example of my and local variables.[download]
A program that reads csv file an output it.[download]

8.Program to simulate given dfa.[download]
9.Program of cyk algorihtm. [download]

10.8 queen problem.[download]
11.combination generating.[download]
12.Square root.[download]
13.program in prolog to get listlength.[download]

All these are tested working under debian 5.

That's it for now.

Another thing wishing everyone Happy Diwali.

Friday, September 25, 2009

Puja Vacation

After the exams the puja vacations have started.

Now a bit of free time to chill.

So I am uploaing all my assignments on net.

BTW happy puja to all.

Sunday, September 06, 2009

At last

At last after a long time I have decided to post to my blog.
I was thinking about this for a long time but the problem was taking the first step.

It's been quite a while till my last post ,about seven months.Many things have changed in this duration.Many unexpected things also have happened.

Currently studying at Ramakrishna Mission Vivekananda University with M.Sc. in Computer Science.So I get very little time in doing all this.Yet I have decided to post on my blog as much as possible, though I think it would not be much but more than my previous posting frequency.

I hope I can post more.
So till my next post bye all.

Saturday, January 03, 2009

Happy New Year


Hello everybody out there.
A new year have come again.
Like every year the last year also rushed away and only a few of our resolutions have been implemented in our life.
But never the less a new year means new hope new resolutions(again).
So lets hope for the best cause this year is a crucial year for me.As it will decide my future.