Repo 로 이루어진 project 중 하나의 git project 만 clone 을 받아(새로 생성 및 전체 project 가 필요없는 경우) 소스를 수정하고 repository 로 push 할 때, gerrit 을 이용하도록 하는 command 를 소개(?) 한다.


Git Clone

$ git clone ssh://username@hostname:29418/Repository_name.git


Modifiy

$ vi source.cpp


Git push

$ git push ssh://username@hostname:29418/projectname.git HEAD:refs/for/branchname


위와 같이 하면 gerrit review 에 commit 이 "open" 상태로 보이게 된다. 


일반적으로 git push <remote> <branch> 하면 gerrit review 없이 바로 submit 되기 때문에 review 를 받지 않게 되는데 위와 같이 진행하면 repo upload 하는 효과를 볼 수 있다.


git push 할 때마다 저렇게 길게 입력 하는 것보다 .git/config 를 수정하여 간편하게 할 수 있다.


$ cd <git repository>

$ vi .git/config

에 아래와 같이 추가

[remote "for-review"]

fetch = +refs/heads/*;refs/remotes/origin/*

url = ssh://hostname:29418/repository_name.git

push = HEAD:/refs/for/branch_name


fetch = 에 origin은 remote name 임(git branch -a 로 확인)


위와 같이 수정하고 push 할 때는

$ git push for-review

하면 됨.


reference : https://git.eclipse.org/r/Documentation/user-upload.html


'Development Tip' 카테고리의 다른 글

Tips on Linux  (0) 2013.03.11
Tips for VIM  (0) 2013.02.21
Autoloading Cscope Database(cscope.out file)  (0) 2013.02.06
Google Site Tool : File repository  (0) 2012.10.29
Ubuntu Console mode booting  (1) 2012.08.31

Origin url : http://vim.wikia.com/wiki/Autoloading_Cscope_Database


$ cscope -i <cscope files> 한 output database file 을 ~/.vimrc 에서

if filereadable("cscope.out") cs add cscope.out

endif


방식으로 추가하면 cscope.out 이 있는 directory 에서 vi /path/to/source/file 의 형식으로 open 해야 database file이 loading 된다.


대형 프로젝트에서 directory를 이동하며 source를 보는데, source trace 를 위해 project 최상위 directory(cscope.out file 이 위치하는)로 이동하는 번거러움을 없애기 위해 ~/.vimrc 에 script 를 찾아냈다.


~/.vimrc 에 위의 내용을 복사해서 붙이면 어느 path 에서나 cscope.out 을 찾아 loading 한다.


'Development Tip' 카테고리의 다른 글

Tips for VIM  (0) 2013.02.21
Use gerrit with git push command.  (0) 2013.02.20
Google Site Tool : File repository  (0) 2012.10.29
Ubuntu Console mode booting  (1) 2012.08.31
switch remote/branch by repo  (0) 2012.08.30

1. Google 에 가입하기

  - www.google.com 에서 "Google 가입하기" 하면 최상위 검색 결과를 보면 된다.

  - 검색하기 귀찮으신 분들을 위해 검색까지 해주겠슴

    http://bit.ly/TPoXrn <== "Google 가입하기" 검색


2. Google Site 시작 page

  - http://www.google.com/sites/help/intl/ko/overview.html


  - 아래 시작하기를 누르면 Site 를 만들수 있는 menu가 나온다.


3. Site 만들기.


4. Site 설정



- 템플릿을 Classroom site 로 설정했다.


5. File repository page 만들기



- 페이지 설정 



  - 완성



 위에서 처럼 파일 추가가 가능한 page 가 생성된다. 


문제는 이 page 가 어디에 들어갔는지 알수가 없다는 것이다.. 음.. 페이지 설정 시 "Home 아래에 페이지 배치" 를 통해 menu 에서 볼수 있도록 하는 것이 좋겠다. 


나는 추가관리 ==> 사이트 관리 ==> 최근 사이트 활동 의 항목을 통해 다시 찾음. 


오래전에 한번 써보고 이런 기능이 있는지 모르고 그만 뒀다가 file repository로 사용하기 위해 다시 찾아서 사용법이 기억이 나질 않는다. 



'Development Tip' 카테고리의 다른 글

Use gerrit with git push command.  (0) 2013.02.20
Autoloading Cscope Database(cscope.out file)  (0) 2013.02.06
Ubuntu Console mode booting  (1) 2012.08.31
switch remote/branch by repo  (0) 2012.08.30
redmine tip  (0) 2012.03.26

Ubuntu Console Mode booting


Vmware 에 ubuntu 설치해서 build 나 code 작성 등 GUI 가 굳이 필요없는 환경이 필요할 경우가 있다.

현재 사용하고 있는 랩탑이 64bit architecture 인데 32bit Ubuntu 를 쓰고 있어서(설치할 당시에 별로 신경안쓰고 설치를 했더니...), chrome os build 를 위한  환경이 필요했다.

참고로 chrome os 는 64bit architecture 에서만 빌드 지원되면 32bit 에서 빌드하려면 시간과 노력이 든다.(시도했지만 실패했다 ^^) 


architecture 가 64bit 이지만 32bit OS 가 설치 되어 있더라도 vmware로 64bit OS가 설치 가능하다.


그래서 vmware 에 64bit Ubuntu 를 설치하고 light 하게 운영하기 위해 GUI 를 제거 할 수 있도록 환경을 구성하고 자 찾아본것이다. 


1. update 

  $ sudo apt-get update 


2. install lightdm, ubuntu 12.04 에는 이미 설치가 되어 있음.

  $ sudo apt-get install lightdm 



3. /etc/default/grub 수정

  $ sudo vi /etc/default/grub

a. GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" line을

       GRUB_CMDLINE_LINUX_DEFAULT="text" 로 수정

b. GRUB_HIDDEN_TIMEOUT=0 주석처리

4. grub update

$ sudo update-grub


5. lightdm disable : 사실 이작업을 하는 이유를 모르겠음. 설치했다가 지우는 작업이므로.

$ sudo update-rc.d -f lightdm remove


6. restart ubuntu

console mode 로 진입함


만약, 그 상태에서 gui 로 진입하고 싶다면

$ startx


console mode 로 부팅 후에, ssh 만 설치해서 사용하는 중이다.


Reference : http://www.techienote.com/2012/01/disable-gui-boot-in-ubuntu-11-10.html

'Development Tip' 카테고리의 다른 글

Autoloading Cscope Database(cscope.out file)  (0) 2013.02.06
Google Site Tool : File repository  (0) 2012.10.29
switch remote/branch by repo  (0) 2012.08.30
redmine tip  (0) 2012.03.26
Cscope, Ctags 를 원하는 file만.  (0) 2012.02.23

repo 를 이용해서 remote branch 를 변경하는 방법


1. repo init 을 새로 해주어야 한다

  $ repo init -b <remote branch>


2. 모든 project 에 local branch 생성

  $ repo start <new local branch name> --all


3. sync 

   $ repo sync -j<thread>


'Development Tip' 카테고리의 다른 글

Google Site Tool : File repository  (0) 2012.10.29
Ubuntu Console mode booting  (1) 2012.08.31
redmine tip  (0) 2012.03.26
Cscope, Ctags 를 원하는 file만.  (0) 2012.02.23
Ubuntu 11.10 application : Terminator  (0) 2012.02.20
1. redmine installation

2. admin 계정 password 초기화
RAILS_ENV=production script/runner 'user = User.find(:first, :conditions => {:admin => true}) ; user.password, user.password_confirmation = "PASSWORD"; user.save!'

3. plugin uninstall
rake db:migrate:plugin RAILS_ENV=production NAME=<plugin name> VERSION=0
ruby script/plugin remove <plugin name>

4. reference site

gitolite install & setting

조금 더 써봐야 알겠지만, UI 도 이쁘고 간편하니 잘쓰면 좋을 듯.
http://www.redmine.org/ 이 사이트를 가서 살펴 본 후 마음에 들어 설치!

Ubuntu 11.10 에 설치 완료! git 은 연동하려다 실패.. 다 roll back 하고 그냥 있는 그대로 쓰련다 굳이 필요없을 듯. ㅋ 



'Development Tip' 카테고리의 다른 글

Ubuntu Console mode booting  (1) 2012.08.31
switch remote/branch by repo  (0) 2012.08.30
Cscope, Ctags 를 원하는 file만.  (0) 2012.02.23
Ubuntu 11.10 application : Terminator  (0) 2012.02.20
Android git mirror site  (0) 2011.09.30

대형 project일 경우, 모두 다 보는 것도 아니고 원하는 file만 등록하여 tagging 을 하는 것이 더 좋을 수도 있다. (ctags와 cscope을 하는데 시간도 많이 걸리고..)

원하는 file을 cscope.files 로 만든 다음, 
$ find <path> <type or name> -print > cscope.files
$ ctags -L cscope.files
$ cscope -I cscope.files

example)
$ find ./abc -name "*.[chS]" -print > cscope.files
$ find ./cdb -name "*.[chS]" -print >> cscope.files #추가할 경우
$ ctags -L cscope.files
$ cscope -I cscope.files

위와 같이 하면, 원하는 file만 등록하여 trace 할 수 있다. 



'Development Tip' 카테고리의 다른 글

switch remote/branch by repo  (0) 2012.08.30
redmine tip  (0) 2012.03.26
Ubuntu 11.10 application : Terminator  (0) 2012.02.20
Android git mirror site  (0) 2011.09.30
Per-process Namespace  (0) 2011.03.16
Ubuntu 11.10 을 main 으로 설치하고 나서 이것 저것 설치를 해보는 중에 좋은 terminal을 발견했다. 

기존에는 byobu를 이용해 하나의 window에서 여러 shell을 이동하며 작업가능하고, window를 close 하더라도 다음에 byobu를 실행했을 시 그 session을 복구하는 좋은 기능이 있다. 

물론 window를 여러 개 열어 사용하면 될테지만, 지금 소개하는 application은 하나의 window에 terminal을 여러개 배치하여 사용할 수 있는 tool이다. byobu와 혼용하면 더욱 좋을 듯 함. 

console
$ sudo apt-get install terminator

or UI menu 이용. 
Applications ==> Ubuntu Software Center ==> Search ==> terminator


위와 같이 검색 후, 설치하면 완료. 

실행 후 화면


위의 그림을 보면, 원래 기본 창이 하나나오고 그 위에서 마우스 우 클릭을 하면 메뉴가 나오는데 메뉴에서 "Split Horizontally" 나 "Split Vertically" 를 누르면 창을 나눈다.  기본적인 window내의 terminal간 이동은 "Alt + 방향키" 로 된다. 

byobu를 함께 사용한 모습(ubuntu 11.10 을 설치하면 byobu는 기본적으로 설치되는 듯)

단축키 관련해서는 "Preferences" 를 누르면 Keybindings tab에서 확인가능함.

여러개의 tab을 운영할 수 도 있다. 

'Development Tip' 카테고리의 다른 글

redmine tip  (0) 2012.03.26
Cscope, Ctags 를 원하는 file만.  (0) 2012.02.23
Android git mirror site  (0) 2011.09.30
Per-process Namespace  (0) 2011.03.16
VMware Server Ver2.0.X : [Solved] VMware tools install fail  (0) 2011.03.16
hacking의 파장(?) 으로 android.git.kernel.org 과 kernel.org 에 접속이 되질 않는다.
mirror site 로 받을 수 있다. 

https://github.com/android
 에서 android source를 checkout 받을 수 있다. 
(platform, kernel 등)

추가로, vanilla kernel 은 
https://github.com/mirrors/linux-2.6 에서 kernel.org 에서 받던 소스를 
받을 수 있다. 
kernel.org 복구가 완료 된듯. !!
1. Process Management : Namespace 내용
   Namespace의 기본 개념을 번역함. 
   Namespace concept (Professional Linux kernel architecture)

2. namespace 실습
  // 검색을 해봤는데, 와닿을 만한 예제를 찾지 못했다. 검색어를 잘못 선정했나.. 
 // unshare() 함수 사용의 예제 임.

 Reference site : http://glandium.org/blog/?p=217

                        http://www.debian-administration.org/articles/628
 

unshare() system call로 새로운 namespace를 만들고 확인해보는 실습이다. 


위의 소스를 살짝 설명을 하자면, 
일단 unshare system call은 root permission이 없으면 수행을 하지 못한다.  현재 실행하고 있는 UID의 값이  root(UID == 0)가 아니면 실행을 중단한다. 
shell 에서 (geteuid 는 effective uid 값을 가져오는 함수임)
$ man 2 geteuid
하면 자세한 정보가 나온다. 

일단 root permission으로 실행되었다면, unshare system call에 CLONE_NEWNS flag와 함께 호출한다. 새로운 namespace를 생성하는 과정임(현재 process에서 fork 하여 생성된 child process인 경우에만 아래의 코드를 실행한다.)
 
코드를 구현하고,
$ gcc -o newns newns.c (위의 소스 파일 이름이 newns.c 이다)

 
위의 terminal의 명령 순서를 설명하면,
나의 경우에 ~/work/namespace/ 하위에 first와 second file을 만들고 각각 first 에는 "FIRST" 문자열을 second 에는 "SECOND" 문자열을 기록 해두었다.

$ sudo ./newns 를 통해 새로운 namespace를 만들고
$ mount -n --bind second first

(참고로, mount 의 --bind 옵션은 심볼릭 링크 파일을 파일로 인식하는 FTP 에서 링크 대신 마운트를 시킴으로써 링크와 비슷한 역할을 할 수 있도록 하는 것이다.)

$ cat first

first 파일의 내용을 보면 "SECOND"라고 나온다. 하지만 또 다른 터미널을 하나 더 연 다음에,
같은 디렉토리로 이동 후 같은 파일의 내용을 보면,

<another terminal>
$ cat first
FIRST
라고 나온다.

Namespace의 간단한 예제 이며, 조금 더 참고하거나 해볼 만한 예제가 있다면 올리도록 할 것이다.  

+ Recent posts