Skip to content

Instantly share code, notes, and snippets.

user nginx;
worker_processes 1;
events {
worker_connections 1024;
use epoll;
}
http {
include mime.types;
@saitodev
saitodev / start-ssh-agent.bat
Last active December 21, 2015 15:29
This batch file start 'ssh-agent' and set environment variables. Put this file to your startup folder.
C:\cygwin\bin\bash.exe -c "/usr/bin/ssh-agent | /usr/bin/sed -e '/echo/d' | /usr/bin/cut -f 1 -d ';' | /usr/bin/tr '=' ' ' | while read line; do setx.exe $line; done;"
shell /bin/bash
escape ^t^t
startup_message off
vbell off
defkanji utf-8
msgwait 1
defscrollback 10000
autodetach on
@saitodev
saitodev / ssh_config
Created May 3, 2014 09:54
ssh_config
GSSAPIAuthentication no
AddressFamily inet
Compression yes
CompressionLevel 9
ServerAliveInterval 100
ForwardX11 yes
ForwardX11Trusted yes
ForwardAgent yes
@saitodev
saitodev / bashrc_min2
Created May 3, 2014 09:55
bashrc_min2
export PS1="-- \[\033[0;31m\]\u@\h \[\033[1;34m\]\w \[\033[0m\]-- \n> "
alias ls='ls -hF --color=tty'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias less='less -r' # raw control characters
alias grep='grep --color' # show differences in colourx
alias ll='ls -l -A' # long list
alias la='ls -A' # all but . and ..
@saitodev
saitodev / get_authkey.sh
Last active April 24, 2016 07:27
ネットラジオを聴くためのスクリプト。Python製
#!/bin/bash
# -*- coding: utf-8 -*-
PLAYER_URL='http://radiko.jp/player/swf/player_4.1.0.00.swf'
wget $PLAYER_URL -O player.swf
swfextract -b 14 -o authkey.png player.swf
rm -f player.swf
#!/bin/bash
container_id=$1
if [ -z $container_id ]; then
echo "usage: sudo docker-nsenter <container_id> [args ...]"
exit 1
fi
target=`docker inspect --format '{{.State.Pid}}' $container_id`
nsenter --mount --uts --ipc --net --pid --target $target ${@:2}
#!/bin/bash -eu
# -*- coding: utf-8 -*-
HEADER_DIR=/tmp/tensorflow/include
if [ ! -e $HEADER_DIR ];
then
mkdir -p $HEADER_DIR
fi
from __future__ import print_function
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
import tensorflow as tf
def import_graph_def():
with open('trained_graph.pb', 'rb') as f:
graph_def = tf.GraphDef()
from __future__ import print_function
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data/', one_hot=True)
import tensorflow as tf
from tensorflow.python.framework.graph_util import convert_variables_to_constants
def train_and_save():
x = tf.placeholder(tf.float32, [None, 784], name='x')