Wednesday, January 29, 2014

Configuring Supermicro IPMI interface NIC using ipmitool

Newer Supermicro IPMI interfaces come configured by default in “failover” mode which means that the IPMI will bind to either the dedicated IPMI NIC port or share with one the the machine NIC ports.
This can cause IPMI to come up on wrong NIC and hence be inaccessible if the dedicated NIC doesn’t detect a link.
You can use ipmitool to change this behavour
First query the current setting:
ipmitool raw 0x30 0x70 0x0c 0
The result will be one of the following
0x00 = Dedicated
0x01 = Onboard / Shared
0x02 = Failover

Next to configure it you can use one of the following.
For older models:
ipmitool raw 0x30 0x70 0x0c 1 1 0
For X9 motherboards:
ipmitool raw 0x30 0x70 0x0c 1 0
References for this can be found here:
http://www.supermicro.com/support/faqs/faq.cfm?faq=9829
http://www.supermicro.com/support/faqs/faq.cfm?faq=14417

Thursday, January 23, 2014

eth* and em*

https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/appe-Consistent_Network_Device_Naming.html

Monday, January 13, 2014

Difference bewteen Pylab and pyplot

Matplotlib is the whole package; pylab is a module in matplotlib that gets installed alongsidematplotlib; and matplotlib.pyplot is a module in matplotlib.
Pyplot provides the state-machine interface to the underlying plotting library in matplotlib. This means that figures and axes are implicitly and automatically created to achieve the desired plot. For example, calling plot from pyplot will automatically create the necessary figure and axes to achieve the desired plot. Setting a title will then automatically set that title to the current axes object:
Pylab combines the pyplot functionality (for plotting) with the numpy functionality (for mathematics and for working with arrays) in a single namespace, making that namespace (or environment) even more MATLAB-like. For example, one can call the sin and cos functions just like you could in MATLAB, as well as having all the features of pyplot.
The pyplot interface is generally preferred for non-interactive plotting (i.e., scripting). Thepylab interface is convenient for interactive calculations and plotting, as it minimizes typing. Note that this is what you get if you use the ipython shell with the -pylab option, which imports everything from pylab and makes plotting fully interactive.

Monday, December 30, 2013

[CC]IPMI over LAN on Ubuntu 12.04

Doing this on two of these machines:
System Information
Manufacturer: Supermicro
Product Name: X9DBL-3F/X9DBL-iF
In the IPMI section of the BIOS, set the IP/gateway/netmask addresses. (This can also be done from inside the Linux Kernel with `ipmitool` after loading the modules.) I left all the other IPMI settings as default.
After a reboot, visit the IP of the IPMI LAN device in a browser from a separate computer. I found everything worked except console redirection (SOL – Serial Over Lan,) as indeed this has to be setup inside the Linux Kernel.
These are the steps I took to make console redirection work:
1. The first thing I did was install the tools and setup the modules.
  • Install the needed software:
sudo apt-get install ipmitool freeipmi-tools
  • Find the information about the BMC (press ‘q’ to ‘quit’ less when done):
sudo ipmi-locate | less
  • I found the information needed in the first few lines of the output as seen here:
Probing KCS device using DMIDECODE... done IPMI Version: 2.0
 IPMI locate driver: DMIDECODE
 IPMI interface: KCS
 BMC driver device:
 BMC I/O base address: 0xCA2
 Register spacing: 1
  • Add the appropriate modules into the Kernel, for the ‘ipmi_si’ one use the information found with ipmi-locate like this:
sudo modprobe ipmi_si type=kcs ports=0xCA2 regspacings=1
sudo modprobe ipmi_devintf
sudo modprobe ipmi_msghandler
sudo modprobe ipmi_poweroff
sudo modprobe ipmi_watchdog
  • Now if you “ls -ahl /dev/ipmi*” you should see an ipmi0
2. Next, we need to setup a tty and tell grub to pass options to the Kernel command to redirect it’s console to that tty.
  • Make a copy of an existing tty and edit it. I’m using vim, but use whatever editor you like:
sudo cp /etc/init/tty1.conf /etc/init/ttyS1.conf
sudo vi /etc/init/ttyS1.conf
  • Edit the file to reflect ‘ttyS1′ instead of just ‘tty1′. Also edit the last line to use a baud rate of 115200, and tell it the type  ’vt100′. Mine looks like this when done:
# ttyS1 - getty
#
# This service maintains a getty on ttyS1 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345]

stop on runlevel [!2345]

respawn
exec /sbin/getty -8 115200 ttyS1 vt100
  • We must pass “console=tty1 console=ttyS1,115200n8″ as options to the command in our boot loader that starts the kernel. Note: the order of options passed to the kernel is important, the last “console” entry defines the ‘default’ console for the kernel. For grub-pc open up /etc/default/grub with your favorite editor and with sudo permissions and change GRUB_CMDLINE_LINUX=”" line to look like this:
GRUB_CMDLINE_LINUX="console=tty1 console=ttyS1,115200n8"
  • Don’t forget to update grub after this: (I also changed ‘GRUB_HIDDEN_TIMEOUT_QUIET’ to false, and I uncommented the ‘GRUB_TERMINAL=console’ line.)
sudo update-grub
3. Now we’re pretty much ready to connect. The only problem I found was with the launch.jnlp file that the Supermicro webUI spits at you. I’ll show you the edits I made to make it work:
  • Again visit the IP pointed at your IPMI and login in to the webUI. Click the ‘Launch SOL’ button under the ‘Remote Control’ tab, choose to save the file instead of opening it in your browser’s web java application (‘IcedTea java web start’ in my case.)
  • Towards the beginning of the file, look for these lines:
<property name="jnlp.packEnabled" value="true"/>
<property name="jnlp.versionEnabled" value="true"/>
  • Copy those two lines and scroll down a little until you see the distribution you are running and paste them into the there. I did it for each distribution so I didn’t have to think about it. I ended up with entries looking like this:
<resources os="Linux" arch="x86_64">
  <property name="jnlp.packEnabled" value="true"/>
  <property name="jnlp.versionEnabled" value="true"/>
  <nativelib href="liblinux_x86_64.jar" download="eager" version="1.0.3"/>
</resources>
  • Lastly, scroll to the end of the file where you will see a list of “argument” xml tags. The one below the one that contains your IP probably contains a seemingly random string of letters, but it needs to be changed to the username you setup to login to the IPMI webUI, and the one below needs to be your password. Like this:
<argument>123.123.123.123</argument>
<argument>[username]</argument>
<argument>[password]</argument>
  • Save the file and run it and you should now be ready to sit in front of the machine remotely. Reboot the server to watch it boot up, offer you the opportunity to enter the BIOS, and then offer you a login prompt. :-)
P.S. Don’t forget to edit the factory installed users in your IPMI webUI and change their passwords and/or disable them!
EDIT 07/06/13:
Corrected the line:
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS1,115200n8"
to:
GRUB_CMDLINE_LINUX="console=tty1 console=ttyS1,115200n8"
Also,
Corrected the line:
exec /sbin/getty -8 115200 tty1 vt100
to:
exec /sbin/getty -8 115200 ttyS1 vt100
Also,
Removed the lines from ttyS1.conf pertaining to ‘containers’:
and (
          not-container or
          container CONTAINER=lxc or
          container CONTAINER=lxc-libvirt)
Everything is running smoothly after this, even when networking is turned off in the kernel.

Tuesday, September 24, 2013

mapping Probe ID to Gene ID by using R

1) in or after 2006, there should be good Probe Id to GENE id map.

2) necessary package:
Biobase,
GEOquery

3) load the GPL platform file:
gpl5425 = getGEO('GPL5425',destdir=".")
         
## get annotation table
gpl5425_ann = Table(gpl5425)

#make the rownames to be ID
rownames(gpl5425_ann) = gpl5425_ann$ID

--------------------------------------------------------------------------------
                               ID                                        GB_ACC      GENE_SYMBOL                                    
AA799301_PROBE1 AA799301_PROBE1     AA799301   LOC498225            
AA799313_PROBE1 AA799313_PROBE1     AA799313      Siat10 ST3
AA799329_PROBE1 AA799329_PROBE1     AA799329     Col10a1      
AA799331_PROBE1 AA799331_PROBE1 NM_001007634        Pelo
--------------------------------------------------------------------------------

#assume the expression data is:
gse24417

--------------------------------------------------------------------------------
            ID_REF GSM204540 GSM204503 GSM204587 GSM204994
1 NM_016986_Probe1   14.5383   15.6827   14.0196   15.0969
2 NM_016987_Probe1   12.7629   15.6014   13.1481   14.4640
3 NM_016988_Probe1   14.0954   14.0583   13.6035   14.3924
4    M27893_Probe1   12.4787   12.6605   11.6335   14.0050
5 NM_012490_Probe1    8.9914    8.2654    9.2640    6.5239
--------------------------------------------------------------------------------

rownames(gse24417) = gse24417$ID_REF

#get the probe id, with upper character
pid = toupper(gse24417$ID_REF)

#get the gene symbol id
gid = gpl5425_ann[pid,]$GENE_SYMBOL

## gid contains empty value: "" , and NA value "NA", find the index of them and delete the lines.
blank_id = which( gid == "")
na_id = which(is.na(gid))

#now combine the final data
unwanted_index = c(blank_id,na_id)

gid = gid[-unwanted_index]
gse24417 = gse24417[-unwanted_index]

gse24417$ID_REF = gid

## now remove the repeated genes








Saturday, August 17, 2013

IPMItool

check this website:



Blink:
ipmitool -H 192.168.0.130 chassis identify
Set the ip address:
ipmitool -U root -P root -H 192.168.0.120 lan set 1 ipsrc static
ipmitool -U root -P root -H 192.168.0.120 lan set 1 ipaddr 192.168.0.102
ipmitool -U root -P root -H 192.168.0.120 lan set 1 netmask 255.255.255.0
Print net config:
ipmitool -U root -P root -H 192.168.0.120 lan print
Reboot the server:
ipmitool -H server-ipmi -U root -P root chassis power reset

ipmitool on localhost without an ip

modprobe ipmi_si
modprobe ipmi_devintf
Enable the root user with a password:
ipmitool user set password 2 admin

Force the Server into Bios

[root@server ~]$ ipmitool -H 192.168.0.120 -U root -P root  chassis bootparam set bootflag force_bios
Set Boot Device to force_bios
[root@server ~]$ ipmitool -H 192.168.0.120 -U root -P root chassis power reset
Chassis Power Control: Reset

Force the Server to Boot to Disk

[root@server ~]$ ipmitool -H 192.168.0.120 -U root -P root chassis bootparam set bootflag force_disk
Set Boot Device to force_disk
[root@server ~]$ ipmitool -H 192.168.0.120 -U root -P root chassis power reset
Chassis Power Control: Reset

Force the Server to Boot PXE

[root@server ~]$ ipmitool -H 192.168.0.120 -U root -P root chassis bootparam set bootflag force_pxe
Set Boot Device to force_pxe
[root@server ~]$ ipmitool -H 192.168.0.120 -U root -P root chassis power reset 
Chassis Power Control: Reset

Refernces

Tuesday, July 23, 2013

nxclient arrow keys not working.

Inside your nx session, open a terminal window and run:

setxkbmap -model evdev -layout us

Replacing "us" with your desired layout if it isn't the US layout. Your keymap should be correct now. If you start your nx session using an .xsession/.xinitrc style script, you can add the setxkbmap command to the startup script.