Monthly Archives: October 2008

Samsung ML-2015, Arch Linux

This is a lot easier than in FreeBSD. Just install cups and splix. They have all the files needed.

It does mean you’ll have installed files for printers you don’t need, and space is always a consideration.

Advertisements

Power management on a laptop

Was sitting in a mall today, wondering why my PC powers down so fast. Tried using powertop, it gave a lot of tips on-the-fly.

One thing useful I’ve been reminded of by it: the mouse (touchpad in this case) causes a lot of interrupts, like 50/s or so. So I try to avoid using it. Luckily, I’m a keyboard+terminal fan anyway.

PHP: Fatal error: call to undefined function iconv()

Make sure it’s enabled in php.ini. 🙂

I also had to restart Apache.

Thunar not showing thumbnails

I’ve tried a lot. Had thunar-thumbnailers installed, run that thumbnailer update program. I even set world-readable (and writable) permissions on a lot of things.

What I didn’t do, though, is run gconf-daemon, since I’m using neither gnome nor xfce4, or any other environment, for that matter.

In the end, I switched to PCManFM instead.

PHP doesn’t execute scripts

Neither using CLI (with -f or a shebang) nor through Apache.

It was just dumping the script to stdout, and that means short PHP tags (<? ... ?>) are disabled. Nothing serious, fixed in php.ini.

But then it just did nothing. No output, no errors, no warnings. Turned out this particular version of PHP can’t read DOS-formatted text files. To change them to Unix, in vim:

:set ff-unix

This happened after I flipped from FreeBSD to Arch Linux.

Batch image resizing

My php script no longer works, it breaks on gd functions somehow.

So I use this Gimp script instead.

csh: Cannot open /etc/termcap

Upon logging into my remote server with ssh, I started getting:

csh: Cannot open /etc/termcap.
csh: using dumb terminal settings.

There is no rxvt-unicode entry in /etc/termcap. You should specify one, but if you’re lazy, you can just

setenv TERM xterm

in your ~/.cshrc.

P.S. Nah, this doesn’t help. You have to put that line in /etc/csh.cshrc (via).

A move to Arch Linux

As if there wasn’t enough changes in my life lately, I’ve switched from FreeBSD to Arch Linux. I did this, since a lot of software is first developed on Linuxes, so that gets the bleeding edge. Such as wireless drivers, window managers, etc..

This wasn’t the only reason, though. I like the strict GPL licence a lot more than the corporate-capitalist-fuck-allowing BSD type. BSD’s not BDSM!..

Anyway, Arch is very much like BSD, the most BSD-like of Linuxes I’ve seen.

Before you start with Arch, get a hold of this: Arch Beginner’s guide.

Notes on enlarging my /usr, FreeBSD

First, introduce yourself to man fdisk, bsdlabel, growfs.

Quick link: this. Refer for good detailed instructions.

—–

Those with extensive Windows experience might think of “resizing the FreeBSD partition”, but that’s not how it works in FreeBSD.

When you search the net, the first thing you’ll find is people saying you should use growfs to do that. Obviously, they’ve never did anything like it before and are just playing wise-ass.

Here’s the deal: for resizing partitions (in “classical” DOS terms; this is “slices” for FreeBSD), you use fdisk. You may both enlarge and shrink at this stage.

(NOTE 1: you’ll have to do this in single-user mode. When asked which shell you want, use the default /bin/sh. Using /bin/csh is bad, mkay? First, I’ve found the environment variables aren’t set in this case (you’ll have to write full path names). Then, there’s the quirk with utilities (vi, say) grabbing one line instead of the entire screen.)

Then you use bsdlabel (aka disklabel) to change the size of FreeBSD partitions in a chosen slice. You will actually have to use /usr/bin/vi at this stage (I think it’s hard-coded into the bsdlabel executable). You can change the sizes in any way – enlarge or shrink. After all, it’s just editing a text file.

(NOTE 2: vi is on /usr. It will want /tmp to store the file being edited. You’ll have to mount those. Don’t worry, it’s OK, as long as you don’t forget to unmount them after editing.)

Finally, you can use growfs to grow the file system, according to the info you’ve specified in the disk’s label. If there was shrinkfs, you could shrink it, too.

So, you see, growfs is the shortest and easiest part of growing a file system.