[255225 views]

[]

Odi's astoundingly incomplete notes

New entries

Code

back | next

renice a tty

Quickly renice all processes of a tty:
ps -t pts/1 | awk 'NR>1 { print $1; }' | xargs renice 10 -p

posted on 2011-01-18 21:32 UTC in Code | 0 comments | permalink

add bridge failed: Package not installed

$ brctl addbr br0
add bridge failed: Package not installed
$ gunzip < /proc/config.gz | grep BRIDGE
# CONFIG_BRIDGE is not set
So that's the most silly way to say: you forgot to compile in bridge support into your kernel. "package not installed" tsk!

posted on 2011-01-18 21:23 UTC in Code | 10 comments | permalink
Add support bridge from kernel:

it option have to be enable "802.1d Ethernet Bridging"
Thank's for the information, it was helpful :)
Thanks! That was very useful! It also shows up when you upgrade the kernel and forget to reboot (the module doesn't load and this surprising message appears).
Thanks a bunch!
Helped me too - cheers!
Thanks! :)
Thanks dude!
This option have to be enabled "802.1d Ethernet Bridging" => Thanks !
I had this error after loading a development module and doing a depmod -a and then crashing right away. A repeat of depmod -a cleaned up the symbol xref files and everything was happy again.
I am getting the same issue. Not sure how to fix it. Any ideas?

DataOutputStream 64KB limit

Did you know that you can not serialize Strings >64KB through a DataOutputStream?
if (utflen > 65535)
  throw new UTFDataFormatException(
    "encoded string too long: " + utflen + " bytes");

posted on 2010-12-14 10:39 UTC in Code | 0 comments | permalink

perf docs

Some nice PDFs and a User Guide about perf.
posted on 2010-12-13 18:32 UTC in Code | 0 comments | permalink

A sign of over-engineering...

... when an interface has only a single implementation.

When you discover them it is worth rethinking if that interface is really worth it and whether that apparent flexibility is really desired or necessary.

posted on 2010-12-13 13:34 UTC in Code | 0 comments | permalink

NTLM support in HttpClient merged

After years of legal uncertainity it is now finally possible to include NTLM implementations in Apache software. Also the Http Components and formerly HttpClient had continuously refused to include any (more) NTLM code, or the LGPL jcifs library. Today Oleg has finally merged a patch that supports NTLM v1, v2 and NTLM 2 as authentication mechanisms. This looks like a big milestone for people that rely on NTLM as their primary authentication mechanism.

posted on 2010-10-19 09:31 UTC in Code | 0 comments | permalink

line wrapping with xconsole

I am using xconsole to display the syslog. I was annoyed that long lines from iptables went offscreen because they are very long. Now fortunately xconsole is an old-school X11 program. According to its man page it uses the Athena Widget Set. X11 programs accept so called Xresources, which to an X11 GUI are nothing more than what CSS is to HTML.

The Xresources file is in your home directory: ~/.Xresources
There is another old-school program editres to graphically inspect and edit Xresources. Using that it's easy to find out that the resource we want to modify is
xconsole.text.wrap. However this doesn't tell us what kind of values this resource acccepts.

Taking a look at the Athena documentation on page 95 we quickly find that the only 3 values are never, word and line and what they do.

So firing up vim and putting the following line into our .Xresources file will do the word wrapping trick:
xconsole.text.wrap:     line
xconsole*font:  fixed
Sometimes it's worth not to forget the old school...
posted on 2010-10-10 19:46 UTC 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:

Remove and reinsert the batteries from the keyboard. Turn the keyboard on. The light should be flashing.

In a root shell do:
hcitool scan
Scanning ...
        11:22:33:44:55:66       Apple Wireless Keyboard
simple-agent hci0 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. The keyboard is paired now. Now trust and connect the device:

bluez-test-device trusted 11:22:33:44:55:66 yes
bluez-test-input connect 11:22:33:44:55:66


posted on 2010-08-22 11:31 UTC 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". Trunk is quite volatile. New concepts are introduced, old ones removed. Refactoring occurs on the trunk.

So if you start to build something on the old branch and then port it to trunk, 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 trunk you get immediate feedback from a customer when you forget to backport a change.

In general it's easier to write the code for trunk 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 UTC 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 UTC in Code | 0 comments | permalink
back | next