Retrieving files from a broken harddrive on linux

We recently had some trouble with a software raid (raid1 in this case) that was set up with mdadm. Dmesg showed that the drive had errors and so we replaced it. After the disk was replaced the other disk also started reporting errors and fsck would tell us that the superblock was fucked up and couldnt be read.

First thing we did was to dd the broken disk to the new one using ddrescue .

We tried rebuilding it by finding backup superblocks :
mke2fs -n /dev/sdb1 # lists superblocks
e2fsck -b number_from_output_above /dev/sdb1
While the above works in many cases, it didnt help us. All the superblocks where gone.

Thankfully we came across a tool named TestDisk that let us view and copy the data from the disk. Check it out, it’s awesome :)

 

Tags: , , , , , , , , , ,

Nvidia and invalid checksum for EDID (Xorg-issues)

Having troubles installing a DVI splitter through a HDMI converter on our Jira-dashboard i found that the splitter made the EDID(Extended display identification data) fancy automagically validation shit fucked up and made the screen falling back to 640×480.
This made me shat brix.

After alot of googling i found a faboulous trigger called IgnoreEDIDChecksum that i put under the Screen section in the xorg.conf.

Hurrayh for new fancy automagic-probe-validation-fuckups

Tags: , , ,

CrystalHD AppleTV OSX kext lib is ready for download

Yay, Finally we have osx support for broadcoms crystal hd! This means it is now possible to keep the existing Apple TV os AND run xbmc with CrystalHD hd video acceleration :)

Scott Davilla finally made his efforts in porting the broadcom open source linux crystalhd driver to osx lib and kext available to the public :)

More info on Davillas efforts here
Visit broadcom for more info on Crystal HD and check here for windows and linux driver downloads.

Tags: , , , , , , , , , , , , ,

Compile xbmc with broadcom crystalhd support on linux

Broadcom CrystalHD is a Mini-PCIe expansioncard to make your box do hardware decoding of HD video material (h264, vc1++)
Got a old AppleTV which you dont use? Buy a CrystalHD chip on ebay for 30 dollars, and it will play 1080p for you :)

Install Ubuntu 8.04 Hardy on your box, if you are going to use an AppleTV you can follow the guide here:
http://dingleberry.me/2009/11/ubuntu-karmic-koala-on-appletv-with-broadcom-crystal-hd-decoder/

Download the xbmc crystalhd branch and the lib directory from the xdmx branch which has the necessary crystalhd include files:
svn co -r 22347 https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/xdmx/XBMC/xbmc/lib/
svn co -r 25101 https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/crystalhd

prepare the system for crystalhd support:
mkdir /usr/include/crystalhd
cp -a lib/crystalhd/include/* /usr/include/crystalhd
cp /usr/include/crystalhd/windows/bc_drv_if.h /usr/include/crystalhd/bc_ldil_if.h

Edit /usr/include/crystalhd/bc_dts_types.h and comment out line 59 so it looks like this:
//typedef void VOID;

Copy the crystalhd include files to the crystalhd branch source:
cp -a /usr/include/crystalhd crystalhd/xbmc/lib/

Download the bcm70012 source and build the module:
wget http://www.norco.net.cn/UpLoadFile/Driver/bcm70012_linux_01142009.rar
unrar e bcm70012_linux_01142009.rar
tar xf bcm70012_linux_01142009
dpkg -i bcm70012kmod-source_0.9.30_all.deb
apt-get -f install
dpkg -i bcm70012kmod-source_0.9.30_all.deb
cd /usr/src/
m-a -t a-i bcm70012kmod
cd -

Install the gstreamer plugin from the HP mini 110 distro (the file came with the driver download in the step above)
dpkg -i --force-all gst-broadcom-70012_0.9.30_lpia.deb

Now follow the steps from the README.ubuntu file inside the crystalhd source:
sudo aptitude install subversion make g++ gcc gawk pmount libtool nasm automake cmake gperf unzip bison libsdl-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libfribidi-dev liblzo2-dev libfreetype6-dev libsqlite3-dev libogg-dev libasound-dev python-sqlite libglew-dev libcurl3 libcurl4-openssl-dev x11proto-xinerama-dev libxinerama-dev libxrandr-dev libxrender-dev libmad0-dev libogg-dev libvorbis-dev libsmbclient-dev libmysqlclient-dev libpcre3-dev libdbus-1-dev libhal-dev libhal-storage-dev libjasper-dev libfontconfig-dev libbz2-dev libboost-dev libfaac-dev libenca-dev libxt-dev libxtst-dev libxmu-dev libpng-dev libjpeg-dev libpulse-dev mesa-utils libcdio-dev libsamplerate-dev libmms-dev libmpeg3-dev libfaad-dev libflac-dev libiso9660-dev libass-dev libssl-dev

On 8.04 and older versions, libmms is outdated and thus XBMC will not compile properly.
In this case you will have to manually compile the latest version.
wget "http://launchpad.net/libmms/trunk/0.4/+download/libmms-0.4.tar.gz"
tar zxvf libmms-0.4.tar.gz
cd libmms-0.4
./configure --prefix=/usr
make
sudo make install

After all deps has been installed and libmms has been compiled and installed you are ready to compile xbmc. cd to the crystalhd source and do:
./bootstrap
./configure
make
make install

Finito! :)

POST-install tweaks:
Enable Pixel Buffer Objects
Start xbmc without loading Gnome
And some more AppleTV specific stuff:
Set fixed cpu frequency
Various fixes for Ubuntu on ATV

Tags: , , , , , , , , , , , , , , ,

How to speedup Firefox by VACUUM’ing FF’s sqlite databases

Firefox easily often gets like Hersheys’s Syrup.
What may help is to cleanup the SQlite3 databases Firefox uses to store _SHIT_

First see that you have sqlite3 installed:
apt-get install sqlite3

Then stop/kill/murder all your firefox procs.

Run the following from a console:
for i in $(find ~/.mozilla -type f -name '*.sqlite' -print);do sqlite3 $i "VACUUM;";done

Most garbage in your firefox databases should now be clean. Fire it up again.

Tags: , , ,

New local root hole in linux kernel in kernels back to 2001

UPDATE: This exploit doesnt seem to affect my Debian Lenny, anyone else tried? Someone please confirm if the temp-fix does NOT work.

http://blog.cr0.org/2009/08/linux-null-pointer-dereference-due-to.html
http://www.theregister.co.uk/2009/08/14/critical_linux_bug/

Second time this summer linux kernel experiences big security holes. *shrug*
And this time around its for _ALL_ kernels all the way back to 2001.

Proposed temp-fix:
#!/bin/bash
# temp-fix until patched for
# http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-2692
# http://www.theregister.co.uk/2009/08/14/critical_linux_bug/
cd /lib/modules/$(uname -r)/kernel/ && \
for i in \
net/ipx/ipx.ko \
net/irda/irda.ko net/x25/x25.ko \
net/ax25/ax25.ko \
net/bluetooth/bluetooth.ko \
net/sctp/sctp.ko \
drivers/net/pppoe.ko \
drivers/net/pppox.ko;
do rm -f $i;done

This should hopefully solve this security hole until debian/other dists releases updates.

Tags: , , ,

Juniper Netscreen IPsec VPN Client for Linux

So we needed a VPN client for our Netscreen IPsec setup.
After much googling and hard hours of configs, it seemed impossible.

Until we discovered shrew: http://www.shrew.net

apt-get install ike ike-qtgui

Do some kernel tweaks to make the tunnel work:
sysctl -e net.ipv4.conf.all.rp_filter=0
sysctl -e net.ipv4.conf.default.rp_filter=0
sysctl -e net.ipv4.conf.eth0.rp_filter=0

Put it in /etc/sysctl.conf for loading on boots:
net.ipv4.conf.default.rp_filter=0
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.eth0.rp_filter=0

Also make sure iked is running: /etc/init.d/ike restart

Then make your config in shrew from credentials from your hairy juniper netscreen admin and …CONNECT!

Tags: , , , , ,

iPhone 3G 3.0 OS Tethering on Ubuntu Linux 9.04 via Bluetooth

I have struggeled some with this shit until i came over a script called uit.sh:

http://us.cooperlees.com/download.php?F=uit.sh.gz

Download it, and do this to setup deps and config:
gunzip uit.sh.gz && chmod +x uit.sh && sudo ./uit.sh -i

After that just connect to your iphone tethering with:
sudo ./uit.sh -c

Disconnect:
sudo ./uit.sh -d

I had some problems getting connection refused, this was because i had turned of 3g to save battery.
So keep that 3g ON if you want tethering!
You may also place the script in PATH to have it globally available, just remember to run the script as root/sudo.

You may also get this to work with some fancy GUI SHIT like blueman, but i like terminal more.

“We gotta create a GUI, so we can trace the ip”:
http://www.youtube.com/v/ygB0ZviqXac

Goddamn Visual Basic haxx0rz…

Tags: , , , ,

Linux Kernel 2.6.27 released

A little bit late, but hey on the October 9th, 2.6.27 got released!
Are you one of us normal flesh and bones people not understanding crapshit of the changelogs and whats new in the kernel?
Then you should check out Kernel Newbies

Of rather nice features in this new kernel:
- new fs specially optimized for flash based units(SSD etc.) called UBIFS
- XEN support for saving/restoring VMs
- improved video camera support
- support for the Intel wireless 5000 series and RTL8187B network cards,
- a new ath9k driver
- alternative hibernation implementation based on kexec/kdump
- more new drivers +++ much more fixes and improvements

This kernel will be integrated in Ubuntu 8.10 released in the end of October.

Tags: ,

A baby named Linux

Now ive seen it all:
A baby named Linux

Newspaper article (Swedish)

Poor kid, he will be like the prime target for every bully out there.
There is actually four persons in Sweden named Linux, whats wrong with them?
Who would call their baby Windows? Hell, the baby would be killed before getting the age of kindergarden.

Lets keep geekstuff and babynames apart :roll:

Tags: ,