This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, getopt | |
import tensorflow as tf | |
usage_str = 'python tensorflow_rename_variables.py --checkpoint_dir=path/to/dir/ ' \ | |
'--replace_from=substr --replace_to=substr --add_prefix=abc --dry_run' | |
def rename(checkpoint_dir, replace_from, replace_to, add_prefix, dry_run): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# install latest version of shadowsocks via pip | |
/usr/bin/python3.5 -m pip install --upgrade git+https://github.com/shadowsocks/shadowsocks.git@master | |
# install libsodium to support aes-256-gcm | |
add-apt-repository ppa:chris-lea/libsodium | |
echo "deb http://ppa.launchpad.net/chris-lea/libsodium/ubuntu xenial main" >> /etc/apt/sources.list | |
echo "deb-src http://ppa.launchpad.net/chris-lea/libsodium/ubuntu xenial main" >> /etc/apt/sources.list | |
apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR.sh | |
chmod +x shadowsocksR.sh | |
sudo ./shadowsocksR.sh 2>&1 | tee shadowsocksR.log | |
# use none | |
# use auth_chain_b | |
# use tls1.2_ticket_auth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
pip install https://github.com/shadowsocks/shadowsocks/archive/master.zip -U | |
sudo apt-get install -y libsodium* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use runtime data | |
head -c 32 /dev/urandom | base64 | |
head /dev/urandom | md5sum | head -c 32 | |
# use date | |
date +%s%N | md5sum | head -c 32 | |
# use openssl function | |
openssl rand -hex 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install dependencies | |
brew install libusb cmake pkg-config | |
git clone https://github.com/IntelRealSense/librealsense.git | |
cd librealsense | |
mkdir build | |
cd build | |
# cmake with python bindings | |
cmake -DBUILD_PYTHON_BINDINGS=bool:true .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
LENGTH=32 | |
# use openssl | |
openssl rand ${LENGTH} -base64 | |
# use gpg | |
gpg --gen-random --armor 1 ${LENGTH} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# create mysql container | |
MYSQL_USER="admin" | |
MYSQL_PASSWORD="passwd" | |
CONTAINER_NAME="mysql_container" | |
docker run -d -t \ | |
--name ${CONTAINER_NAME} \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"max-concurrent-downloads": 10, | |
"max-concurrent-uploads": 20, | |
"registry-mirrors": [ | |
"https://registry.docker-cn.com" | |
], | |
"default-shm-size": "64M" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remap prefix key from 'C-b' to 'C-a' | |
unbind C-b | |
set-option -g prefix C-a | |
bind-key C-a send-prefix | |
# increase history limit | |
set-option -g history-limit 30000 | |
# close auto rename | |
set -wg allow-rename off |
OlderNewer