Skip to content

Instantly share code, notes, and snippets.

@xiangjjj
xiangjjj / generate_rsa_keys
Created March 16, 2017 13:44
Generate public and private key pairs
$ ssh-keygen -t rsa # use git as key name
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/xjiang/.ssh/id_rsa): git
Enter passphrase (empty for no passphrase):
Enter same passphrase again: ...
# put public key in authorized_keys at the server
# ~/.ssh/authorized_keys lists the public keys (RSA/DSA) that
# can be used for logging in as this user.
cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys
# copy private key to local machine
scp git@domain:~/path/to/privatekey/git_rsa ~/.ssh/
# setup ssh config file to simplify future connection
vim ~/.ssh/config
# enter the following commands
# this will setup all configurations to connect to the git server
Host private_git_host
HostName yourdomain.com
# A bare repo is required everytime a new repo is created.
# It serves as the origin repo for remote users and is only updated by pushing to it.
cd ~
mkdir test_repo
cd test_repo
git init --bare
# create local repo
mkdir test_repo
# add remote repo
# now you can see how private_git_host simplifies our life
git remote add origin private_git_host:test_repo.git
# we can push, pull, etc.
git touch test_file
git commit -m "test commit"
# create local repo
mkdir test_repo
# add remote repo
# now you can see how private_git_host simplifies our life
git remote add origin private_git_host:test_repo.git
# we can push, pull, etc.
git touch test_file
git commit -m "test commit"
# create local repo
mkdir test_repo
# add remote repo
# now you can see how private_git_host simplifies our life
git remote add origin private_git_host:test_repo.git
# we can push, pull, etc.
git touch test_file
git commit -m "test commit"
# create local repo
mkdir test_repo
# add remote repo
# now you can see how private_git_host simplifies our life
git remote add origin private_git_host:test_repo.git
# we can push, pull, etc.
git touch test_file
git commit -m "test commit"
$sudo chsh git -s $(which git-shell)
@xiangjjj
xiangjjj / compile_tensorflow
Created March 16, 2017 19:20
Build Bazel from Source
# start from home directory
cd $HOME
# get Bazel dist from https://github.com/bazelbuild/bazel/releases
$ wget https://github.com/bazelbuild/bazel/releases/download/0.4.5/bazel-0.4.5-dist.zip
# unzip Bazel
unzip bazel-0.4.5-dist.zip -d bazel
# compile Bazel