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
Mar 18, 2012
OpenSSH configuration file
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
Dec 10, 2011
Open source software for Windows Mobile
Just played around my phone, and saw a list of "software disclaimer", that includes:
- Boost
- FreeImage
- Lua
- Luabind
- OpenGL
- STLPort 5.0
- RapidXML
- SWIG
- BString
Posted by Lono at 18:37 0 comments
Labels: Software
Nov 17, 2011
My Google Chrome extensions
Here is the list of my Chrome extensions:
1. Google Mail Checker
2. Google Dictionary
3. Yet Another Google Bookmarks Extension
4. Evernote : Google Notebook is the best online notebook, but Google has stopped to its support. Evernote is an acceptable replacement, but not as easy-to-use as Google Notebook. Evernote is my temporary solution for now.
Posted by Lono at 16:18 0 comments
Labels: Software
Goodbye Firefox!!!
Firefox was a good browser. However, the newer versions of Firefox have very poor compatibility with existing extensions. I am tired of finding new extensions for every new update. New technologies should help us finish our tasks efficiently, instead of giving us more tasks to do.
My #1 candidate for browser is Google Chrome. It is fast, stable and has the replacements for all of my current Firefox extensions. Good job Google!
Posted by Lono at 15:58 3 comments
Labels: Software
Jul 11, 2011
A Sleep function for VIM
I need to let VIM wait for cscope.exe to rebuild the tag file, but there are no build-in sleep function for VIM, so I made one here:
"a sleep function which allows vim to wait for the other processes to finish
com! -complete=command -nargs=+ Sleep call s:Sleep(<q-args>)
fun! s:Sleep(millisec)
  let ct = localtime()
  let dt = 0
  while dt < (a:millisec/1000)
    let dt = localtime() - ct
  endwhile
endfun
Just put it into your _vimrc.
To invoke it, type ":Sleep 10000" to let VIM wait for 10 secs.
Posted by Lono at 23:04 0 comments
Labels: VIM