Archive

Monthly Archives: October 2010

Advertisements

Finally I got my own server. It looks like:

Well, it’s not a rack nor a blade nor a tower. It’s just a pogoplug based on Marvell’s plug computer architecture with an ARM cpu running plugbox linux. But it is small, noiseless, and power-save.

Now this WordPress blog is running on this server. Lighttpd + FastCGI + PHP + MySQL are chosen to support WordPress. I guess Lighttpd should be smaller and faster than Apache. For database, I really want to use some lightweight database, such as SQLite, rather than MySQL. But I don’t know whether WordPress can provide a good support for SQLite. So I give up this thought. All of these softwares are running on Plugbox Linux, a linux distribution similar to Archlinux but is designed to support Marvell’s ARM cpu.

For those who also want to turn pogoplug into a linux web server, there are some tutorials on plugapps site, but some of these documents are out of date or not for Plugbox linux. And Lifehacker has a wonderful guide for turning a pogoplug into a LAMP server. Generally you can just follow this guide to make your own server.

Here are some tips that are not mentioned in Lifehacker’s guide:

  1. If you encounter some glibc compatibility problem when installing softwares, run pacman -Syyu to do a full update to your system.
  2. Make sure to create a mysql group and a mysql user before you install MySQL.
  3. If MySQL service can’t start and show some error like /var/run/mysql.sock not found, you can just use touch to create one, but remember to assign a right permission such that user mysql can read and write it. I was stuck on this for a long time.
  4. When WordPress has been installed and it can not find any plugins or themes you installed, just check the permission of related files again and correct it if user http can’t read it.


###Update Oct. 25, 2010###

As MySQL made this server quite slow, I removed the need for MySQL by using Pdo plugin for WordPress and SQLite database, which brings a considerable speed improvement.

###Update Jan. 25, 2011###

There is a modified firmware that can enable the total 256mb RAM in pogoplug v2 “pink”. You can get an installation instruction from this link. Remember to boot to the original PogoPlug OS before starting the update. The flash_erase program can be retrieved via

wget http://jeff.doozan.com/debian/uboot/flash_erase

When handling my Algorithm Homework, I found there are no packages providing a simple macro to draw a sorting network in LaTeX. So I spent some time and wrote a macro to help.

You can get the tex code from here(updated below). It is tested under TexLive 2009/Archlinux. A sample sorting network drawn by this code is as follows, which is taken from Figure 27.12, CLRS book 2nd Edition.

This macro requires Tikz, forarray(updated below) and tokenizer packages. But in fact I think only the requirement for Tikz is necessary, and the needs for forarray and tokenizer can be eliminated by using LaTeX primitives.

B.T.W. This is my first LaTeX macro. I am still not familiar with macros in LaTeX and have to remind myself that this is just a macro again and again to get rid of the willing to use variables. Maybe I should do some more improvements to make it a sty file so it can be used like a package. But what ever, it works now and just fits my requirements. So I decide to leave it as it is.

##UPDATE Oct. 15, 2010##

I rewrote the code and removed the requirement for forarray package, because forarray package has a collision on \ForEach command with algorithm2e package. You can get the updated tex file here.

##UPDATE May 8, 2011##

I moved the code to github. You can check it out here.