2010年1月31日 星期日

setup ubuntu environment

* setup ubuntu environment
1. ssh :
#sudo apt-get install openssh-server
check ssh server
#ps aux | grep ssh
stop and start ssh daemon
#sudo /etc/init.d/ssh stop #sudo /etc/init.d/ssh start

2. Install vim
#sudo apt-get install vim
Then, edit ~/.bashrc
added
alias ll='ls -l'
alias vi='vim'

3. tftp server:
#sudo apt-get install xinetd tftp-hpa tftpd-hp

安裝TFTP server
修改設定檔/etc/default/tftpd-hpa
RUN_DAEMON="yes"
OPTIONS="-l -c -s /tftpboot"
也修改/etc/inetd.conf
tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -c -s /tftpboot
參數:
-c 讓client可以修改server內的檔案
-s 指定server的資料夾

重新啟動ttftp server
#sudo /etc/init.d/tftpd-hpa restart

安裝client
#sudo apt-get install tftp

4. Install nfs server
$sudo apt-get install nfs-common nfs-kernel-server
$ sudo vi /etc/exports
/work/MVP 192.168.*.*(rw,no_root_squash,nohide,insecure,no_subtree_check,async)

啟動nfs
$/etc/init.d/nfs-kernel-server restart

檢查
$showmount -e

掛載
$mount -t nfs 192.168.xxx.xxx:/work /mnt/nfs


5.Edit screen setting at ~/.screenrc

6.Install samba
#sudo apt-get install samba

Edit vi /etc/samba/smb.conf
Add:
[SHARE] path = /work browseable = yes read only = no create mask = 0644 directory mask = 0755
-------------------------------------------------
Added User
#sudo smbpasswd -a username
Restart samba server
#sudo /etc/init.d/samba restart







2010年1月14日 星期四

How to create vlc server

Case 1: vod (video on demand)
#vlc -I http --http-src /folder --http-host IP:PORT

Case 2: Broadcast
VLC play
工具 -> VLM configuration -->

@Test VLC streaming server
#mplayer rtp://192.168.1.255:1234/ -fps 23.976 -nosound

2010年1月13日 星期三

Install VLC on ubuntu 9.10

You need to check that a "multiverse" mirror is listed in your /etc/apt/sources.list.

% sudo apt-get update
% sudo apt-get install vlc vlc-plugin-pulse mozilla-plugin-vlc






2010年1月7日 星期四

how to create remote git repository

//for remote repository
step1: create public directory for remote access repository
#mkdir /git/pub

step2: #cd /git/pub
#git clone --bare proj
Then, you will get proj.git. It is no working tree

step3: Edit /et/cgitrc

# List of repositories
repo.group=gittest
repo.url=test
repo.path=/apps/git/pub/proj.git
repo.desc= projgit
repo.owner= winnie

step4: cd /git/pub/proj.git
#touch git-daemon-export-ok

step5: Enable git-daemon and can freely git clone
#/usr/lib/git-core/git-daemon --enable=receive-pack&
==========================
//for local repository
step6: create local project
#mkdir /git/local/proj
#cd /git/local/proj
#git init

==========================
//updated (pull) local repostory from remote repository
# git fetch ../pub/proj.git
# git merge FETCH_HEAD

// Push local file to remote repository
#git push ../pub/proj.git/ master:master

//Create new branch and push it to remote repository
#git checkout -b new-branch
Then, push it to remote repository

#git push ../pub/proj.git/ new-branch:new-branch

2010年1月4日 星期一

Git : How to config git environment

First time installing git, you need to configure git environment into ~/.gitconfig

# git config --global user.name "NAME"
# git config --global user.email NAME@example.com
# git config --global core.editor vi

http://progit.org/book/ch7-1.html


example: .gitconfig

vi .gitconfig

[color]

        ui = auto
branch = auto

[alias]

        co = checkout
ci = commit -a
st = status
br = branch
w = whatchanged

[user]

        name = foo
email = foo@gmail.com

[apply]

        whitespace = strip

[diff]

        color = auto
rename = copy