rails new blog -d postgresql
Nov 19, 2012
Aug 7, 2012
The performance of SAMSUNG 830 Series 2.5-Inch 256GB on Mountain Lion
Here is the result from Xbench:
Results 565.10
System Info
Xbench Version 1.3
System Version 10.8 (12A269)
Physical RAM 8192 MB
Model MacBookPro8,2
Drive Type SAMSUNG SSD 830 Series
Disk Test 565.10
Sequential 374.59
Uncached Write 593.36 364.31 MB/sec [4K blocks]
Uncached Write 598.18 338.45 MB/sec [256K blocks]
Uncached Read 164.58 48.17 MB/sec [4K blocks]
Uncached Read 803.01 403.59 MB/sec [256K blocks]
Random 1149.93
Uncached Write 847.69 89.74 MB/sec [4K blocks]
Uncached Write 967.11 309.61 MB/sec [256K blocks]
Uncached Read 2547.83 18.05 MB/sec [4K blocks]
Uncached Read 1146.40 212.72 MB/sec [256K blocks]
After trim enabler:
Results 563.27
System Info
Xbench Version 1.3
System Version 10.8 (12A269)
Physical RAM 8192 MB
Model MacBookPro8,2
Drive Type SAMSUNG SSD 830 Series
Disk Test 563.27
Sequential 373.48
Uncached Write 583.23 358.09 MB/sec [4K blocks]
Uncached Write 596.24 337.35 MB/sec [256K blocks]
Uncached Read 164.58 48.17 MB/sec [4K blocks]
Uncached Read 804.85 404.51 MB/sec [256K blocks]
Random 1145.28
Uncached Write 1268.14 134.25 MB/sec [4K blocks]
Uncached Write 705.85 225.97 MB/sec [256K blocks]
Uncached Read 2562.21 18.16 MB/sec [4K blocks]
Uncached Read 1114.80 206.86 MB/sec [256K blocks]
Almost the same, as expected.
Posted by Lono at 21:02 0 comments
Apr 25, 2012
HOWTO: use pathogen to manage vim plugins
I am now using pathogen and GitHub to manage my vim plugins.
They are not difficult to use, but you need a few git commands to set it up, which I found very annoying.
To init .vim folder in Linux (or vimfiles for Windows), type:
mkdir .vim
cd .vim
git init
wget https://raw.github.com/tpope/vim-pathogen/HEAD/autoload/pathogen.vim -P ~/.vim/autoload
git add .
git commit -m 'initial commit'
To install each vim plugin, type: (here I use neocomplcache-snippets-complete as an example)
git submodule add https://github.com/Shougo/neocomplcache-snippets-complete.git bundle/neocomplacahe-snippets-complete
git add .gitmodules bundle/neocomplcache-snippets-complete
git submodule init
Posted by Lono at 10:45 0 comments
Labels: VIM
Apr 16, 2012
iOS errors
Posted by Lono at 06:44 0 comments
Apr 13, 2012
How To: Install TouchXML for ios
1. download TouchXML from github
2. add the sources to your project
3. In project->build settings->header search paths:
add /usr/include/libxml2
4. In project->targets->build phases->link library with binaries:
add "libxml2.2.7.3.dylib"
Posted by Lono at 07:10 0 comments
Mar 30, 2012
How To: Install lxml on Ubuntu
sudo apt-get install libxml2-dev
sudo apt-get install libxslt1-dev
sudo apt-get install python2.6-dev
easy_install --allow-hosts=lxml.de,*.python.org lxml
Posted by Lono at 13:27 0 comments
List of commands for MySql and Django
mysqladmin.exe -u root -p create myapp
python manage.py syncdb
mysql -u root -p
sudo /etc/init.d/apache2 restart
Posted by Lono at 11:36 0 comments
Mar 18, 2012
OpenSSH configuration file
Putty is a lovely ssh program, but I love console2 even more.
To use ssh to connect to Amazon EC2 server, you need cygwin to run openssh in Windows environment.
The command is (under cygwin):
ssh -i MySite.pem ubuntu@xxx.amazonaws.com
To make the command shorter, create "~/.ssh/config"
and add:
Host MySite
User ubuntu
Port 22
IdentityFile ~/.ssh/MySite.pem
HostName xxx.amazonaws.com
To connect, just type:
ssh MySite
Posted by Lono at 17:10 0 comments
Mar 16, 2012
Setting selective sync of Dropbox on Amazon EC2 server
Dropbox provides an easy to backup the server. However, the default setting synchronizes all of the files to the server, which is very annoying.
I don't want all of my personal stuff to be stored in a public server.
In order to select the file which you would like to sync, download dropbox.py
and type the following commands in the terminal:
python dropbox.py exclude add ~/Dropbox/*
python dropbox.py exclude remove ~/Dropbox/<folder-to-sync>
The first command excludes all of files from your dropbox.
The second one adds the folder which is going to be synchronized.
Posted by Lono at 05:33 0 comments
Mar 7, 2012
Setting up Django on ubuntu
- sudo apt-get update
- sudo apt-get install apache2
- wget http://www.djangoproject.com/download/1.3/tarball/
- mv index.html Django-1.3.tar.gz
- tar xzvf Django-1.3.tar.gz
- cd Django-1.3
- sudo python setup.py install
- sudo apt-get install libapache2-mod-wsgi
- create "/home/ubuntu/mysite/django-server.wsgi"
- sudo /etc/init.d/apache2 start
- cd /etc/apache2/sites-available
- sudo cp default mysite
- edit "mysite"
- a2ensite mysite
- sudo /etc/init.d/apache2 reload
- sudo /etc/init.d/apache2 restart
- cd ~
- django-admin startproject mysite
- cd ~/mysite
- django-admin startapp myapp
- python manage.py runserver 0.0.0.0:8000
import os, sys
sys.path.append('/home/ubuntu/')
sys.path.append('/home/ubuntu/mysite')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Listen 8000
<VirtualHost *:8000>
WSGIScriptAlias / /home/ubuntu/mysite/django-server.wsgi
WSGIDaemonProcess server1piece user=www-data group=www-data processes=1 threads=10
ServerAdmin webmaster@localhost
DocumentRoot /home/ubuntu/
Alias /static/admin/ /home/ubuntu/Django-1.3/django/contrib/admin/media/
Posted by Lono at 03:01 0 comments
Labels: Django