Smokes your problems, coughs fresh air.

Tag: Linux (Page 4 of 4)

Getting my sister to forget the Google Desktop newsticker

My sister was so fond of the RSS feature that came with Google Desktop’s sidebar that she kept it permanently visible at the right side of her screen. (What a news junkie!) Now that I got her stuck with Linux, she misses her precious Google Desktop and I’m trying to figure out an alternative for her.

For those who want to truly stay on top, just pointing Firefox to Google Reader occasionally isn’t good enough. (I know: I’m slow. I like it that way.) I had heard of various Firefox add-ons to aggregate your RSS feeds in the sidebar, but the sis had thought of this already and didn’t like to have something permanently filling up space at the left. Ok, I can understand. I thought there must probably be some Firefox add-on to move the whole damn sidebar to the right and of course there is; it’s called RightBar.

Screenshot of the RightBar Firefox Addon

Screenshot of the RightBar Firefox Addon

The extension is so simple that you could achieve the same by adding a few lines to the userChrome.css file in the chrome subdirectory of your Firefox profile directory:

/* Change the sidebar's position */
#browser {
-moz-box: reverse;

(If the file doesn’t exist yet, create it from a copy of userChrome-example.css.)

What’s left now is to choose which feed aggregator extension for Mozilla Firefox to use. So far, I’ve only tried Sage (based on a five-star rating and familiarity with the name). It seems to work quite well, although, really, I still prefer just visiting Google Reader every once in a while. I mean: I’m a man, I don’t multi-task, I can hardly single-task.

I’m going to forward these suggestions to my sister, probably just to see them ignored for one crucial oversight: the sidebar doesn’t look very different. One of the things she liked about the Google Desktop, she told me, is that it looked very different from the rest of the stuff on her screen, causing a minimum of distraction. Probably I’ll end up recommending some kind of gDesktlet. (Or is there something better-looking these days?)

The road through Ubuntu

My mom bought a new laptop because of a broken screen on the old Linux machine that she had inherited from me (which wasn’t wasn’t a laptop, so I’m sure that the Golden Arrow of Consumption can explain why she didn’t just replace the screen, although the new boyfriend who is kind of Windows-but-not-Linux-literate qualifies as a more probable reason for getting a laptop that is needlessly dragged down by Vista).

I was a little surprised by her move. The first computer my mother learned turning on was this computer back when I was still using it. Of course it was running Linux at the time. Before I gave it to her, I replaced Gentoo Linux with Ubuntu Linux, and, honestly, she never had any problems with it that were not hardware-related. (Ok, there was that one time when there was some junk stuck in the print spool without a user-friendly path to getting rid of it, but you could argue that this was really due to a junk printer. (On the subject of print spools: my friend Wiebe complained to me a while ago that when the queue in their WorkCentre Pro 232 gets stuck, Xerox engineers have to come in to replace the whole damn control board; apparently, just plugging in a terminal with shell access isn’t possible.)) She was comfortable with and used to Linux. But, alas, she’s in love with someone who is less than comfortable with Linux and there’s always that male ego thing.

But, then, who cares? It was good news for my sister. With her having gone through a rally of shitty old machines in just a couple years and this still being an ok-enough machine, I asked her if she’d like a “new” machine running Linux when she called me about one of those typical Windows problems that had just taken out her previous wreck of a machine. Yeah, sure, she’s was more than willing to finally get rid of Windows.

I was glad that my sister didn’t feel the need to inflict the pain of Windows on this poor old machine. This meant I only had to upgrade and reconfigure i a bit. Upgrading Ubuntu to version 8.04 went pretty seamless, because it was a relatively fresh installation where all dependencies where actually marked as “auto”. After moving away some old – uhm – aesthetic imagery, ill-suited for big-sister-eyes, I brought the machine to her place, plugged in her peripherals, connected it to her screen, and tried to boot.

It booted, but GDM wouldn’t start. I had just swapped a Matrox G400 with a noisy GeForce 4 which I had previously assumed to be broken. This assumption actually goes all the way back to before I realized that the screen was broken. When the screen started complaining of “Not Recommended Mode”, one of my first diagnosis was that the GeForce card was borked. This diagnosis was arrived to after first blaming the screen, plugging it in elsewhere, seeing that working, plugging it back in, seeing that working too, then seeing that stop working again, resetting the screen in increasingly complex sequences, seeing it work again, seeing it stop working again, swapping the DVI connection with a VGA connection, and then, finally, swapping the GeForce racehorse with the old Matrox workhorse. Of course the problems returned, but not before another fun round of swapping parts and peripherals because the machine had started crashing. The crashing led me to replacing the power supply, only to find out later that the CPU’s cooling block had someone loosened dangerously. So, with all that in mind, I had now put back to GeForce plaything before I took the whole concoction to my sister. Now, GDM wouldn’t start. (The GeForce graphics worked fine before I moved the machine to her.)

Admittedly, I hadn’t exactly tried booting with the GeForce. (I’m not the rebooting type.) After swapping the card, not being able to use the binary nvidia and an hour or so of messing around, I found that the nvidia kernel module was actually missing. (I hadn’t noticed this because a “find /lib/modules|grep -i nvidia” did show an nvidia entry; had I looked better, I would’ve seen that it was a directory and not a .ko file.) So I performed a reinstall of the appropriate linux-restricted-modules package and—voila!—the files where there (in /lib/modules/2.6.24-21-generic/volatile/).

So I’m at my sister’s and I’m surprised that X won’t start. I try to find the module in /lib/modules/; it’s gone. Then, after reinstalling the package and an extraneous reboot to see it gone again, it dawns on me: what did volatile mean again? (I should really not be telling you this, because it’s fucking embarrassing. 😉 ) Yes, the volatile directory is a tmpfs mount point. When I realized that this was probably due to initramfs, I realized that I know jack about initramfs, except that it makes Grub’s configuration incomprehensible to me.

I tried updating the initrd.img by issuing update-initramfs -u. When this didn’t work, I added the module name explicitly to /etc/initramfs-tools/modules. When that didn’t work, I changed the MODULES option in /etc/initramfs-tools/initramfs.conf to MODULES=dep and pulled update-initramfs through grep to find out if the module was added appropriately: update-initramfs -u -v|grep nvidia. It was outputted and it was the right initrd.img too but still, after booting, the module was missing from the volatile directory.

So, fuck this! I was getting inpatient: cd /lib/modules/2.6.24-21-generic/volatile; mv nvidia.ko ../kernel/drivers/video; depmod -a; reboot and GDM started nicely.

Now I just have to find out why the bloody eth0 interface isn’t ifup’ed at boot. The configuration seems fine to me (although I’m confused by all this new-fangled GUI stuff and by where everything is stored. :-?) For now, I just dropped a script on her desktop called Darn, the network doesn’t work:

gksu ifup eth0

Pure sophistication, isn’t it? I’ve yet to encounter an operating system where solving such problems has any resemblance to anything I’d call user-friendly… For all the polish they add these days, if you can’t go below the hood and bang away at the shell, you’re basically screwed. That’s why I hate Windows so much, because I know nobody who can get under its hood.

Change ext3’s reserved block count and gain Gigabytes

Wiebe was looking over my shoulder while I was running df to check the disk space that was still available on my Lenovo ThinkPad:

# df -h /dev/sda2
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              90G   79G  7.3G  92% /

He noticed that there was a huge gap between the total space (79 used + 7.3 available = 88.3) and the actual size of the file system. According to him this was due to the reserved block count, which is set to five percent by default in ext2 and ext3 file systems—clearly a legacy from a time where disks were smaller.

# dumpe2fs /dev/sda2|grep -i 'reserved block count'
dumpe2fs 1.40.8 (13-Mar-2008)
Reserved block count:     1196559

# dumpe2fs /dev/sda2|grep 'Block count'
dumpe2fs 1.40.8 (13-Mar-2008)
Block count:              23931180

# echo 'scale = 2; 1196559 / 23931180'|bc

I changed the reserved block count with tune2fs:

# tune2fs -m 1 /dev/sda2
tune2fs 1.40.8 (13-Mar-2008)
Setting reserved blocks percentage to 1% (239311 blocks)
# dumpe2fs /dev/sda2|grep -i 'reserved block count'
dumpe2fs 1.40.8 (13-Mar-2008)
Reserved block count:     239311
# df -h /dev/sda2
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              90G   79G   11G  88% /

Now, the reserved blocks take up roughly 934 MiB; I’ve freed 3.7 GiB with this little file system tweak. 🙂

Update 14 nov 2010: I finally fixed two errors in my final calculations spotted by Den. He noticed that the numbers (700 MiB and 13 GiB) were wrong. Thanks, Den!

Another contributed Readline keyboard shortcut

Last Wednesday, I was given a very nice response with a great tip to my table of Readline keyboard shortcuts by Luca City. Yesterday, Lance Levine gave me another extremely nice response and another great tip:

Just wanted to say appreciate the nice readline cheatsheet. There were a couple I never knew (the ctrl-alt-asterisk is gonna be a real time saver) and I never knew about ctrl-G or ctrl-J to end incremental searches either.

One that might be worth knowing for a lot of people if you ever make updates, would be the ctrl-x-x cmd. which takes you to the beginning of the line (and then back again if you hit it again). I enjoy working in screen, and the default ctrl-a escapes you from readline when you’re in a screen session so I never use it lest get confused.

Best Regards,
Lance Levine

Well, Lance, I’m an avid GNU screen user myself, so your tip is very useful to me! I’ve added it to the table to ease the suffering of our fellow GNU screen users. 🙂

Indeed I did, but I found it difficult to come up with a concise and clear description of the shortcut. So difficult, in fact, that I didn’t succeed at it:

Ctrl+x+x readline keyboard shortcut with ugly description

So, what does the Readline user manual have to say that may help me with a description?

exchange-point-and-mark (C-x C-x)
Swap the point with the mark. The current cursor position is set to the saved position, and the old cursor position is saved as the mark.

While typing, the mark normally is at the beginning of the line. Pressing Ctrl-x-x will move the cursor to the mark and set the mark to the old cursor position. If you now move the cursor and press Ctrl-x-x again, the mark won’t be at the beginning of the line but at place where you moved the cursor to. This means that the Ctrl-x-x shortcut is more than just a way to move back and forth between the beginning and ending of a line.

Another goody worth mentioning is the Ctrl-@ shortcut which will simply set the mark at the current cursor position or at the position specified by a numeric argument.

Now, I just need to think of a way to integrate these two Readline command bindings into the table without the descriptions taking up as many lines as this blog post. 😕 Any bright ideas, anyone?

eps2eps to the rescue when epstopdf complains of no bounding box

PDFLaTeX doesn’t like encapsulated postscript images. If you want to use .eps files with pdflatex, you can convert these files to PDF using Sebastian Rahtz’ epstopdf, and then remove all .eps file extensions from the image locations in your .tex source files. Then, the latex command will look for .eps file and the pdflatex command will look for .pdf, .jpg and .png files.

The other moment, I tried to do just this. But, epstopdf complained about the lack of a bounding box in one of my EPS files. Indeed, the conversion finished but generated a huge white background with the actual image somewhere in the lower left corner. From the man-page:

epstopdf transforms the Encapsulated PostScript file so that it is guaranteed to start at the 0,0 coordinate, and it sets a page size exactly corresponding to the BoundingBox. This means that when Ghostscript renders it, the result needs no cropping, and the PDF MediaBox is correct. The result is piped to Ghostscript and a PDF version written.

If the bounding box is not right, of course, you have problems…

Luckily, while tab-completing from eps to epstopdf, I noticed the eps2eps utility. I though: What if this utility happens to sanitize the EPS file a bit? A quick look at the man page and a test run later, my hope was confirmed: epstopdf would now generate a nice PDF file without complaining.

The epstopdf manual page could be amended to: If the bounding box is not right, you might want to try to run eps2eps first.

Newer posts »

© 2022 BigSmoke

Theme by Anders NorenUp ↑