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
# remgit.sh | |
# Creates a remote git repository from the current local directory | |
# Configuration | |
# Replace SSH_USERNAME, SSH_HOST, SSH_GIT_PATH with your details | |
USER=SSH_USERNAME | |
HOST=SSH_HOST | |
GIT_PATH=SSH_GIT_PATH | |
REPO=${PWD##*/} |
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 TensorFlow (CPU), Keras, and some other tools to a new linux anaconda environment. | |
Open Anaconda Prompt | |
$ conda create --name keras35 python=3.5 | |
$ source activate keras35 | |
(keras35)$ # Your prompt should change | |
(keras35)$ conda install jupyter | |
(keras35)$ conda install scipy | |
(keras35)$ conda install spyder |
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/bash | |
# Script to do sensible home directory backups. Expects to receive the | |
# target user as it's first argument, and then proceeds to do a home | |
# directory backup in a ZFS-aware way. The second arg should be the name | |
# for the backup. hostname is used if it's blank. | |
# The ZFS backup is done by snapshotting every file system underneath the | |
# home directory and then indexing them all with appropriate graft options. | |
# The backup destination is determined by the user-name, and expects to find |
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/bash | |
cd ~/.bup && { | |
git for-each-ref refs/heads/ --shell --format ' | |
echo -n %(refname)... | |
commit=$(echo empty | git commit-tree `git mktree < /dev/null`) | |
for i in `git rev-list --since="2 week ago" --date-order --reverse %(refname)`; do | |
commit=$(git log -1 --pretty=format:%%B $i | GIT_AUTHOR_NAME=`git log -1 --pretty=format:%%an $i` \ | |
GIT_AUTHOR_EMAIL=`git log -1 --pretty=format:%%aE $i` \ |
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
#!/usr/bin/env bash | |
# Strict mode (see: http://redsymbol.net/articles/unofficial-bash-strict-mode/). | |
set -euo pipefail | |
IFS=$'\n\t' | |
# We name the repository directory after the system's hostname and the current | |
# year/month. We include the year/month combo so our backup repository doesn't | |
# continue to grow forever, and we can manually delete old ones as necessary. | |
name="$(hostname)" |
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
# this is an rsync-excludes format list of files to exclude. |
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/bash | |
##################################################################### | |
## IMPORTANT ## | |
# Run this script with root (sudo su -), wont work if run as sudo. | |
# Change the variables as needed. | |
###################################################################### | |
USER=root # User that will have ownership (chown) to /usr/local/bin and /usr/local/lib | |
USERHOME=/${USER} # The path to the users home, in this case /home/youruser | |
PYSHORT=3.5 # The Python short version, e.g. easy_install-${PYSHORT} = easy_install-3.5 | |
PYTHONVER=3.5.2 # The actual version of python that you want to download from python.org |
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
require 'typhoeus' | |
require 'pry' | |
$currencies = { | |
"AUDJPY" => 1175270400, # starting from 2007.03.30 16:00 | |
"AUDNZD" => 1229961600, # starting from 2008.12.22 16:00 | |
"AUDUSD" => 1175270400, # starting from 2007.03.30 16:00 | |
"CADJPY" => 1175270400, # starting from 2007.03.30 16:00 | |
"CHFJPY" => 1175270400, # starting from 2007.03.30 16:00 | |
"EURAUD" => 1175270400, # starting from 2007.03.30 16:00 |