Horas and konnichiwa untuk semua


Multiple NIC on Xen
December 8, 2008, 3:52 pm
Filed under: notes/General

You have multiple NICs on Dom0, but after a standard install of Xen, only one is used by Dom0. You wish Dom0 to use the other NIC too. You need to create another bridge connected to that NI. Here is how:

Edit /etc/xen/xend-config.sxp, change the line below:

(network-script network-bridge)

to become as follows:

(network-script network-multi-bridge)
“network-multi-bridge” is the script you need to make, which contains the following:

#!/bin/sh
# network-xen-multi-bridge
# Exit if anything goes wrong
set -e

# First arg is operation
OP=$1
shift
script=/etc/xen/scripts/network-bridge.xen

case ${OP} in
start)
$script start vifnum=1 bridge=xenbr1 netdev=eth1
$script start vifnum=0 bridge=xenbr0 netdev=eth0
;;
stop)
$script stop vifnum=1 bridge=xenbr1 netdev=eth1
$script stop vifnum=0 bridge=xenbr0 netdev=eth0
;;
status)
$script status vifnum=1 bridge=xenbr1 netdev=eth1
$script status vifnum=0 bridge=xenbr0 netdev=eth0
;;
*)
echo ‘Unknown command: ‘ ${OP}
echo ‘Valid commands are: start, stop, status’
exit 1
esac

Then restart Xen (/etc/init.d/xend restart on CentOS). Do “brctl show” like below and you’ll see now there are two bridges:

[root@vps xen]# brctl show
bridge name     bridge id               STP enabled     interfaces
virbr0          8000.000000000000       yes
xenbr0          8000.feffffffffff       no              vif9.0
peth0
vif0.0
xenbr1          8000.feffffffffff       no              vif9.1
peth1
vif0.1

Now if you have existing DomU, modify the configuration so that it uses both NICs if you want. Then you add the script for the new interface (usually located at /etc/sysconfig/network-scripts) and do an “ifup” to bring the interface up.

That’s it.



AT command on Mac
November 14, 2008, 11:39 am
Filed under: notes/General

Not the UNIX command "at", but modem’s AT command. Here is how to run AT command on Mac OS X.

The modem device is at /dev/, the name begins with ttty. The command is "screen". For example, here is how with ZTE modem:

$ screen /dev/tty.ZTEUSBModem_0000201A



snmpwalk
September 21, 2008, 5:18 pm
Filed under: notes/General

Check available OIDs
E.g.,
snmpwalk -v 2c -c mtbsnmpcomm 172.33.0.135 .1.3.6.1.2.1.25.3.2.1



OpenOffice “Aqua”
March 28, 2008, 3:40 pm
Filed under: notes/General

It’s rather difficult to find the place to download OpenOffice “aqua” version (for Mac). Here it is:

Porting site (but not uptodate?)
http://porting.openoffice.org/mac/download/aqua.html
Updated main site (in Japaese)
http://homepage.mac.com/oz_k/open_soft/aqua_ooo24.html
Download site:
http://ooopackages.good-day.net/pub/OpenOffice.org/MacOSX/



Use Inkscape on Mac to do batch conversion
March 5, 2008, 2:09 pm
Filed under: notes/General

Here is how to use Inkscape on Mac to do batch conversion from SVG to PNG:

1. First, get Inkscape for Mac
2. Open Terminal then run as follows:

for i in *.svg; do /path/to/Inkscape.app/Contents/Resources/bin/inkscape -f "$i" -e "$i.png" -w 1000; done

-w 1000 is make the size big (1000 pixels)