记住密码(15分钟)
git config --global credential.helper cache
长期记住密码
git config --global credential.helper store
记住密码(15分钟)
git config --global credential.helper cache
长期记住密码
git config --global credential.helper store
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.customize ["modifyvm", :id, "--memory", "512"]
end
config.vm.provision "shell", inline: "echo Hello"
config.vm.define "dev", primary: true do |dev|
dev.vm.box = "centos-aliyun-6.5"
dev.vm.network :private_network, ip: "192.168.1.100"
dev.vm.provision "shell", inline: "echo dev"
dev.vm.synced_folder "d:/project", "/var/www"
end
config.vm.define "db1", autostart: false do |db1|
db1.vm.box = "centos-aliyun-6.5"
db1.vm.network :private_network, ip: "192.168.1.101"
db1.vm.provision "shell", inline: "echo db1"
end
config.vm.define "db2", autostart: false do |db2|
db2.vm.box = "centos-aliyun-6.5"
db2.vm.network :private_network, ip: "192.168.1.102"
db2.vm.provision "shell", inline: "echo db2"
end
config.vm.define "db3", autostart: false do |db3|
db3.vm.box = "centos-aliyun-6.5"
db3.vm.network :private_network, ip: "192.168.1.103"
db3.vm.provision "shell", inline: "echo db2"
end
end
git branch 查看本地所有分支 git status 查看当前状态 git commit 提交 git branch -a 查看所有的分支 git branch -r 查看远程所有分支 git commit -am "init" 提交并且加注释 git remote add origin git@192.168.1.119:ndshow git push origin master 将文件给推到服务器上 git remote show origin 显示远程库origin里的资源 git push origin master:develop git push origin master:hb-dev 将本地库与服务器上的库进行关联 git checkout --track origin/dev 切换到远程dev分支 git branch -D master develop 删除本地库develop git checkout -b dev 建立一个新的本地分支dev git merge origin/dev 将分支dev与当前分支进行合并 git checkout dev 切换到本地dev分支 git remote show 查看远程库 git add . git rm 文件名(包括路径) 从git中删除指定文件 git clone git://github.com/schacon/grit.git 从服务器上将代码给拉下来 git config --list 看所有用户 git ls-files 看已经被提交的 git rm [file name] 删除一个文件 git commit -a 提交当前repos的所有的改变 git add [file name] 添加一个文件到git index git commit -v 当你用-v参数的时候可以看commit的差异 git commit -m "This is the message describing the commit" 添加commit信息 git commit -a -a是代表add,把所有的change加到git index里然后再commit git commit -a -v 一般提交命令 git log 看你commit的日志 git diff 查看尚未暂存的更新 git rm a.a 移除文件(从暂存区和工作区中删除) git rm --cached a.a 移除文件(只从暂存区中删除) git commit -m "remove" 移除文件(从Git中删除) git rm -f a.a 强行移除修改后文件(从暂存区和工作区中删除) git diff --cached 或 $ git diff --staged 查看尚未提交的更新 git stash push 将文件给push到一个临时空间中 git stash pop 将文件从临时空间pop下来
aptitude install python-software-properties add-apt-repository ppa:brianmercer/php5-xhprof aptitude update aptitude install php5-xhprof graphviz
其中graphviz包用来生成图形
sudo apt-get install -y python-software-properties sudo add-apt-repository ppa:chris-lea/redis-server sudo apt-get update sudo apt-get install redis-server
可以将url换成其他版本,URL在http://www.oracle.com/technetwork/java/javaee/downloads/index.htm
mkdir -p /opt/java cd /opt/java wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin" chmod u+x jdk-6u45-linux-x64.bin ln -s jdk-6u45-linux-x64 default
wget http://mirrors.cnnic.cn/apache//ant/binaries/apache-ant-1.9.4-bin.tar.gz tar zxf apache-ant-1.9.4-bin.tar.gz ln -s apache-ant-1.9.4 ant
vim /etc/profile.d/sun-jdk.sh
export JAVA_HOME=/opt/java/default export JRE_HOME=$JAVA_HOME/jre export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:. export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:.:$CLASSPATH # ant export ANT_HOME=/opt/java/ant export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:.:$ANT_HOME/bin
生成证书
openssl genrsa -des3 -out xxx.key 1024
openssl req -new -x509 -key xxx.key -out xxx.crt -days 3650
openssl rsa -in openssl.key -out xxx_nopass.key
默认配置
ssl on;
ssl_certificate /etc/nginx/certs/xxx.crt;
ssl_certificate_key /etc/nginx/certs/xxx_nopass.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_prefer_server_ciphers on;
生成证书
cd ~/.ssh/ ssh-kengen -f shining
将证书传送到远程服务器
scp YourName.pub YourName@HostName:YourName.pub
新增一个git用户,不需要密码。
登录到git用户,可以从root用户通过su切换过去。
确认 ~/.ssh/authorized_keys 不存在
将公钥放在 ~/YourName.pub
运行下面的命令:
# 获取版本库 git clone git://github.com/sitaramc/gitolite # 创建bin目录,用于存放安装后的文件 mkdir -p ~/bin # 将gitolite安装到bin目录 gitolite/install -to ~/bin # 使用YourName.pub公钥初始化版本库 gitolite setup -pk YourName.pub
vim ~/.ssh/config
host githost user git hostname HostName port xxx identityfile ~/.ssh/YourName.pub
git clone githost:gitolite-admin.git
conf下是项目及人员配置
keydir下是证书
操作系统是ubuntu12.04,先下载gitlab deb,https://www.gitlab.com/downloads/
参考地址:https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
apt-get install postfix wget https://downloads-packages.s3.amazonaws.com/gitlab_6.7.2-omnibus-1.ubuntu.12.04_amd64.deb sudo dpkg -i gitlab_6.7.2-omnibus-1.ubuntu.12.04_amd64.deb sudo gitlab-ctl reconfigure