Download their driver install tool “linux-brprinter-installer-2.1.1-1.gz”

gunzip linux-brprinter-installer-*.*.*-*.gz

sudo bash linux-brprinter-installer-2.1.1-1 MFC-9340CDW

brsaneconfig4 -a name=BroScan model=MFC-9340CDW ip=xx.xx.xx.xx

Printer and Scanner should now work

sudo apt-get install nautilus-share

Then add user to ‘sambashare’ group.

Raid 5 with mdadm


Create the raid

mdadm –zero-superblock /dev/sd[b-h]

mdadm –zero-superblock /dev/sd[b-h]1

mdadm –create /dev/md0 –level=5 –raid-devices=7 /dev/sd[b-g]1 missing

mdadm –readwrite /dev/md0

pvcreate –dataalignment 512K /dev/md0 (match the chunk size)

vgcreate -s 128M lvm-raid /dev/md0

vgdisplay (get the extents)

lvcreate -l 44706 lvm-raid -n lvm0

mkfs.ext4 /dev/lvm-raid/lvm0


Speed up the resync

echo 50000 > /proc/sys/dev/raid/speed_limit_min
echo 200000 > /proc/sys/dev/raid/speed_limit_max

echo 8192 > /sys/block/md0/md/stripe_cache_size

select CURRENT_DATE + rownum -1 dt
from dual
connect by level <= 7;

Interview Questions


Explain Java Garbage collection.?

What makes a good unit test?

  • Automatic : Invoking of tests as well as checking results for PASS/FAIL should be automatic
  • Thorough: Coverage; Although bugs tend to cluster around certain regions in the code, ensure that you test all key paths and scenarios.. Use tools if you must to know untested regions
  • Repeatable: Tests should produce the same results each time.. every time. Tests should not rely on uncontrollable params.
  • Independent: Very important.
    • Tests should test only one thing at a time. Multiple assertions are okay as long as they are all testing one feature/behavior. When a test fails, it should pinpoint the location of the problem.
    • Tests should not rely on each other – Isolated. No assumptions about order of test execution. Ensure ‘clean slate’ before each test by using setup/teardown appropriately
  • Professional: In the long run you’ll have as much test code as production (if not more), therefore follow the same standard of good-design for your test code. Well factored methods-classes with intention-revealing names, No duplication, tests with good names, etc.

What is a Database Deadlock?

I am running DD-WRT v24-sp2 (08/07/10) mega – build 14896 on a Linksys WRT610Nv2 and use openvpn to do Site-to-Site routed VPN. There is a problem with recent builds of dd-wrt that breaks DNS between the sites. It is due to the “stop-dns-rebind” option in the “/tmp/dnsmasq.conf” file.

So if you have used this guide:

Example: localDomain remoteDomain

Have accomplished:
1) Ping the remote router
2) Ping a remote client
ping 10.0.51.x
3) Can get a DNS answer from the remote DNS server
dig @ remoteClient.remoteDomain
4) From your local client system dns does not work for remote clients
dig remoteClient.remoteDomain
dig @ remoteClient.remoteDomain

The next step is to:
1) ssh root@
2) cat /tmp/dnsmasq.conf
3) If you see the option “stop-dns-rebind” this is rejecting the remote dns servers. This is why lookups do not work

Fix it:
1) Log into DD-WRT web interface
2) Administration->Commands
3) Edit startup
4) At the end insert

# This is a hack for dnsmasq because it does not implement rebind-domain-ok yet
 sed -i 's/stop-dns-rebind/# stop-dns-rebind/g' /tmp/dnsmasq.conf
 sleep 5
 killall dnsmasq
 sleep 5
 dnsmasq --conf-file=/tmp/dnsmasq.conf

5) Save Startup
6) Reboot router
7) dig remoteClient.remoteDomain works
8) Profit


Install dependencies

sudo apt-get install fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge
sudo apt-get build-dep linux
sudo apt-get install git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev

Checkout the latest sources

In firefox go to and pick the branch you want to build.

cd ~
git clone git://

Configure options for your sustem

cd linux-2.6
make defconfig
lsmod > myModules.txt
lpr myModules.txt
make menuconf (add the modules that you think you need for your hardware, the printout should help)

Make and Install the Kernel
sudo su
make modules_install
make install

Make and Install the Init Ramdisk

update-initramfs -c -k 2.6.x.y (whatever the folder is named in /lib/modules

Update GRUB2


Reboot and select new kernel

Undo all of this (If things go bad)

If this does not work lets delete the kernel you installed.
At boot hold down shift and grub2 should show you the kernels you can boot from.  Select the old one.
This should get you up and running again.

Delete the new kernel

sudo su
cd /boot
rm *.38 (or whatever the postfix on your kernel is)
cd /lib/modules
rm -r *.38 (or whatever the postfix on your kernel is)

Reboot and it will be like you never installed your custom kernel

my .bash_aliases


alias gits=’git status’
alias gitpp=’git pull;git push’

sudo lshw -class display

This is mainly for my own benefit when reloading my system.  But here are the packages that i actually use.

sudo apt-get install build-essential wireshark gnucash ddd eclipse gcc vlc k9copy dvdrip xine-ui ubuntu-restricted-extras vim vim-gnome checkgmail ssh openvpn xchat-gnome subversion autoconf libtool g++ clamav clamav-daemon apt-file lernid valgrind gitk git-gui pidgin ekiga gtg hamster-applet inkscape blender dia quanta netbeans nmap tremulous wesnoth scorched3d flightgear nexuiz bzflag fretsonfire supertuxkart glest torcs nethack-console warzone2100 alien-arena gfceu openarena extremetuxracer smc wormux amarok