Blogger gave me hell trying to post this, so I asked techno_freak to post it for me, on his blog; which he kindly agreed to :)
Thanks dude.
Here's the link to the post:
http://technofreakatchennai.wordpress.com/2007/01/19/newlines-and-sed/
Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts
Sunday, January 21, 2007
Wednesday, January 17, 2007
Console Locking
I stumbled upon this today:
* app-misc/vlock
Available versions: 1.3-r1 1.3-r2
Istalled: none
Homepage: ftp://ftp.ibiblio.org/pub/Linux/utils/console/
Description: A console screen locker
Pretty handy stuff. You can lock just the current console with vlock -c. That's quite basic. I liked the vlock -a option. It locks all the consoles. You can't even switch them using Alt+Ctrl+F* keys. Pretty handy.
* app-misc/vlock
Available versions: 1.3-r1 1.3-r2
Istalled: none
Homepage: ftp://ftp.ibiblio.org/pub/Linux/utils/console/
Description: A console screen locker
Pretty handy stuff. You can lock just the current console with vlock -c. That's quite basic. I liked the vlock -a option. It locks all the consoles. You can't even switch them using Alt+Ctrl+F* keys. Pretty handy.
Saturday, November 04, 2006
Two Birds with One Stone!
I had this problem with KDM while I was using amd64 on this Sempron64 machine. KDM would work fine for a while and then would become very slow on startup. By slow, I mean nearly 20 seconds. The NVIDIA logo would show up, followed by a blank screen with a busy mouse pointer in the middle. Normally, this screen would last only for a couple of seconds and KDM would show up. But here, it would keep showing for all of those 20 seconds. After that KDM would appear. During the blank screen period, there would a lot of disk activity.
The problem was very irritating. But I never bothered to solve it on that system.
I replaced the amd64 system with x86 last month. KDM had been fine till the start of this week. Then came the same problem. 20 seconds to start up. Very frustating. Today, I actually went on about investigating it. So here's how it went.
First of all, I needed to check the 'span' of the problem. I had had an X server crash today (Beryl and NVIDIA beta.. "Shit happens" ;-)). I noticed that after the crash, KDM started up normally, in no time at all. I logged out and the same thing happened. It started up normally. So apparently, the problem was only with the initial startup.
I next checked if KDM was the last thing starting on bootup, just to make sure that it isn't some other init script that starts up after KDM that causes this. After a few changes using rc-update and a reboot or two, I managed to conclude that the problem was with KDM itself.
Next, I removed xdm from the runlevel. Logged in as root and tried to run xdm. No go. No X and this in Xorg.0.log:
(II) Loader running on linux
(II) LoadModule: "bitmap"
(WW) Warning, couldn't open module bitmap
(II) UnloadModule: "bitmap"
(EE) Failed to load module "bitmap" (module does not exist, 0)
(II) LoadModule: "pcidata"
(WW) Warning, couldn't open module pcidata
(II) UnloadModule: "pcidata"
(EE) Failed to load module "pcidata" (module does not exist, 0)
Fatal server error:
Unable to load required base modules, Exiting...
(WW) xf86CloseConsole: KDSETMODE failed: Bad file descriptor
(WW) xf86CloseConsole: VT_GETMODE failed: Bad file descriptor
Ok. That didn't actually come as a surprise. I was unable to start that init script manually on the amd64 system either. X wouldn't start, syslog saying that VT7 was not available. I had ignored this too, back then. Well, I decided to fix it today.
I don't know why, but I opened up /etc/conf.d/xdm file. I didn't even know it existed before this. I found this in the file:
# Tell X to always start on VT7. Otherwise it autodetects the first available
# VT, which means it has to wait until all gettys are started so it doesn't suck
# up a VT that should have had a login prompt (very slow).
# If XSTATICVT is on, the login manager will start as soon as possible during
# the boot process. If you want X to dynamically start on the first unoccupied
# VT after all gettys have started and you are using xdm, also remove the "vt7"
# from /etc/X11/xdm/Xservers.
XSTATICVT="yes"
I changed XSTATICVT to no and issued a /etc/init.d/xdm start and behold! X started up fine. But, again, KDM took a lifetime to start.
This time though, I was already logged in on tty1. I switched to it and ran top while KDM was in that blank screen phase. I could see kdm_greet eating away at the CPU all the while the blank screen was displayed. I stopped the xdm init script and launched it again. KDM startup was normal this time. So the culprit was found. kdm_greet did something on the first startup that it didn't have to do on the subsequent startups..
Here's the solution that popped up: http://www.mail-archive.com/debian-qt-kde%40lists.debian.org/msg10087.html
Nice (!). A simple fc-cache -sv and a reboot and I could see the problem solved! The title of this post justified!
You know, its nice to play Sherlock Holmes sometimes.
Btw, big thanks to SimAtWork in #kde for helping me with the KDM issue. He/she was the one that gave me the link to the solution. :-D
The problem was very irritating. But I never bothered to solve it on that system.
I replaced the amd64 system with x86 last month. KDM had been fine till the start of this week. Then came the same problem. 20 seconds to start up. Very frustating. Today, I actually went on about investigating it. So here's how it went.
First of all, I needed to check the 'span' of the problem. I had had an X server crash today (Beryl and NVIDIA beta.. "Shit happens" ;-)). I noticed that after the crash, KDM started up normally, in no time at all. I logged out and the same thing happened. It started up normally. So apparently, the problem was only with the initial startup.
I next checked if KDM was the last thing starting on bootup, just to make sure that it isn't some other init script that starts up after KDM that causes this. After a few changes using rc-update and a reboot or two, I managed to conclude that the problem was with KDM itself.
Next, I removed xdm from the runlevel. Logged in as root and tried to run xdm. No go. No X and this in Xorg.0.log:
(II) Loader running on linux
(II) LoadModule: "bitmap"
(WW) Warning, couldn't open module bitmap
(II) UnloadModule: "bitmap"
(EE) Failed to load module "bitmap" (module does not exist, 0)
(II) LoadModule: "pcidata"
(WW) Warning, couldn't open module pcidata
(II) UnloadModule: "pcidata"
(EE) Failed to load module "pcidata" (module does not exist, 0)
Fatal server error:
Unable to load required base modules, Exiting...
(WW) xf86CloseConsole: KDSETMODE failed: Bad file descriptor
(WW) xf86CloseConsole: VT_GETMODE failed: Bad file descriptor
Ok. That didn't actually come as a surprise. I was unable to start that init script manually on the amd64 system either. X wouldn't start, syslog saying that VT7 was not available. I had ignored this too, back then. Well, I decided to fix it today.
I don't know why, but I opened up /etc/conf.d/xdm file. I didn't even know it existed before this. I found this in the file:
# Tell X to always start on VT7. Otherwise it autodetects the first available
# VT, which means it has to wait until all gettys are started so it doesn't suck
# up a VT that should have had a login prompt (very slow).
# If XSTATICVT is on, the login manager will start as soon as possible during
# the boot process. If you want X to dynamically start on the first unoccupied
# VT after all gettys have started and you are using xdm, also remove the "vt7"
# from /etc/X11/xdm/Xservers.
XSTATICVT="yes"
I changed XSTATICVT to no and issued a /etc/init.d/xdm start and behold! X started up fine. But, again, KDM took a lifetime to start.
This time though, I was already logged in on tty1. I switched to it and ran top while KDM was in that blank screen phase. I could see kdm_greet eating away at the CPU all the while the blank screen was displayed. I stopped the xdm init script and launched it again. KDM startup was normal this time. So the culprit was found. kdm_greet did something on the first startup that it didn't have to do on the subsequent startups..
Here's the solution that popped up: http://www.mail-archive.com/debian-qt-kde%40lists.debian.org/msg10087.html
Nice (!). A simple fc-cache -sv and a reboot and I could see the problem solved! The title of this post justified!
You know, its nice to play Sherlock Holmes sometimes.
Btw, big thanks to SimAtWork in #kde for helping me with the KDM issue. He/she was the one that gave me the link to the solution. :-D
Saturday, September 23, 2006
Another step closer to "Bye bye Windows!"
Alright. Wine is seriously cool! The only problem is that it takes a LOT of time to compile and it took out nearly 400MB from my /usr!!
Anyway, its way too cool to cry about all that.
The thing is, Guitar Pro 5 works great in wine. All I needed to do was to install timidity++. I had to go ~amd64 on it, because the current stable 2.13.2 didn't compile. I was not in a mood to debug it, so I just changed the keywords and the testing version 2.13.2-r2 worked perfectly. I went with the default timidity-eawpatches.
Next came wine. It failed during ./configure because /usr/X11R6/lib/libGL.a existed, which, from what the error message said, prevented linking against the OpenGL libs. I thought of going -opengl for wine, but then felt like experimenting and moved the libGL.a file somewhere else. libGL.la exists in the same location anyway. Wine got installed fine then.
Once, done with winecfg, I launched the Guitar Pro installer with winelauncher. It installed fine, even with that RSE thing selected.
With RSE however, it doesn't play the sound properly. I had to remove RSE and it worked perfectly. Also, do not touch the Change Skin button in GP5. Trashed mine. Plus of course, the Windows Volume Control button doesn't work, which is kinda obvious.
I have slight performance problems when a KDE notification pops up while playing a file in GP5. But that's a minor. Maybe I wouldn't have the problem if I disabled XGL. Who knows?
Anyway, so there I am. Another step closer to "Bye bye Windows!". The only thing that remains now, is running Pro Evolution Soccer on Linux and this will be a single boot box of Gentoo! :D
Anyway, its way too cool to cry about all that.
The thing is, Guitar Pro 5 works great in wine. All I needed to do was to install timidity++. I had to go ~amd64 on it, because the current stable 2.13.2 didn't compile. I was not in a mood to debug it, so I just changed the keywords and the testing version 2.13.2-r2 worked perfectly. I went with the default timidity-eawpatches.
Next came wine. It failed during ./configure because /usr/X11R6/lib/libGL.a existed, which, from what the error message said, prevented linking against the OpenGL libs. I thought of going -opengl for wine, but then felt like experimenting and moved the libGL.a file somewhere else. libGL.la exists in the same location anyway. Wine got installed fine then.
Once, done with winecfg, I launched the Guitar Pro installer with winelauncher. It installed fine, even with that RSE thing selected.
With RSE however, it doesn't play the sound properly. I had to remove RSE and it worked perfectly. Also, do not touch the Change Skin button in GP5. Trashed mine. Plus of course, the Windows Volume Control button doesn't work, which is kinda obvious.
I have slight performance problems when a KDE notification pops up while playing a file in GP5. But that's a minor. Maybe I wouldn't have the problem if I disabled XGL. Who knows?
Anyway, so there I am. Another step closer to "Bye bye Windows!". The only thing that remains now, is running Pro Evolution Soccer on Linux and this will be a single boot box of Gentoo! :D
Friday, August 18, 2006
fsck automatically on reboot
Here's a nice little trick I found.
I had a couple of hard reboots, due to power failures and I wanted to have all the ext3 filesystems in my fstab to be checked during the next reboot. Here's what I did.
There's an option in tune2fs, -C, which allows one to manually set the mount count for an ext2/3 filesystem. By default, on my Gentoo installation, all the ext3 filesystems are checked automatically after 38 mounts or 180 days, whichever happens earlier. By using tune2fs, one can set the mount count of a filesystem to be greater than this value and the filesystem will be automatically checked when the system boots up next time..
I did a
tune2fs -C 50
for all the ext2/3 filesystems in my fstab and they were all checked upon the next reboot.
Another way of doing this would be to change number of days since the filesystem was last checked to be greater than that value of 180. This can be done with the -T option of tune2fs.
In case you're wondering, you can change the default values of the mount count or the day limit using the -c and -t options to tune2fs respectively. As always, check man tune2fs for details ;)
I had a couple of hard reboots, due to power failures and I wanted to have all the ext3 filesystems in my fstab to be checked during the next reboot. Here's what I did.
There's an option in tune2fs, -C, which allows one to manually set the mount count for an ext2/3 filesystem. By default, on my Gentoo installation, all the ext3 filesystems are checked automatically after 38 mounts or 180 days, whichever happens earlier. By using tune2fs, one can set the mount count of a filesystem to be greater than this value and the filesystem will be automatically checked when the system boots up next time..
I did a
tune2fs -C 50
for all the ext2/3 filesystems in my fstab and they were all checked upon the next reboot.
Another way of doing this would be to change number of days since the filesystem was last checked to be greater than that value of 180. This can be done with the -T option of tune2fs.
In case you're wondering, you can change the default values of the mount count or the day limit using the -c and -t options to tune2fs respectively. As always, check man tune2fs for details ;)
Tuesday, August 15, 2006
4294967294
Alright, by far the most amusing thing I've seen recently.
r00723r0 comes into #gentoo-amd64 complaining about his init scripts failing to start due to "too many links" in /var/lib/init.d.
Now, here's the fun and how people neglect the most basic of things..
So me and some other people in the channel take him on a tour that included re-emerging of baselayout, editing config files properly (especially /etc/conf.d/rc), checking the system clock, making his bash handle some pipelines.. ("find / -print 2>/dev/null | xargs ls -ld | tr -s ' ' | sort -t ' '+1 | head -n 50 | less" courtsey of codermattie) and a few reboots. Nothing works. We even wondered about a misconfigured kernel. But nope.
So then comes the most basic of things that was needed to be done. A simple ls -lR into /var/lib revealed this gem...
drwxr-xr-x 4294967294 root root 4096 Aug 15 06:26 init.d
And here's the response it got in the channel..
[Tue Aug 15 2006] [15:46:36] [r00723r0] i'm pretty sure it's my kernel
[Tue Aug 15 2006] [15:46:43] [floyd_n_milan] look at that link count on /var/lib/init.d!
[Tue Aug 15 2006] [15:46:49] [floyd_n_milan> drwxr-xr-x 4294967294 root root 4096 Aug 15 06:26 init.d
[Tue Aug 15 2006] [15:46:54] [r00723r0] wtf???
[Tue Aug 15 2006] [15:47:00] [r00723r0] how do i fix it
[Tue Aug 15 2006] [15:47:07] [codermattie] holy poo !
[Tue Aug 15 2006] [15:47:10] [codermattie] that's it !
[Tue Aug 15 2006] [15:47:15] [floyd_n_milan] yeah LOL
[Tue Aug 15 2006] [15:47:17] [r00723r0] wow
[Tue Aug 15 2006] [15:47:19] [r00723r0] lol
[Tue Aug 15 2006] [15:47:24] [r00723r0] owned
[Tue Aug 15 2006] [15:47:30] [codermattie] man, that's the freakin 32 bit limit !
[Tue Aug 15 2006] [15:47:35] [r00723r0] haha
[Tue Aug 15 2006] [15:47:38] [r00723r0] oops?
Right. So the simple solution was to boot from a livecd and do an fsck.jfs on that filesystem...
[Tue Aug 15 2006] [15:59:21] [r00723r0] AHHH
[Tue Aug 15 2006] [15:59:30] [r00723r0] incorrect link counts have been detected
[Tue Aug 15 2006] [15:59:35] [r00723r0] will correct
Yes!
So from now on, please remember to do the simple and the most basic things first :P Oh yeah, and always, always, be very very careful with etc-update!!! ;)
I must say though that, the origins of that 4294967294 are definitely worth exploring. :D
P.S. Here's the comment r00723r0 left on the original livejournal entry:
The origin is from me rebooting (obviously during fsck) because I forgot to compile in framebuffer support.
Nice post, might be my home page for a while :P
r00723r0 comes into #gentoo-amd64 complaining about his init scripts failing to start due to "too many links" in /var/lib/init.d.
Now, here's the fun and how people neglect the most basic of things..
So me and some other people in the channel take him on a tour that included re-emerging of baselayout, editing config files properly (especially /etc/conf.d/rc), checking the system clock, making his bash handle some pipelines.. ("find / -print 2>/dev/null | xargs ls -ld | tr -s ' ' | sort -t ' '+1 | head -n 50 | less" courtsey of codermattie) and a few reboots. Nothing works. We even wondered about a misconfigured kernel. But nope.
So then comes the most basic of things that was needed to be done. A simple ls -lR into /var/lib revealed this gem...
drwxr-xr-x 4294967294 root root 4096 Aug 15 06:26 init.d
And here's the response it got in the channel..
[Tue Aug 15 2006] [15:46:36] [r00723r0] i'm pretty sure it's my kernel
[Tue Aug 15 2006] [15:46:43] [floyd_n_milan] look at that link count on /var/lib/init.d!
[Tue Aug 15 2006] [15:46:49] [floyd_n_milan> drwxr-xr-x 4294967294 root root 4096 Aug 15 06:26 init.d
[Tue Aug 15 2006] [15:46:54] [r00723r0] wtf???
[Tue Aug 15 2006] [15:47:00] [r00723r0] how do i fix it
[Tue Aug 15 2006] [15:47:07] [codermattie] holy poo !
[Tue Aug 15 2006] [15:47:10] [codermattie] that's it !
[Tue Aug 15 2006] [15:47:15] [floyd_n_milan] yeah LOL
[Tue Aug 15 2006] [15:47:17] [r00723r0] wow
[Tue Aug 15 2006] [15:47:19] [r00723r0] lol
[Tue Aug 15 2006] [15:47:24] [r00723r0] owned
[Tue Aug 15 2006] [15:47:30] [codermattie] man, that's the freakin 32 bit limit !
[Tue Aug 15 2006] [15:47:35] [r00723r0] haha
[Tue Aug 15 2006] [15:47:38] [r00723r0] oops?
Right. So the simple solution was to boot from a livecd and do an fsck.jfs on that filesystem...
[Tue Aug 15 2006] [15:59:21] [r00723r0] AHHH
[Tue Aug 15 2006] [15:59:30] [r00723r0] incorrect link counts have been detected
[Tue Aug 15 2006] [15:59:35] [r00723r0] will correct
Yes!
So from now on, please remember to do the simple and the most basic things first :P Oh yeah, and always, always, be very very careful with etc-update!!! ;)
I must say though that, the origins of that 4294967294 are definitely worth exploring. :D
P.S. Here's the comment r00723r0 left on the original livejournal entry:
The origin is from me rebooting (obviously during fsck) because I forgot to compile in framebuffer support.
Nice post, might be my home page for a while :P
Thursday, August 10, 2006
Kubuntu on HP NX6125
Right.. that went great :D
Now I would have lost had I given up halfway through the process..
Oh, I'm talking about Linux right now. I was installing Kubuntu on this HP/Compaq NX6125 laptop. I got very much frustrated halfway through the installation because of the damned 3D acceleration. What happened is, during the initial upgrading of packages, apt installed a new version of the kernel 2.6.15-26-386. This version didn't have the linux-restricted-modules package associated with it. As a result, even with a proper 'aticonfig' version of the xorg.conf, I didn't get direct rendering. The simple solution was to boot with the older 2.6.15-23-386 kernel, which had the restricted modules installed.
Once direct rendering was working, I simply followed the wiki instructions and went on to install XGL and compiz. That was risk, because I had no idea whether XGL worked on the ATI Radeon XPRESS 200M 5955 (PCIE) card on the laptop. It turned out that XGL ran fine. Now that's pleasure! All the night's hard work bore fruit and what a fruit!
So now I'm off to edit the wiki page for Gentoo and update the Radeon XPRESS 200M 5955 (PCIE) section. And since I haven't slept the whole night, working on this thing for 12 hours straight and its nearly 7 am, I'll go to bed.. or maybe get some breakfast and then go to bed.
Btw, these links will definitely prove useful if you're installing Linux on this laptop:
Updates from HP: http://h18007.www1.hp.com/support/files/hpcpqnk/us/locate/64_6170.html#0
Kubuntu on NX6125: http://wuestenleer.de/ku/index.html
Gentoo on NX6125: http://gentoo-wiki.com/HARDWARE_HP_Compaq_nx6125
Now I would have lost had I given up halfway through the process..
Oh, I'm talking about Linux right now. I was installing Kubuntu on this HP/Compaq NX6125 laptop. I got very much frustrated halfway through the installation because of the damned 3D acceleration. What happened is, during the initial upgrading of packages, apt installed a new version of the kernel 2.6.15-26-386. This version didn't have the linux-restricted-modules package associated with it. As a result, even with a proper 'aticonfig' version of the xorg.conf, I didn't get direct rendering. The simple solution was to boot with the older 2.6.15-23-386 kernel, which had the restricted modules installed.
Once direct rendering was working, I simply followed the wiki instructions and went on to install XGL and compiz. That was risk, because I had no idea whether XGL worked on the ATI Radeon XPRESS 200M 5955 (PCIE) card on the laptop. It turned out that XGL ran fine. Now that's pleasure! All the night's hard work bore fruit and what a fruit!
So now I'm off to edit the wiki page for Gentoo and update the Radeon XPRESS 200M 5955 (PCIE) section. And since I haven't slept the whole night, working on this thing for 12 hours straight and its nearly 7 am, I'll go to bed.. or maybe get some breakfast and then go to bed.
Btw, these links will definitely prove useful if you're installing Linux on this laptop:
Updates from HP: http://h18007.www1.hp.com/support/f
Kubuntu on NX6125: http://wuestenleer.de/ku/index.html
Gentoo on NX6125: http://gentoo-wiki.com/HARDWARE_HP_Comp
Subscribe to:
Posts (Atom)
