Skip to content

Instantly share code, notes, and snippets.

View coderfi's full-sized avatar

Fairiz 'Fi' Azizi coderfi

View GitHub Profile

Minio on GlusterFS Volume Guide

This document provides instructions on how to serve a GlusterFS volume across multiple Minio instances. There are no special configuration changes required to enable this feature. Access to files stored on GlusterFS volume are locked and synchronized by default.

Download Minio

Visit here to download binary for your operating system.

Mount GlusterFS

@hminnovation
hminnovation / zsh-virtualenv-setup.md
Created February 16, 2017 15:08
ZSH Virtualenv and Virtualenvwrapper setup

### Installing global Python & Pip Use Brew brew install python

That'll install both Python, PIP and setuptools. If for some reason it didn't install PIP you can do via

curl https://bootstrap.pypa.io/get-pip.py > get-pip.py
sudo python get-pip.py

c/f MacOSX setup gitbook

import tensorflow as tf
batch_size = 2
get_single_xy_timeout = 10
train_timeout = 3
n_epochs = 5
n_threads = 5
# dummy function simulating loading, preprocessing
# and other operations needed for the X and Y
@thehesiod
thehesiod / async_worker_pool.py
Last active June 30, 2023 11:01
Asynchronous Worker Pool, allows for limiting number of concurrent tasks
import asyncio
from datetime import datetime, timezone
import os
def utc_now():
# utcnow returns a naive datetime, so we have to set the timezone manually <sigh>
return datetime.utcnow().replace(tzinfo=timezone.utc)
class Terminator:
pass
@geyang
geyang / Upgrading HDF5 and h5py to use SWMR with h5 files.md
Last active March 17, 2020 04:34
hdf5 v1.10 upgrade/installation instruction for using single-write-multiple-read (SWMR) in h5py.

The new 1.10 version of hdf5 library is stable. You can now install from the source to use this new capability.

The installation process has a few caveats, so here is how to do it.

Note:

  1. you need to first remove the hdf5 libraries currently installed in ubuntu.
  2. Then you need to reinstall h5py.
  3. when you reinstall h5py via pip, use the --no-binary flag. This is because the h5py wheel comes with its own hdf5 binary.

Instructions:

@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@james-huang
james-huang / global_entry_scrapper.py
Last active March 17, 2017 20:46
global entry appointment schedule monitior
"""
This is a script to help James find a global entry appointment before September because
the whole tsa global entry thing is fucked.
To use:
sudo pip install scrapy
scrapy runspider global_entry_scrapper.py
To set up automated email notifications:
@axic
axic / ecverify.sol
Last active April 13, 2024 09:01
Ethereum ECVerify
//
// The new assembly support in Solidity makes writing helpers easy.
// Many have complained how complex it is to use `ecrecover`, especially in conjunction
// with the `eth_sign` RPC call. Here is a helper, which makes that a matter of a single call.
//
// Sample input parameters:
// (with v=0)
// "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad",
// "0xaca7da997ad177f040240cdccf6905b71ab16b74434388c3a72f34fd25d6439346b2bac274ff29b48b3ea6e2d04c1336eaceafda3c53ab483fc3ff12fac3ebf200",
// "0x0e5cb767cce09a7f3ca594df118aa519be5e2b5a"
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@githubutilities
githubutilities / get-and-build-crfsuite.sh
Last active March 18, 2018 08:45
Get and build crfsuite
#! /usr/bin/env bash
#sudo apt-get install --yes autoconf
WORKING_DIR=`pwd`
LIBLBFGS_GIT=https://github.com/chokkan/liblbfgs.git
LIBLBFGS_SRC_DIR=./liblbfgs/
LIBLBFGS_INSTALL_DIR=$WORKING_DIR/local/lbfgs/
CRFSUITE_GIT=https://github.com/chokkan/crfsuite.git
CRFSUITE_SRC_DIR=./crfsuite/