偷懶一下
這次不自己打了
直接附上link
http://www.csua.berkeley.edu/~ranga/notes/ssh_nopass.html
這次不自己打了
直接附上link
http://www.csua.berkeley.edu/~ranga/notes/ssh_nopass.html
git push origin HEAD:refs/for/master如果不想每次都打這麼長或忘記了直接打git push而造成bypass 了 code review階段
git config remote.origin.push refs/heads/*:refs/for/*之後的git push就會先push到code review server了
int a = 1; int &b = a; // it is a lvalue reference, reference to a object
A a;
A&& a_ref = a; // an rvalue reference
A& a_ref2 = A(); // Error
A&& a_ref3 = A(); // OK
Requirement
|
|
---|---|
& (unary) | Operand must be an lvalue. |
++ -- | Operand must be an lvalue. This applies to both prefix and postfix forms. |
= += -= *= %= <<= >>= &= ^= |= | Left operand must be an lvalue. |
Lvalue
|
|
---|---|
x = 42 | x |
*ptr = newvalue | *ptr |
a++ | a |
int& f() | The function call to f() |
$ sudo apt-get install davfs2
$ sudo chmod u+s /sbin/mount.davfs
$ sudo usermod -a -G davfs your-ubuntu-user-account
$ sudo vim /etc/fstab
將下行貼上去 (記得要將your-ubuntu-user-account換成你自己的account name)
https://www.box.com/dav /home/your-ubuntu-user-account/box.com davfs rw,user,noauto 0 0
$ cd ~
$ mkdir box.com
$ mount box.com/
然後就會提示你要輸入你的box user account (full email) 和 password
另外如果不想要每次都輸入帳號密碼, 可以多做以下動作
$ sudo vim /etc/davfs2/secrets
打入這行內容
https://www.box.com/dav box-user-account box-password
這樣做之後就可以設定成auto mount, 也就是將/etc/fstab的內容從noauto 改成 auto
reference: http://dev.modmancer.com/index.php/2011/12/17/access-box-com-box-net-from-your-ubuntu/
ssh -p PORT User@HostName
$ ssh -p 29418 sshusername@hostname **** Welcome to Gerrit Code Review **** Hi John Doe, you have successfully connected over SSH. Unfortunately, interactive shells are disabled. To clone a hosted Git repository, use: git clone ssh://sshusername@hostname:29418/REPOSITORY_NAME.git Connection to hostname closed.
curl http://HostName/ssh_info
HostName PORT
curl http://HostName/DHC/ssh_info
fetch="ssh://HostName:PORT"
review="HostName/DHC" />
remote="yyyy"
sync-j="4" />
...........
..........
Host 名稱
HostName 主機名稱
Port 連接阜
User 帳號
Host gerrit-server
HostName gerrit-server
Port 20002
User hamer.sun
Reference:
http://www.lainme.com/doku.php/blog/2011/01/%E4%BD%BF%E7%94%A8ssh_configReference: |
refs/heads/*
|
Reference: |
refs/meta/config
|
Reference: |
refs/tags/*
|
步驟二:
1. mkdir mirror-folder
2. repo init -u git://github.com/MIPS/manifests.git --mirror
3. repo sync -j4
4. repo forall -c 'ssh -p PORT ACCOUNT@SERVER gerrit create-project PROJECT_ROOT/$REPO_PROJECT; \
ssh -p PORT ACCOUNT@SERVER gerrit set-project-parent --parent mirror-project-permission-base PROJECT_ROOT/$REPO_PROJECT; \
git push ssh://ACCOUNT@SERVER:PORT/PROJECT_ROOT/$REPO_PROJECT 'refs/heads/*' 'refs/tags/*' 'refs/notes/*''
fetch="git://github.com/MIPS"
remote="mips"
sync-j="4"
==>
fetch="ssh://SERVER:PORT/PROJECT_ROOT"
review="SERVER:PORT"
remote="mips"
sync-j="4"
1. repo init -u ssh://ACCOUNT@SERVER:PORT/PROJECT_ROOT/manifests
2. repo sync
$ ssh -p 29418 review.example.com gerrit create-project tools/gerrit.git
$ ssh -p 29418 review.example.com gerrit create-project tool.git --description "'Tools used by build system'"
ssh -vv -p port-number user-account@server-address
... debug1: Authentication succeeded (publickey). ... **** Welcome to Gerrit Code Review **** Hi John Doe, you have successfully connected over SSH. Unfortunately, interactive shells are disabled. To clone a hosted Git repository, use: git clone ssh://user-account@server-address:port-number/REPOSITORY_NAME.git
因此如果你的client端的user account與git server端的不一樣
那正確clone的指令是要在server-address前面加上user-account@
ssh-keygen -t rsa -C "your_email@youremail.com"
Package sun-java6-jdk is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source
E: Package sun-java6-jdk has no installation candidate
更正, 上述方法安裝後的java 6版本無法用來編譯android. 後來又google了一下後cd ~/ wget https://github.com/flexiondotorg/oab-java6/raw/0.2.6/oab-java.sh -O oab-java.sh chmod +x oab-java.sh sudo ./oab-java.sh
# sudo add-apt-repository ppa:webupd8team/java
# sudo apt-get update
# sudo apt-get install oracle-java6-installer
or
安裝jdk7
# sudo add-apt-repository ppa:webupd8team/java
# sudo apt-get update
# sudo apt-get install oracle-java7-installer
dpkg: error processing oracle-java7-installer (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
oracle-java7-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
# sudo rm /var/lib/dpkg/info/oracle-java7-installer*
# sudo apt-get purge oracle-java7-installer*
# sudo rm /etc/apt/sources.list.d/*java*
# sudo apt-get update
colorscheme slate2 # 指定color scheme
set t_Co=256 # 設定用256色來顯示
set tabstop=4 # 設定一個tab 對應4個spaces
set shiftwidth=4 # 設定縮排一次縮排4個spaces
set expandtab # 將tab轉成space
syntax on
alias ls='ls -F --color'
alias h='history 25'
alias vi='vim'
PS1='\[\033[1;33m\]\u\[\033[1;37m\]@\[\033[1;32m\]\h\[\033[1;37m\]:\[\033[1;31m\]\W \[\033[1;36m\]\$ \[\033[0m\]'