Skip to content

Instantly share code, notes, and snippets.

@dalitun
dalitun / ec2_fetchkey
Created July 26, 2016 16:16 — forked from btm/ec2_fetchkey
FreeBSD + Openstack Notes
#!/bin/sh
# PROVIDE: ec2_fetchkey
# REQUIRE: NETWORKING
# BEFORE: LOGIN ec2_firstboot
# Define ec2_fetchkey_enable=YES in /etc/rc.conf and create /root/firstboot
# to enable SSH key fetching when the system next boots.
#
: ${ec2_fetchkey_enable=NO}
@dalitun
dalitun / install.sh
Created January 31, 2017 15:11 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@dalitun
dalitun / 01-02.py
Created February 6, 2017 00:21 — forked from dimi-tree/01-02.py
Udacity: Machine Learning for Trading
# Working with multiple stocks
"""
SPY is used for reference - it's the market
Normalize by the first day's price to plot on "equal footing"
"""
import os
import pandas as pd
import matplotlib.pyplot as plt
#!/bin/bash
# note: this script is invoked automatically by rackspace-flasky.py
# save command line arguments
GMAIL_USERNAME=$1
GMAIL_PASSWORD=$2
# install web server dependencies
apt-get update
apt-get -y install python python-virtualenv nginx supervisor git
@dalitun
dalitun / neutron-port-state-change.py
Created February 22, 2017 10:58 — forked from upa/neutron-port-state-change.py
Change port stauts via neutron api using neutron-python binding
#!/usr/bin/env python
import sys
import json
from neutronclient.v2_0 import client as neutronclient
authurl = 'http://10.0.2.15:5000/v2.0'
username = 'demo'
password = 'pass'
tenantname = 'demo'
@dalitun
dalitun / spec_helper.rb
Created March 9, 2017 11:21 — forked from pda/spec_helper.rb
Fast RSpec with a tiered environment: SPEC=(unit|model|full) rspec …
mode = ENV["SPEC"] || "full"
require_relative "spec_helper_#{mode}"
@dalitun
dalitun / Create-Jenkins-Master-On-Windows-Server-Core.ps1
Created March 10, 2017 14:08 — forked from PlagueHO/Create-Jenkins-Master-On-Windows-Server-Core.ps1
Create a Jenkins Master on a Windows Server 2012 R2 Core install
# Configure the settings to use to setup this Jenkins Executor
$Port = 80
$IPAddress = '192.168.1.96'
$SubnetPrefixLength = 24
$DNSServers = @('192.168.1.1')
$DefaultGateway = '192.168.1.1'
# Install .NET Framework 3.5
Install-WindowsFeature -Name NET-Framework-Core
@dalitun
dalitun / painless_q.py
Created March 29, 2017 13:11 — forked from kastnerkyle/painless_q.py
Painless Q-Learning Tutorial implementation in Python http://mnemstudio.org/path-finding-q-learning-tutorial.htm
# Author: Kyle Kastner
# License: BSD 3-Clause
# Implementing http://mnemstudio.org/path-finding-q-learning-tutorial.htm
# Q-learning formula from http://sarvagyavaish.github.io/FlappyBirdRL/
# Visualization based on code from Gael Varoquaux [email protected]
# http://scikit-learn.org/stable/auto_examples/applications/plot_stock_market.html
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
@dalitun
dalitun / install-python.sh
Last active May 16, 2017 12:34 — forked from osterman/install-python.sh
Install Python on CoreOS
#!/bin/bash -uxe
VERSION=2.7.13.2713
PACKAGE=ActivePython-${VERSION}-linux-x86_64-glibc-2.3.6-401785
# make directory
mkdir -p /opt/bin
cd /opt
wget http://downloads.activestate.com/ActivePython/releases/${VERSION}/${PACKAGE}.tar.gz
@dalitun
dalitun / docker-compose.yml
Created May 22, 2017 16:01 — forked from JohannesRudolph/docker-compose.yml
Concourse on Docker with Let's Encrypt
## NOTE:
## because this docker-compose.yml is designed to work with a remote docker-machine,
## all mounted volume paths are currently relative to /concourse-data, data is thus stored on the docker host
nginx:
image: nginx
container_name: nginx
ports:
- "80:80"
- "443:443"