Skip to content

Instantly share code, notes, and snippets.

View coderfi's full-sized avatar

Fairiz 'Fi' Azizi coderfi

View GitHub Profile
@phuongnd08
phuongnd08 / install_docker.sh
Last active August 29, 2015 14:08
Install docker 1.3.0 on CentOS
#!/bin/bash
if ! which wget > /dev/null; then
yum install -y wget
fi
export DOCKER_VERSION=1.3.0
pushd /tmp
if [ ! -f /usr/bin/docker ]; then
Instructions for trying ext4+overlay with docker! In an up-to-date SDK:
Write the following to /build/amd64-usr/etc/portage/package.keywords/overlay
sys-kernel/coreos-sources
sys-kernel/coreos-kernel
sys-fs/btrfs-progs
app-emulation/docker
In src/scripts make the following change to switch to ext4:
@schmmd
schmmd / mvn2sbt.scala
Last active December 14, 2015 07:29
Create an sbt file from a pom file.
import scala.xml._
val scalaVersion = args.headOption
def quote(s: String) = "\"" + s + "\""
val xml = XML.loadString(scala.io.Source.stdin.getLines.mkString("\n"))
val name = (xml \ "artifactId").text
@coderfi
coderfi / ipyD3.py
Last active December 21, 2015 06:39 — forked from z-m-k/LICENSE
Updated for use with iPython 1.0.0 notebook (use the IPython.display.HTML method). Added phantomExec arg to d3object function (defaults to 'phantomjs'... so keep it in your path)
from __future__ import division
import numpy
from uuid import uuid1
class d3object:
def __init__(self,
height=100,
width=100,
topHtml='',
bottomHtml='',
style=None,
@ilguzin
ilguzin / nginx_storage_spray.conf
Last active June 6, 2016 13:33
spray + nginx: serve static with storage API endpoint
server {
listen 443 ssl;
server_name hostname;
ssl on;
ssl_certificate /etc/nginx/ssl_certs/hostname.bndl.crt;
ssl_certificate_key /etc/nginx/ssl_certs/hostname.key;
ssl_session_timeout 5m;
@tsutsu
tsutsu / HOWTO-CoreOS-on-DO.md
Last active September 25, 2016 09:14
CoreOS on DigitalOcean (using "Debian 7 x64" as a base)
  1. run sudo apt-get install squashfs-tools kexec-tools
  2. copy "update.sh" to /usr/sbin/update-coreos, and make it executable
  3. copy "create-docker-store.sh" to /usr/sbin/create-coreos-docker-store, and make it executable
  4. copy "cloud-config.yml" to /etc/default/coreos, modifying it to suit your preferences
  5. run sudo update-coreos -d
  6. reboot
@mattes
mattes / cloud-config.yaml
Last active November 2, 2016 16:37
CoreOS on Google Compute Engine: push systemd journal logs to logentries.com https://medium.com/coreos-linux-for-massive-server-deployments/defb984185c5
#cloud-config
write_files:
- path: /home/core/journal2logentries.sh
permissions: '0744'
owner: root:root
content: |
#!/usr/bin/env bash
# CoreOS on Google Compute Engine: push systemd journal logs to logentries.com
# get your private token from logentries.com, see https://logentries.com/doc/input-token
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
@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:
@porjo
porjo / user_data.yaml
Created July 1, 2014 04:52
CoreOS cloud-config
#cloud-config
hostname: coreos-01
coreos:
etcd:
#discovery: https://discovery.etcd.io/xxxxxxxxxxxxxxxx
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units: