Skip to content

Instantly share code, notes, and snippets.

View abdel's full-sized avatar
💭
ᕕ( ᐛ )ᕗ

abdel

💭
ᕕ( ᐛ )ᕗ
  • Sydney, Australia
View GitHub Profile
@abdel
abdel / time_ago.rb
Last active September 26, 2015 10:38
time_ago
def time_ago(timestamp, from_timestamp = nil)
if timestamp.nil?
return false
end
if from_timestamp.nil?
from_timestamp = Time.now.to_i
end
difference = from_timestamp - timestamp
@abdel
abdel / post-receive
Last active October 19, 2015 21:09
Automatic Git Deployment
#!/bin/bash
# Hook Setup
source $(dirname $0)/hook-setup
while read oldrev newrev ref
do
if [[ $ref =~ .*/master ]];
then
echo "Ref $ref successfully received. Deploying to $PROJECT_DIR..."
@abdel
abdel / hook-setup
Last active October 19, 2015 21:09
#!/bin/bash
if [ $(git rev-parse --is-bare-repository) = true ]
then
REPOSITORY=$(basename "$PWD")
USERNAME=$(basename $(readlink -nf "$PWD"/..))
else
REPOSITORY=$(basename $(readlink -nf "$PWD"/..))
USERNAME=$(basename $(readlink -nf "$PWD"/../..))
fi
@abdel
abdel / jupyter_start.sh
Created November 7, 2017 05:33
A script to start Jupyter in the background
export PATH="$PATH:/home/ubuntu/src/anaconda3/bin"
jupyter notebook --notebook-dir=/home/ubuntu/ --profile=nbserver > /tmp/ipynb.out 2>&1 &
@abdel
abdel / jupyter_stop.sh
Created November 7, 2017 05:34
A script to easily stop a Jupyter background process
pkill jupyter
@abdel
abdel / cuda-setup.sh
Last active November 23, 2018 08:14 — forked from mjdietzx/waya-dl-setup.sh
Install CUDA Toolkit v9.0 and cuDNN v7.1 on Ubuntu 16.04
#!/bin/bash
# Install CUDA Toolkit v9.0
# Instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network))
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
CUDA_REPO_PKG="cuda-repo-ubuntu1604_9.0.176-1_amd64.deb"
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda-9-0