Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Saturday, February 20, 2010

Restoring MBR on Linux and Mac OS on eeePC

Bad things happens all at one go. My Mac OS crash on me and I am not able to recover from the B-Node problem.

Recover Grub2 for Ubuntu Karmic
--------------------------------

1. mount the harddisk consist of Ubuntu Karmic by clicking "Places -> XXGB File System"

2. open terminal and do a tail

mount | tail -1

3. You should see something similar

/dev/sda2 on /media/0d104aff-ec8c-44c8-b811-92b993823444 type ext4 (rw,nosuid,nodev,uhelper=devkit)

4. Check the boot partition by

ls /media/0d104aff-ec8c-44c8-b811-92b993823444/boot

You should see something similar

config-2.6.18-3-686 initrd.img-2.6.18-3-686.bak System.map-2.6.18-3-686
grub lost+found vmlinuz-2.6.18-3-686
initrd.img-2.6.18-3-686 memtest86+.bin

If this is wrong, then your partition is wrong.

5. Now everything is correct and is time to recover. Run the following to install GRUB into the correct directory and drive name.

sudo grub-install --root-directory=/media/0d104aff-ec8c-44c8-b811-92b993823444 /dev/sda

If you get BIOS warnings try:


sudo grub-install --root-directory=/media/0d104aff-ec8c-44c8-b811-92b993823444 /dev/sda --recheck

6. If all goes well, you should see the following.

Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0) /dev/sda

More information from below:

https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows

Recover Boot Loader for Mac OS
--------------------------------

Give up. After googling for sometime, I cannot find any solution, might as well reinstall, since i have reinstall from the B-Node problem. Time is important now as I am rushing to complete my development.

Wednesday, February 17, 2010

Support Multi-Touch for eeePC in Ubuntu Karmic

I have upgraded my eeePC to Ubuntu Karmic for quite some time and I miss my muti-touch, especially when I have been using Mac OS recently. Thus my quest to enable it begins. After googling around, I realized that it can be very simple.

To enable 2 finger scrolling, do the following.

Activate at "System -> Preferences -> Mouse -> Touchpad -> Scrolling -> Two-finger scrolling"

According to https://wiki.ubuntu.com/HardwareSupport/Machines/Netbooks#Asus Eee PC 1005HA , you need to install a script from the following,

http://blog.twinapex.fi/2009/10/11/setting-up-multi-touch-scrolling-for-ubuntu-9-10-karmic-koala-linux-on-asus-eee-1005ha-netbook/

however, my works when I have enable the 2 finger scrolling. Wonder what does that script do.

Tuesday, January 5, 2010

It is possible to recover data from brick iPhone!

My iPhone brick after installing Tethering from Sinful and I have not back up for a very long. Sad to say, there is no other way except to RESTORE! :(

But, to recover the file, there is always Linux to the rescue!


1. Restore iPhone using iTune
2. Use blackra1n to jailbreak
3. Install Cydia in the iPhone
4. After launch Cydia, you will need to wait a while for it to be ready.
5. When done, install OpenSSH, BSD Subsystem and Terminal
6. Launch Terminal in the iPhone
7. change to root first,
duck:~ mobile$ su
duck:/ root#
8. Make sure you have a SSH server running on your desktop
9. Execute DD from the iPhone and make a disk image over
duck:/ root# dd if=/dev/disk0 | ssh username@mydesktop-ip 'dd of=iphone-dump.img'
10.Next use software such as photorec, scalpel, foremost

[Update]

1. Due to my iPhone wifi problem, I have access the iPhone through USB tethering on a Windows machine. Google around for the software. Once the USB tethering is setup, you can access to the iPhone from your Linux desktop.

ssh root@192.168.1.1 'dd if=/dev/disk0' | dd of=iphone.img

2. After DD out the files, I realize I am DD out the whole disk which I am not able to mount as one drive, however data can still be recoverable with that image. There are two partitions in the iPhone. The best way is to DD out separately and also as a whole, cos you never know how they are repartition after restored, which comes to the next point.

3. SSD is written randomly, unlike using normal harddisk, after one large file(s) is deleted, iPhone will not write from the first free space. It will write as random. What does this means? It means your old deleted data may be overwritten during restoration. This happens to me as I am not able to fully recovered my photos. However, I believe some of the header are gone but we still can recover from the remaining data, provided I know how to reconstruct them. More research is needed.

Wednesday, March 4, 2009

How to open "noname" attachment in Linux

Got this off somewhere. It should work in Unix or Mac too!

1. Save the attachment from Gmail to the desktop, should be noname.
2. Edit it to remove the small MIME attachment near the top and bottom, also remove all the MIME header information and the MIME delimiter at the bottom of the file. What should be left with is a huge continuous chunk of text.
3. Run the following command...
openssl enc -d -base64 -in noname -out usefulfile
4. Open the file "usefulfile" and continue with life.