Bridge networking configuration

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
        address 192.168.155.xxx
        network 192.168.155.0
        netmask 255.255.255.0
        gateway 192.168.155.1
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0

Install Mac on any PC

To ensure you don't lose any files, use a blank hard drive.

1. Download the Rebel EFI file, available here.
2. Burn the file to a CD.
3. Insert the Rebel EFI disc into your CD drive.
4. Start or restart your computer.
5. As computer boots up select, Boot Options or Boot Menu Key
**Boot Options or Boot Menu Key differ by motherboard manufacturer.
6. Select CD ROM
7. After CD loads press enter to run the CD
8. When prompted, Eject the CD and it will ask for the Snow Leopard DVD
9. Insert the Snow Leopard DVD
10. Select Main Language
11. Click Continue, if you want to continue with the installation of Snow Leopard.
12. Click Agree, if you agree.
13. Select the disk that you want to install Snow Leopard on.
a. If no disk shows, Click on Utilities on the tool bar, then select Disk Utilities.
b. On the left you should see your hard drive.
c. If not, a disk is not connected or cannot be read by your computer.
d. After selecting your hard drive click on Partition.
e. Under Volume Scheme, click current and select 1 partition.
f. Under Volume Information, name your hard drive.
g. Format: Mac OS Extended (Journaled)
h. At the bottom of the window Click on the Options Button.
i. Select the GUID Partition Table
j. Click OK
k. Click Apply
l. Click Partition
m. Quit Disk Utilities
14. Select the disk that you want to install Snow Leopard on.
15. Click Install.
16. When Installation completes. restart the computer
17. As the computer starts up, insert the Rebel EFI CD
18. As computer boots up select Boot Options or Boot Menu Key
**Boot Options or Boot Menu Key differ by motherboard manufacturer.
19. Select CD ROM
20. Once CD loads you will see both the Hard Disk and the Rebel EFI CD
21. Use the arrow keys to highlight the Hard Drive
22. Press Enter to boot Hard drive.
23. Launch the Rebel EFI application from the CD.
24. Follow the on-screen authentication procedure.
25. Click Continue
26. Select your Keyboard
27. Click Continue
28. Select, Do not transfer my information now.
29. Click Continue
30. If, you have and Apple ID enter it now
31. If not, Click Continue
32. Enter your Registration Information
33. Click Continue
34. Create your Account Information
35. Click Continue
36. Select Time Zone
37. Click Continue
38. Click Done

How to disable Ubuntu apparmor


sudo /etc/init.d/apparmor kill


sudo update-rc.d -f apparmor remove



apparmor_status will show the current status of apparmor

Python IP V4 validation

def validIP(address):
    parts = address.split(".")
    if len(parts) != 4:
        return False
    for item in parts:
        if not 0 <= int(item) <= 255:
            return False
    return True

Password less login's between servers ( ssh , scp , rsync)

For a particular user


/home/username/.ssh   ( go to this directory if that directory does not exists create one with name .ssh )

The key generated for password less login is user specific. So create separate keys for each user.


Goto .ssh directory

ssh-keygen -t rsa  (give that command and click next next as usual :) )


It will generate id_rsa and id_rsa.pub two files

one is private key and another is public key

now append the contents of id_rsa.pub to file authorized_keys in the system you want to connect

the file authorized_keys will be in .ssh directory of the other system if that file is not there create it.

cat id_rsa.pub >> ~/.ssh/authorized_keys

now try user@192.168.1.2 ( if 192.168.1.2 is the system you want to connect without password)


Hypervisor and their virtual disk formats

HYPERVISOR FORMAT
VirtualBox VMDK Stream Optimized
VirtualBox RAW
VirtualBox VMDK Flat
VirtualBox VMDK Sparse
VirtualBox VHD Flat Disk
VirtualBox VDI Fixed Disk
VirtualBox VDI Sparse Disk
KVM RAW
KVM VMDK Flat
KVM VMDK Sparse
KVM VHD Flat
KVM VHD Sparse
KVM QCOW2 Flat
KVM QCOW2 Sparse
XEN RAW
XEN VMDK Flat
XEN VMDK Sparse
XEN VHD Flat
XEN VHD Sparse
VMWARE RAW
VMWARE VMDK Flat
VMWARE VMDK Sparse
Hyper-V VHD Flat
Hyper-V VHD Sparse