[90446 views]

[]

[toggle ads]

Odi's astoundingly incomplete notes

New entries

Code

back | next

mysql-5.1 and amarok conflict in Gentoo

With mysql-5.1 being unmasked now, your favourite Gentoo system will want to upgrade when you emerge -uD world. Unfortunately this will conflict with amarok when using the embedded USE flag. The reason is that mysql-5.1 doesn't support embedded really yet. You have two options:
  1. If you don't have to upgrade to 5.1, stick with 5.0. So simply add
    =virtual/mysql-5.1
    to /etc/portage/package.mask
  2. If you really want 5.1, then the embedded USE flag of amarok can't be used. Remove the embedded USE flag and re-emerge amarok. Then upgrade mysql. Connect Amarok to the MySql server and rebuild your collection.

posted on 2010-09-02 21:46 CEST in Code | 0 comments | permalink

bluez pairing with Apple wireless keyboard

The new-style bluez utilities are a bit different than the old ones. Here is how to pair an Apple Wireless Keyboard with the command line utilities only:

You need two (SSH) shells. In the first one run simple-agent and answer yes to any upcoming authorization requests.
Remove and reinsert the batteries from the keyboard. Turn the keyboard on. The light should be flashing.

In the second shell do:
hcitool scan
Scanning ...
        11:22:33:44:55:66       Apple Wireless Keyboard

hcitool cc 11:22:33:44:55:66
hcitool auth 11:22:33:44:55:66

Type a PIN (any four numbers) followed by Enter on the keyboard. Enter the PIN into the simple-agent shell when prompted.

posted on 2010-08-22 11:31 CEST in Code | 0 comments | permalink

Gentoo: hal broken after glib upgrade?

If hald seems not to properly startup after a glib upgrade, make sure to re-emerge dbus-glib. See forum.

posted on 2010-08-06 11:23 CEST in Code | 0 comments | permalink

Why you never develop on a branch

I always tell my fellow coders: never develop new features on a branch.

By branch I mean a stable release CVS branch. That is usually a bit "old". HEAD is quite volatile. New concepts are introduced, old ones removed. Refactoring occurs on the HEAD.

So if you start to build something on the old branch and then port it to HEAD, your code may be based on old/deprecated concepts and will fail to support new features correctly.

Another factor is human errors: forgetting to port a patch between branches. If you develop on the branch, your customer is happy. But in the next release he will be unhappy when he notices that a change has been lost. If you develop on the HEAD you get immediate feedback from a customer when you forget to backport a change.

In general it's easier to write the code for HEAD and then backport it to the branch world. Also the backport should happen gradually and not as a big bang.

posted on 2010-06-10 11:30 CEST in Code | 0 comments | permalink

Excel CSV WTF

Oh what? Surely having an ID column at the beginning is something totally unusual.

posted on 2010-05-17 08:20 CEST in Code | 0 comments | permalink

ata failed command: FLUSH CACHE

I got bitten by this problem in a 2.6.31 and .32 Linux kernel:
Apr 28 16:21:53 kernel: ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
Apr 28 16:21:53 kernel: ata2.00: failed command: FLUSH CACHE
Apr 28 16:21:53 kernel: ata2.00: cmd e7/00:00:00:00:00/00:00:00:00:00/a0tag 0
Apr 28 16:21:53 kernel: res 40/00:01:00:00:00/00:00:00:00:00/a0 Emask 0x4 (timeout)
Apr 28 16:21:53 kernel: ata2.00: status: { DRDY }
Apr 28 16:21:55 kernel: ata2: soft resetting link
Apr 28 16:21:55 kernel: ata2: soft resetting link
Apr 28 16:21:55 kernel: ata2: nv_mode_filter: 0x3f39f&0x3f39f->0x3f39f, BIOS=0x3f000 (0xc700c6c0) ACPI=0x3f01f (20:60:0x1f)
Apr 28 16:21:55 kernel: ata2: nv_mode_filter: 0x739f&0x739f->0x739f, BIOS=0x7000 (0xc700c6c0) ACPI=0x701f (20:60:0x1f)
Apr 28 16:21:55 kernel: ata2.00: configured for UDMA/100
Apr 28 16:21:55 kernel: ata2.00: configured for UDMA/100
Apr 28 16:21:55 kernel: ata2.01: configured for UDMA/33
Apr 28 16:21:55 kernel: ata2.01: configured for UDMA/33
Apr 28 16:21:55 kernel: ata2.00: device reported invalid CHS sector 0
Apr 28 16:21:55 kernel: ata2.00: device reported invalid CHS sector 0
Apr 28 16:21:55 kernel: end_request: I/O error, dev sdb, sector 58604962
Apr 28 16:21:55 kernel: md: super_written gets error=-5, uptodate=0
Apr 28 16:21:55 kernel: md: super_written gets error=-5, uptodate=0
Apr 28 16:21:55 kernel: raid1: Disk failure on sdb3, disabling device.
Apr 28 16:21:55 kernel: raid1: Operation continuing on 1 devices.
Apr 28 16:21:55 kernel: ata2: EH complete
Apr 28 16:21:55 kernel: ata2: EH complete
Apr 28 16:21:55 kernel: RAID1 conf printout:
Apr 28 16:21:55 kernel: RAID1 conf printout:
Apr 28 16:21:55 kernel: --- wd:1 rd:2
Apr 28 16:21:55 kernel: --- wd:1 rd:2
Apr 28 16:21:55 kernel: disk 0, wo:0, o:1, dev:sda3
Apr 28 16:21:55 kernel: disk 0, wo:0, o:1, dev:sda3
Apr 28 16:21:55 kernel: disk 1, wo:1, o:0, dev:sdb3
Apr 28 16:21:55 kernel: disk 1, wo:1, o:0, dev:sdb3
Apr 28 16:21:55 kernel: RAID1 conf printout:
Apr 28 16:21:55 kernel: RAID1 conf printout:
Apr 28 16:21:55 kernel: --- wd:1 rd:2
Apr 28 16:21:55 kernel: --- wd:1 rd:2
Apr 28 16:21:55 kernel: disk 0, wo:0, o:1, dev:sda3
Apr 28 16:21:55 kernel: disk 0, wo:0, o:1, dev:sda3
Apr 28 16:21:55 mdadm[5734]: Fail event detected on md device /dev/md1, component device /dev/sdb3
Apparently a cache flush timed out. This leads to a failure of the RAID and the disk goes offline. Just removing and re-adding it with mdadm of course fixes the RAID again. But it occurred a couple of times and is annoying.

The machine is a media PC with an nVidia Corporation nForce2 chipset. Two IDE disks are attached to the PATA bus and running as md RAID-1 volumes. The disks are really old and may not be the best quality (thus the RAID-1...).

There is a patch that may actually address exactly this problem, by simply retrying the command.The patch is in 2.6.34 and will be in 2.6.33.4 and 2.6.32.13.

posted on 2010-05-11 08:40 CEST in Code | 0 comments | permalink

WS implementors

Next time you implement a webservice framework, please: Thanks. Most WS infrastructure sucks badly.

posted on 2010-05-05 17:08 CEST in Code | 0 comments | permalink

Jack ok, but PulseAudio?

I heard a lot about PulseAudio. I have used Jack. I read Lennart's post about PulseAudio and Jack. Still I don't see why I "need" PulseAudio. I have never used it. And I am not missing a thing. Audio comes out of my Gentoo box just fine using plain ALSA. No KDE phonon. No arts. No esd. Just ALSA. So what's the point of having PulseAudio altogether? Maybe you can enlighten me.

Notes from readers, my comments appended:


posted on 2010-05-05 10:38 CEST in Code | 3 comments | permalink
- per application volume control
- sane volume control (ALSA presents lots of sliders, most of them doing nothing)
- seamless switching between different audio devices (think speaker -> bluetooth headset)
- mixing audio in userspace where it belongs

and most important: - fixing long-standing bugs in some ALSA drivers...
- sound over a network
for example, PulseAudio help me to fix problem with flash plugin - there was no sound on my debian unstable.

No URL alias in Tomcat?

Is there seriously no way to create an arbitrary (i.e. cross-context) alias for an URL in Tomcat? I don't want a HTTP redirect, I don't want inefficient reverse-proxying, I don't care about cookie security (as cookies are not used), I don't want HTTPD in front. Just a simple stupid alias. That is the alias URL calls the same servlet code as the aliased URL. Also known as URL rewriting.

I want: http://localhost:8080/old-service  -> http://localhost:8080/axis/services/new-service

Filters and not even Valves can do that, because implementations must not "change request properties that have already been used to direct the flow of processing control for this request". Seriously? 2010?

Reason: I have a webservice that has been migrated to a completely different infrastructure, and thus a different context. The clients should not need to be changed. And the clients don't support redirects.

posted on 2010-04-21 08:59 CEST in Code | 1 comments | permalink
Why not run Tomcat in Apache 2.0 and then you can do your aliasing from Apache 2.0... ref aliasing in tomcat, I'm not sure on that (I assume from your rant that it isn't possible).

Best regards

Steve

Change java process name

at least under Linux you can do that painlessly from bash:
exec -a myapp java com.example.MyApp

And if you don't want to replace the current shell, execute it in a subshell by using parantheses:
(exec -a myapp java com.example.MyApp)


posted on 2010-04-14 15:19 CEST in Code | 0 comments | permalink
back | next