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
 

Thursday, November 29, 2012

Remote access to your Raspberry Pi with ssl/ssh multiplexer

One big advantage of Raspberry Pi is its low power consumption. I can power on it 7x24 and remote it at anytime (of course, assumed your router is also on). SSH from internet to your Pi is simple, by just forwarding port 22 or making the Pi is the default DMZ. However, some places only allows you to visit port 80 or 443, or you have to connect to the internal via a proxy server, which also blocks every ports but 80/443.

Since port 443 is an exception, why don't we set the SSH service to listen to it? Just modify /etc/ssh/sshd_config and add a line "Port 80" or "Port 443". It does work, but wait, what about if the Pi also serves as a Web Server with SSL enabled? If you choose 443 to serve SSH, then you can't have your web server to use SSL at 443. So how to solve this situation? Here is one of the possible approach.

Monday, November 26, 2012

Create a Soalris 8 zone (32bit) to a container

Last time I had successfully created a flar image from an old Solaris 8 server (ref). Now I have to setup a zone of Solaris 10 container and install the image into it. The overall idea is clear and easy. Normally just create the zone configuration, and install it from a "flar" image.

1. Create zone configuration

root@sol10 # zonecfg -z z_sol8
z_sol8: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:z_sol8> create -t SUNWsolaris8
zonecfg:z_sol8> set zonepath=/pool/zone/sol8
zonecfg:z_sol8> set autoboot=false
zonecfg:z_sol8> set ip-type=shared
zonecfg:z_sol8> add net
zonecfg:z_sol8:net> set address=192.168.123.123
zonecfg:z_sol8:net> set physical=nxge0
zonecfg:z_sol8:net> end
zonecfg:z_sol8> verify
zonecfg:z_sol8> commit
zonecfg:z_sol8> exit


Next install the zone from the flar image: