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

Advertisements

sudo apt-get install nautilus-share

Then add user to ‘sambashare’ group.

Raid 5 with mdadm

2013/07/09

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

2012/11/14

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:
http://www.dd-wrt.com/wiki/index.php/OpenVPN_-_Site-to-Site_routed_VPN_between_two_routers#DHCP_Forwarder_.2F_DHCP_Server_feature_of_DD-WRT

Example:
10.0.50.1 localDomain
10.0.51.1 remoteDomain

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

The next step is to:
1) ssh root@10.0.50.1
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

References:
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=78527&postdays=0&postorder=asc&start=0

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 http://www.kernel.org and pick the branch you want to build.

cd ~
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.38.y.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
make
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

update-grub

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)
update-grub

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

my .bash_aliases

2010/10/13

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

sudo lshw -class display

I have been looking at this setup for a while and it has convinced me to move to more than two monitors.

http://www.biscade.com/office/