2015年11月24日 星期二

ufw是Ubuntu專用的防火牆套件(推薦)

$sudo apt-get install ufw
$ufw enable
$ufw status

$ufw allow 3000   --開3000 port
$ufw status

$ufw allow 80   --開80 port
$ufw status

$ufw -v  可以看到所有指令

FATAL: role "root" does not exist

$sudo -u postgres createuser root



How to set postgres password in the beginning?

$sudo -u postgres psql -d template1 -c "ALTER USER postgres WITH PASSWORD 'your new password';"




bundle install meet 'pg' issue for digitalocean

$rails new demo -d postgresql
$bundle install
An error occurred while installing pg (0.18.4), and Bundler
cannot continue.
Make sure that gem install pg -v '0.18.4' succeeds before
bundling.

Answer:
sudo apt-get install libpq-dev

2015年11月16日 星期一

How to install PostgresSQL in Ubuntu?


$sudo apt-get update
$sudo apt-get install postgresql-9.3

$sudo -i -u postgres
$psql
$\q




https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-14-04
http://askubuntu.com/questions/50621/cannot-connect-to-postgresql-on-port-5432

2015年11月11日 星期三

Git Install and Use it

$sudo apt-get install git-core

$sudo mkdir /var/git

$cd /var/git
$sudo mkdir new_project.git

$cd new_project.git

$sudo git --bare init

$sudo git config core.sharedRepository true

Add Git Group
=======================
$sudo chgrp -R gitgroup *
$sudo adduser willy gitgroup
=======================


======================
$sudo chmod -R g+ws *
======================

$sudo chmod -R 777 .

ls -al

How to install Git User Interface in Ubuntu?

Install Git GUI
$sudo apt-get install git-gui

Run Git GUI
$git gui &