No Sound in Java-apps in Firefox

•July 26, 2008 • Leave a Comment

For a long time i had not sound in Firefox on Sites using Java (hobnox.com, runescape.com)

I tested the Javasound localy withe the JavaSoundDemo:

http://java.sun.com/products/java-media/sound/samples/JavaSoundDemo/

and i worked flawlessly.

I had to activate the OSS Sequencer API in the Kernel under:

Device Drivers/Sound/Advanced Linux Sound Architecture/

So even modern sites still use and need the OSS API, good to know :)

Searching for all ebuilds with specific useflag in Gentoo

•July 20, 2008 • 2 Comments

Ever wondered how to find all those programms in portage you didn’t install, which have a specific useflag you were interested in ?

Well, eix is capable of this useful feature, just search like this:

eix -U someuseflag

Compare Directories with diff

•May 15, 2008 • 1 Comment

Its easier than i thought, just type:

diff -rq Dir1 Dir2

-r stands for rekursive

-q output only wether content differ

Mounting ext4-filesystem with newer Kernels

•May 14, 2008 • 1 Comment

Trying to mount my ext4 partiton with a 2.6.25 kernel i get this errormessage:

EXT4-fs: hda3: not marked OK to use with test code.

There is a new special flag you have to set to mount development code, so do:

[root]# debugfs -w /dev/hda3
debugfs 1.40.9 (27-Apr-2008)
debugfs: set_super_value s_flags 4
debugfs: quit

More info here.

Syncing your portage tree and overlays with eix

•December 26, 2007 • 2 Comments

If you want to sync your portage tree and your layman-overlays with one command, you can use
eix-sync
for that.

All you have to do is to create
/etc/eix-sync.conf
and place a
*
in it.

If you want to have a cronjob for that create for example a file named /etc/cron.weekly/eix.cron

and put something like

#!/bin/sh
/usr/bin/eix-sync

in it.

You can then delete all other cronjobs like emerge –sync and layman -S

As usual man eix has all the info you need.

Java not working when libX11 compiled with xcb useflag

•December 22, 2007 • Leave a Comment

Put

LIBXCB_ALLOW_SLOPPY_LOCK=1

in your /etc/env.d/99local

Enable Antispoofing With Iptables

•October 1, 2007 • Leave a Comment

for i in /proc/sys/net/ipv4/*/rp_filter; do
echo 1 > $f
done

Or simply

echo 1 > /proc/sys/net/ipv4/*/rp_filter (depends on your shell)

This compares the source adress against the routing table

More info about the ~50 options you can find at /usr/src/linux/Documentation/networking/ip-sysctl.txt

HowTo Redirect And Save Tcpdump Output To Other Host

•September 28, 2007 • Leave a Comment

So you have one of those fancy Linksys-Routers with OpenWrt on it and want to save the output of tcpdump. As the local storage is limited and OpenWrt does not support a monitoring-port you have to redirect the output to save on another host.

But first lets enlarge onto that monitoring-port.
For what i know DD-Wrt’s iptables supports by default the ROUTE target with the --tee parameter:

--tee
Make a copy of the packet, and route that copy to the given destination. For the original, uncopied packet, behave like a non-terminating target and continue traversing the rules. Not valid in combination with '--iif' or '--continue'

I tried to patch OpenWrt’s iptables with the ROUTE target, but no luck as this extensions seems not to be maintained anymore.

As DD-Wrt is OpenWrt-based, i supose i only need the ipkg from them and can install it on my router, have to investigate that further.

Far less complicated is to start tcpdump on your router and redirect the output to your PC like this:

tcpdump -i any ! host 192.168.1.2 -s 0 | ssh someone@192.168.1.2 “cat > dump.txt”

Change tcpdump filters to your liking.

Enable And Disable Spell-Checking In Vim

•September 24, 2007 • Leave a Comment

First you choose the language which you want to use:

:setlocal spell spelllang=en_us

or

:setlocal spell spelllang=de_at

For the German spell files you have to:

emerge vim-spell-de

You can disable spellchecking with:

:set nospell

]s move to next misspelled word, [s move to prev. misspelled word
z= suggests correctly spelled words under cursor,
1z= takes the first word from the suggestion list
^Xs does the same in insert mode.
:spellr repeats replacements done with z= for all matches

For more info about spellchecking in vim:

:h spell

Rename Or Copy Files Not In Current Directory

•September 13, 2007 • Leave a Comment

: I often cached myself renaming a file in some other directory like this,
: mv some/dir/some/file some/dir/some/file_renamed.
:
: But there is an easier way:
: mv some/dir/some/{file,file_renamed}
:
: This also works for copying:
: cp /etc/mail/{sendmail.cf,sendmail.cf.orig}
:
: Or vimdiff:
: vimdiff /etc/mail{sendmail.cf,sendmail.cf.orig}
:
: And thats why I love zsh so much, you can even tabcomplete after the {, try that in bash f.e. :)
: Be creative, I’m sure there are many useful fields of application