Thursday, December 6, 2012

Deal with 4px extra pixel under image


The problem is that by default the bottom of images are lined up with the baseline of the text — which means the bottom of most letters, but there is still that small space for the bottoms of letters like p and q.
By default vertical-align is set to baseline. All you have to do to fix the problem is set:
a img { vertical-align: bottom; }

Friday, May 11, 2012

Upgrade Redmine 2.0

Step 1. Download Redmine from SVN # svn co http://redmine.rubyforge.org/svn/branches/2.0-stable redmine-2.0 Since Redmine 1.4.0, it is recommend to use Bundler to manage gem dependencies. # gem install bundler Create a symbolic link to /usr/bin # ln -s /var/lib/gems/1.8/bin/bundle /usr/bin/bundle After install Bundler gem, it is required to install a bunch of packages first: # apt-get install libmysqlclient-dev libpq-dev libmagickwand-dev libsqlite3-dev Then you can run the bundle command successfully: # bundle install --without development test

Tuesday, February 28, 2012

[Draft]Installing Redmine 1.3.1 on Perfect Server Debian 6 (Squeeze) ISPConfig 3

The following is my notes on installing Redmine on Perfect Server Debian 6 with ISPConfig3. If you are ISPConfig3 users and would like to install Redmine, this walk-though maybe helpful. This guide assume you have ISPConfig 3 setup already. ISPConfig is a hosting control panel, you can use it to setup web, email, MySQL database with ease. If you don't know what is ISPConfig, please find the following link: After installed your perfect server and ISPConfig, go ahead to create a client, then a website and database for the new client. Next, download Redmine, extract the archive to /var/lib/redmine, then follow the procedures below. ==Installing Ruby==
apt-get install libapache2-mod-passenger librmagick-ruby1.8 libmysql-ruby rake
The following packages will be installed: Setting up ruby1.8 (1.8.7.302-2squeeze1) ...
Setting up ruby (4.5) ...
Setting up rubygems1.8 (1.3.7-3) ...
Setting up rubygems (1.3.7-3) ...
Setting up librack-ruby1.8 (1.1.0-4) ...
Setting up libjs-jquery (1.4.2-2) ...
Setting up librack-ruby (1.1.0-4) ...
Setting up libjs-prototype (1.6.1-1) ...
Setting up libapache2-mod-passenger (2.2.11debian-2) ...
Setting up librmagick-ruby1.8 (2.13.1-2) ...
Setting up ruby1.8-dev (1.8.7.302-2squeeze1) ...
Setting up libmysql-ruby1.8 (2.8.2-1) ...
Setting up libmysql-ruby (2.8.2-1) ...
Setting up rake (0.8.7-2) ...
==Installing Rails== !!!don't install 3.2.1, it won't work!!!
gem install rails -v=2.3.14
==Setup MySQL== Use ISPConfig to setup a new database **Configure Redmine database** !!!ensure configure are UNIX file format!!!
echo "production: adapter: mysql database: host: localhost username: password: encoding: utf8 schema_search_path: public" > config/database.yml RAILS_ENV=production rake config/initializers/session_store.rb rake generate_session_store RAILS_ENV=production rake db:migrate RAILS_ENV=production rake redmine:load_default_data
==Configure SMTP server== !!!ensure configuration files are UNIX file format!!!
cd /var/lib/redmine/config cp configuration.yml.example configuration.yml vi configuration.yml
!!!If you got 501 error, use the default and changed the delivery_method to sendmail
# default configuration options for all environments default: # Outgoing emails configuration (see examples above) email_delivery: delivery_method: :sendmail smtp_settings: address: !!!Ensure database.yml and configuration.yml permission!!!
chown www-data:www-data database.yml configuration.yml
==Configure Apache2== clientX and webY is created by ISPConfig for client
ln -s /var/lib/redmine/public /var/www/clients/clientX/webY/redmine
In ISPConfig, insert this line in Website -> Options -> Apache Directives
RailsBaseURI /redmine
==Configure LDAP== In Redmine Administration Panel -> LDAP authentication Port: 389 Account: Password: Base DN: CN=Users,DC= On-the-fly user creation: checked Attributes (for Active Directory) Login: sAMAccountName First name: givenName Lastname: sn Email: mail ==Other settings== !!!If Redmine tab Information -> Plugin assets directory writable has error, change the permission for the following directory
chown -R www-data:www-data /var/lib/redmine/public/plugin_assets
Reference http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Debian_Squeeze_with_Postgresql_Ruby-on-Rails_and_Apache2-Passenger http://www.he1ix.org/2010/08/installing-redmine-on-debianlenny-using-mod_passenger/ http://blog.philippklaus.de/2011/05/redmine-on-debian-squeeze/

Friday, January 27, 2012

Configure firewall on Ubuntu 10.04

Just learned a command line tool ufw for configure the firewall. It seems easy to use, but the server guide didn't teach how to setup rule on specific interface.

Lucky I found the solution, to configure ufw for specific interface, use the following syntax:

sudo ufw allow in on eth0
sudo ufw deny out on eth0
sudo ufw deny in on eth0 to any from any port 80 proto tcp

Reference: Link

Installing Ubuntu 10.04 server

I decide to setup my own LAMP environment to host my game portal. I decided to try Ubuntu, although I never have experence with it.

Fortunately, Ubuntu has large user base, it is very easy to find solutions.

After installed Ubuntu Server 10.04, I found only cli available. I prefer to have a GUI environment to get start. It is very easy to install Gnome desktop to a brand new Ubuntu server.

To add gnome desktop, simply run the following instructions.

sudo apt-get install gnome-core gdm indicator-applet-session
sudo apt-get install update-notifier
sudo apt-get install gtk2-engines
sudo apt-get install gnome-themes
sudo apt-get install gnome-network-admin

Because I run Ubuntu inside VirtualBox, I need to install the VirtualBox add-on for better performance.

Installing VirtualBox add-on require linux header and build-essential package:

sudo apt-get install build-essential linux-headers-`uname -r`
cd /media/VBOXADDITIONS_4.1.8_75467/
sudo ./VBoxLinuxAdditions.run

That's all. Next step is setup apache and mysql.