Friday, June 28, 2013

Restore HP-UX from ignite tape (with screen dump)

 Objective

To restore HP-UX (11i, 11.23 should work) from a backup (make_tape_recovery)

  1. Login MP console and recycle it
  2. "CO" to console
  3. Within that "10 seconds", press any key and see the menu
    ---- Main Menu ---------------------------------------------------------------
    
         Command                           Description
         -------                           -----------
         BOot [PRI|ALT|]             Boot from specified path
         PAth [PRI|ALT] []           Display or modify a path
         SEArch [DIsplay|IPL] []     Search for boot devices
    
         COnfiguration menu                Displays or sets boot values
         INformation menu                  Displays hardware information
         SERvice menu                      Displays service commands
    
         DIsplay                           Redisplay the current menu
         HElp [|]           Display help for menu or command
         RESET                             Restart the system
    ----
    Main Menu: Enter command or menu > sea
  4. Insert the tape and run "SEA" to search devices
    Main Menu: Enter command or menu > SEA
    
    Searching for potential boot device(s)
    This may take several minutes.
    
    To discontinue search, press any key (termination may not be immediate).
    
    
                                                                               IODC
       Path#  Device Path (dec)  Device Path (mnem)  Device Type               Rev
       -----  -----------------  ------------------  -----------               ----
       P0     0/0/2/0.0          ide.0               Random access media       1    
       P1     0/1/1/0.0          intscsia.0          Random access media       1    
       P2     0/1/1/1.4          intscsib.4          Sequential access media   1    
    
    
    Main Menu: Enter command or menu >
  5. "P2 0/1/1/1.4 intscsib.4 Sequential access media 1" -> which is the tape drive

OpenVPN server setup on Raspberry Pi

Note: it is for bridge mode only


I found that Raspberry Pi is a good choice for setup OpenVPN server. I can always power on it as the power consumption is low. After setting it up, I can connect VPN to home in office or cafe outside. 

You may think port forwarding by router or via SSH is good enough. However, there are limitations when:
  1. there are lots of services you want to connect from outsider, then your port forwarding rules will be massive
  2. as the OpenVPN client can reconnect automatically, I can have a relative stable connection. Sometimes you would like to have a reserve connect from server to client. My own experience is that in my previous company, I setup OpenVPN client in office and connect to my home, leave the connection alive. Then when I go home I can reconnect to my office PC by remote desktop :)

Objective

  • Internal network: 192.168.28.0/24
  • Setup a OpenVPN server such that client connection will connect to the server and assign a 192.168.28.0/24 IP as if it is within the internal network
  • necessary install
    apt-get install  bridge-utils openvpn 

Tuesday, June 18, 2013

Cisco MDS port zoning 101

Objective

  • There are two FC ports (fd0, fd1) on a hp-ux rp3410 (hostname: rp3410 :) )
  • The storage is EMC VNX5100, we will use SPA P1/P2 and SPB P1/P2.

Physical connection

  • rp3410 fd0 will connect to SW1 port 1/7
  • rp3410 fd1 will connect to SW2 port 1/7
  • VNX5100 SPA P1 on SW1 port 1/1
  • VNX5100 SPB P1 on SW1 port 1/2
  • VNX5100 SPA P2 on SW2 port 1/1
  • VNX5100 SPB P2 on SW2 port 1/2

Switch configuration:

We will create 4 zones, 2 on each switch: The zoneset is "full-zoneset"

SW1 wwn is 20:00:xx:xx:xx:xx:xx:xx
SW2 wwn is 20:00:yy:yy:yy:yy:yy:yy

The VSAN of SW1 is 201, SW2 is 202

(it is port zoning, for soft zoning by wwn, it will be ready later)

SW1:
config t

vsan database
vsan 201 interface 1/7
 
interface 1/7
no shutdown
switchport mode F
switchport description "rp3410_fd0"

zone name rp3410_fd0_VNX5100_VNX_SPA1 vsan 201
member interface fc 1/1 swwn 20:00:xx:xx:xx:xx:xx:xx
member interface fc 1/7 swwn 20:00:xx:xx:xx:xx:xx:xx

zone name rp3410_fd0_VNX5100_VNX_SPB1 vsan 201
member interface fc 1/2 swwn 20:00:xx:xx:xx:xx:xx:xx
member interface fc 1/7 swwn 20:00:xx:xx:xx:xx:xx:xx

zoneset name full-zoneset vsan 201
memeber rp3410_fd0_VNX5100_VNX_SPA1
memeber rp3410_fd0_VNX5100_VNX_SPB1
zoneset activate name full-zoneset
 
SW2
config t

vsan database
vsan 202 interface 1/7

interface 1/7
no shutdown
switchport mode F
switchport description "rp3410_fd1"

zone name rp3410_fd1_VNX5100_VNX_SPA2 vsan 202
member interface fc 1/1 swwn 20:00:yy:yy:yy:yy:yy:yy
member interface fc 1/7 swwn 20:00:yy:yy:yy:yy:yy:yy

zone name rp3410_fd1_VNX5100_VNX_SPB2 vsan 202
member interface fc 1/2 swwn 20:00:yy:yy:yy:yy:yy:yy
member interface fc 1/7 swwn 20:00:yy:yy:yy:yy:yy:yy

zoneset name full-zoneset vsan 202
memeber rp3410_fd1_VNX5100_VNX_SPA2 vsan 202
memeber rp3410_fd1_VNX5100_VNX_SPB2 vsan 202
zoneset activate name full-zoneset

Wednesday, May 08, 2013

Update MoinMoin from 1.9.5 to 1.9.7

This is the general steps for updating moinmoin from 1.9.5 to 1.9.7

  1. Stop web server or standalone process
  2. backup wiki instance (eg. mywiki or instance1)
  3. backup moinmoin installation path
  4. if there is customized logo, backup it as well (eg. moinmoin.png)
  5. delete *.pyc or *.pyo
    find  -name *.pyc -exec rm {} \; 
  6. download moinoin1.9.7 and install to existing path
    python setup.py install --prefix 
  7. replace moinmoin.png if necessary
  8. if using web server, remember to change the static path from "/moin_static195" to "/moin_static197"
  9. start web server or standalone process
  10. double check the version by http:///SystemInfo

Monday, February 18, 2013

Setup Trac on Raspberry Pi as a Wiki and Issue Tracking Tool

Trac with GIT

Trac is a wiki and issue tracking tool. There are other choices such as redmind and mantisbt. However, Trac is the most suitable one for running on Raspberry Pi because:
  1. it is run by python, which is installed by default for raspbian. (php and ruby are not required)
  2. it is relatively light weight. It can use sqlite as the database, rather than MySQL or PostgresSQL.
  3. it can be run in standalone mode, without using apache or lighttpd. (although I will still use lighttpd to 'proxy' Trac)
  4. It supports modern version control tool such as Subversion and GIT. (redmine also supports, but again, it's not that light weight)
  5. with making use of virtual environment (virutalenv), you can setup Trac without using a privilege account.
  6. it is a mature product and many organizations are using it (http://trac.edgewall.org/wiki/TracUsers)

Install and setup Trac

First, make sure virtualenv is already installed. (apt-get install virtualenv)

Remove a file completely in GIT

GIT is a great version control tool. I was a CVS and SVN users but I think GIT is even more powerful. Perhaps I can write something about GIT but now I want to share an experience: How to remove a file completely from GIT.

There is an internal db in GIT. Once your add and commit codes into the repository, the info will be store and the great thing is that you can check out the file at any version. However, I did an stupid thing - I hard coded some personal information (eg password) in a file and commit it to the repository. It won't be a problem if you are the only developer of the project.  But if you need to share the code by cloning the repository to the others, your information can be retrieved, even you delete it in filesystem.

So I did some quick search and find a solution: just runt the following command to remove the history and file:

git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch " HEAD

Make sure you make a copy to some places out of the GIT repository. Then you can copy the file back and add it as a "fresh new" file.

PS. As a better practice, don't hard coded any thing that cannot be shared in a repository !!

Tuesday, January 29, 2013

Getting Serial Number of HP-UX (works on RP5470 - HP11i PA-RISC)

HP-UX 11i is now pretty old but it is surprised that there are still a lot of companies using it. Though it is stable but hardware failure is something unpreventable. Once you found hardware fault, you probably need to call vendors (HP or others) to diagnostics.

A typical question will be "what is your server model? OS? Serial number?" Here is the quick answer:

OS Version: uname -a
Model: model (yes, simple?)
Serial Number: no single command to get it. but the information can be retrieved in cstm:
echo "sel path system\ninfolog\nexit"|cstm|grep "System Serial Number"

eg.
# uname -a
HP-UX zzzzzzzzz B.11.11 U 9000/800 106424635 unlimited-user license
# model
9000/800/L3000-8x
# echo "sel path system\ninfolog\nexit"|cstm|grep "System Serial Number"
   System Serial Number...: xxxxxxxxxx