Category Archives: Computer Tips

Setup qemu and bridged network on ubuntu

Install qemu
apt-get install qemu-kvm virt-manager virt-viewer libvirt-bin bridge-utils
If it doesn’t work, use this:
apt-get install qemu-kvm qemu virt-manager virt-viewer libvirt-bin bridge-utils

Unfortunately, you don’t get the bridged network by default, so this is what has to be done:
refrence: http://wiki.libvirt.org/page/Networking#Bridged_networking_.28aka_.22shared_physical_device.22.29
stop network-manager
echo "manual" | tee /etc/init/network-manager.override

And you need to change your interface file like this:
/etc/network/interfaces
auto br0
iface br0 inet static
address 192.168.2.4
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.2
bridge_ports eth0
bridge_stp on
bridge_maxwait 0
bridge_fd 0

Also add the ‘/etc/sysctl.conf’ settings to the end of the file:
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0

Apply the changes:
sysctl -p /etc/sysctl.conf

To my surprise even this is needed:
Add to /etc/rc.local:
/sbin/sysctl -p /etc/sysctl.conf
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
exit 0

Root or run something like this:
ifdown eth0 && ifup br0

And last but not least, with br0, beloved eth0 seems gone forever, I don’t like this, but what other choice I have.

ubuntu boot into textmode

pico /etc/default/grub
And Do below changes:

Comment the line GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”, by adding # at the beginning, which will disable the Ubuntu purple screen.
Change GRUB_CMDLINE_LINUX=”” to GRUB_CMDLINE_LINUX=”text”, this makes Ubuntu boot directly into Text Mode.
Uncomment this line #GRUB_TERMINAL=console, by removing the # at the beginning, this makes Grub Menu into real black & white Text Mode (without background image)

And run this after:
update-grub

source: http://ubuntuhandbook.org/index.php/2014/01/boot-into-text-console-ubuntu-linux-14-04/

Join mp4 files with mp4box

First of all need a linux system, if you have a windows try to find a windows version of mp4box
On ubuntu, install the package that contains mp4box:
aptitude install gpac
then run the command like this to join or merge the mp4 files
MP4Box -cat path/to/video1.mp4 -cat path/to/video2.mp4 -cat path/to/video3.mp4 -new path/to/output.mp4

disable ipv6 address on linux or linode

if you want to remove ipv6 address run the below command:
sysctl -w net.ipv6.conf.all.autoconf=0
sysctl -w net.ipv6.conf.eth0.autoconf=0
sysctl -w net.ipv6.conf.all.accept_ra=0

to make it permanently add it to the sysctl.conf

Also on Debian Etch (probably on newer too), without setting the accept_ra, the system will autoconfigure using the Link local adress (fe80..)

Further more, automatic address configuration and router discovery will be disabled if the host itself is a router and accept_ra is not 2, i.e
net.ipv6.conf..forwarding=1
and
net.ipv6.conf..accept_ra=0 or net.ipv6.conf..accept_ra=1.

reference:
http://superuser.com/questions/33196/how-to-disable-autoconfiguration-on-ipv6-in-linux