Fixing Stalled Printing in SLES with CUPS

We run Baan on SLES, all of our printing goes through CUPS.

Every once in a while printing just stalls, no reason that I can tell. (I blame the network) but what ends up happening is that the print jobs get backed up and you need to clear out the queue.

The fastest way to do this is to do:

rm /var/spool/cups/*

And then restart CUPS:

/etc/init.d/cups restart

Syncing Droid X with Banshee

Banshee (and apparently most linux media players) expects a file in the root of your Android device named ".is_media_player"

For the Droid X file shouldn't be empty, as many places on the 'net state, you need to add more information.

Mine looks like this:

name=droid
audio_folders=/media/serial number/music/
folder_depth=2
output_formats=audio/mpeg,audio/mp3,audio/x-aac
playlist_format=audio/x-mpegurl
cover_art_file_type=jpg

When my droid mounts in linux it mounts to /media/<what i assume to be a serial number>

UPDATE 4/28/11 New versions of banshee don't seem to recognize the is_media_player name, it's now called .is_audio_player.

Installing Virtualbox Guest Addons for Fedora 13

You need to do 2 updates to make this work:

sudo yum update kernel
sudo yum install binutils gcc make patch libgomp glibc-headers \
glibc-devel kernel-headers kernel-devel

If that doesn't do it, check your installed kernel versions.

Remove any kernels that don't have kernel-devel/kernel-headers installed.

Parsing large files with pgfouine in linux

pgfouine is a nice logfile analyzer for PostgreSQL written in php.

I'm doing a trace on a very long running ETL process and the logfile generated is ~11GB.

I'm running up against a 2GB barrier in php for fopen(). If you've got a 64bit machine and can recompile php with -D_FILE_OFFSET_BITS=64 then you're good to go. But in my case, I can't do either.

The error i'd get is:

PHP Fatal error:  File  is not readable. in /var/lib/pgsql/pgfouine-1.1/include/GenericLogReader.class.php on line 85

So for Plan B I had to remember back to the days when 64 bit wasn't even an option (back in my day, we had 8 bits and we liked 'em!)

I used a named pipe since pgfouine expects a file and doesn't seem to be able to read from stdin.

mknod /tmp/pg2 p
cat /var/log/postgres > /tmp/pg2 | ./pgfouine.php -file /tmp/pg2 > bla.html

Once that kicked off I stopped getting that error and pgfouine was able to process the file.

Perl script to allocate shared memory (and annoy sysadmins)

I once ran into an instance where the Unix admins didn't believe me that i was running out of shared memory despite the errors, I was showing them. I wrote this perl script to allocate chunks of shared memory until it failed to prove to them that yes, regardless of what you have the global ulimits set to my user's limits were lower.

#!/usr/bin/perl -w

use IPC::SysV qw(IPC_PRIVATE IPC_RMID S_IRWXU);

$size = 50000000;
$id = shmget(IPC_PRIVATE, $size, S_IRWXU) || die "$!";
sleep 10;
shmctl($id, IPC_RMID, 0)

About

Random Database, OS or otherwise interesting tips and tricks.

User


Clicky Web Analytics