D-Link DWA-125 works on ubuntu 12.04 server out of the box

Just to confirm. Set up step is easy, once you plug in the usb adapter.

Step 1. use

$ ifconfig

to find out if wlan0 is already up. If not,

$ sudo ifconfig wlan0 up

Step 2. Check if the adapter detects available wifi signals

sudo iwlist scan

It works on my ubuntu 12.04.

Step 3. the WIFI spot I am about to connect is password protected. So need to type

wpa_passphrase YOURSSID YOURWIFIPASSWORD

This will result in something that looks like this:

network={
ssid="YOURSSID"
#psk="YOURWIFIPASSWORD"
psk=fe727aa8b64ac9b3f54c72432da14faed933ea511ecab1 5bbc6c52e7522f709a
}

Remember the long string.

Step 4. Next, you need to edit your interfaces file, so issue:

sudo nano /etc/network/interfaces

At the end of this file, you need to add your WiFi configuration. Here are the options you can add.

auto wlan0     #change this to the name of your WiFi interface
iface wlan0 inet dhcp     #this is normally fine, if you want a static IP address replace “dhcp” with “static”
netmask 255.255.255.0     #change this as appropriate for your network, this value is usually right
gateway 192.168.1.1     #change this as appropriate for your network
address 192.168.1.100     #only needed for a static IP address
dns-nameservers 192.168.1.1     #only needed for a static IP address
wpa-driver wext     #you shouldn’t need to change this
wpa-ssid YOURSSID     #just type the name of your SSID here
wpa-ap-scan 1     #if the name of your SSID is hidden usually, type 2 instead of 1
wpa-proto WPA    #if you use WPA1 type WPA, if you use WPA2 type RSN
wpa-pairwise CCMP     #if you use AES type CCMP, if you use TKIP type TKIP
wpa-group CCMP     #if you use AES type CCMP, if you use TKIP type TKIP
wpa-key-mgmt WPA-PSK     #usually WPA-PSK (if you share a key) but sometimes WPA-EAP (for enterprises)
wpa-psk YOURHEXKEYFROMABOVE     #the hex key that you generated earlier

Step 5. Finally, comment out the top section so it looks like this:

#auto eth0
#iface eth0 inet dhcp

This stops your wired network from working. This helps to ensure there are no conflicts. Remember, if you want your wired network to work again, remove these two comments (the #).

After the 5 steps, my usb adapter is up and running. You can reboot if needed to reconfigure the networking interface.

A major part of this learning notes follow this blog.

set up your own git repository with Qtcreator on Ubuntu 12.04 server

I followed this instruction
Since I am the only developer, I simplified the process a lot. Here are the steps:
1. make sure git has been installed by checking

$ which git
/usr/bin/git

or install it by typing:

$ sudo apt-get install git-core

2. create your git folder on ubuntu server 12.04

$ cd
$ mkdir git
$ cd git
$ mkdir project1.git
$ cd project1.git
$ git --bare init

3. on the local computer where you develop programs, type

# on local computer
$ cd myproject
$ git init
$ git add .
$ git commit -m 'initial commit'
$ git remote add origin junwei@junweihuang.info:/your/path/to/project1.git
$ git push origin master

4. on the local computer I develop programs in Qtcreator. After the above steps, git remote repository is already set and thus future operations can be committed to the remote server.

git under Qtcreator

git under Qtcreator

When a 6-node cluster told you this “connect() to 192.168.122.1 failed: Connection refused (111)”

and all processors hangs, like waiting for ever. Here is the solution and I just do a copy/paste:

Tell Open MPI not to use the virtual bridge interface virbr0 interface for sending messages over TCP/IP. Or better tell it to only use eth0 for the purpose:

$ mpiexec --mca btl_tcp_if_include eth0 ...

This comes from the greedy behaviour of Open MPI’s tcp BTL component that transmits messages using TCP/IP. It tries to use all of the available network interfaces that are up on each node in order to maximise the data bandwidth. Both nodes have virbr0 configured with the same subnet address. Open MPI falls to recognise that both addresses are equal, but since the subnets match, it assumes that it should be able to talk over virbr0. So process A is trying to send a message to process B, which resides on the other node. Process B listens on port P and process A knows this, so it tries to connect to 192.168.122.1:P. But this is actually the address given to the virbr0 interface on the node where process A is, so the node tries to talk to itself on a non-existent port, hence the “connection refused” error.

To avoid remember such a long command, I added

alias mympirun='mpirun --mca btl_tcp_if_include eth0'

to ~/.bashrc

Use ganglia to monitor DRBL (Diskless Remote Boot in Linux) based cluster

Another helmer cluster with 52 cores, 104 GB RAM and 3 TB hard disk has been assembled. To monitor master and slave nodes, I installed ganglia on the master node. In a nutshell, ganglia works like this:
1. gmond: A process running on the slave nodes. On Ubuntu, run

sudo apt-get install ganglia-monitor

to install it. It’s configuration file is /etc/gmond.conf, and the associated service is ganglia-monitor.
2. gmetad: A process running on the master that collects the statistics sent by the various gmond processes in the slave nodes. For Ubuntu, this is the package ganglia-webfrontend package:

sudo apt-get install ganglia-webfrontend

Its configuration in /etc/gmetad.conf, and the associated service is gmetad.
3. A web UI: The web front end is installed/contained within the same package as gmetad. The UI is used to display the collected data.

Since the DRBL based slave nodes have no harddrive, so all the services must be started from the master.
1. The first step is to add “#mcast_if = eth1”:

/* Feel free to specify as many udp_send_channels as you like.  Gmond
   used to only support having a single channel */
udp_send_channel {
  mcast_join = 239.2.11.71
  #mcast_if = eth1
  port = 8649
  ttl = 1
}

/* You can specify as many udp_recv_channels as you like as well. */
udp_recv_channel {
  mcast_join = 239.2.11.71
  #mcast_if = eth1
  port = 8649
  bind = 239.2.11.71
} 

The master node uses eth1 to communicate with slaves, whereas slaves use eth0 communicate with the master. So the trick here is keep the “#” and do

sudo drblpush -c /etc/drbl/drblpush.conf

2. With all slaves alive, run the following commands

sudo drbl-client-service ganglia-monitor on
sudo drbl-doit "/etc/init.d/ganglia-monitor start"

3. done. It will look like this

Ganglia monitor DRBL based cluster

Ganglia monitor DRBL based cluster

!!!Remember before every time you run

sudo drblpush -c /etc/drbl/drblpush.conf

Keep the “#” in front of “mcast_if = eth1” and uncomment it when you start ganglia on the master node.