Skip to content

Instantly share code, notes, and snippets.

View ymcdull's full-sized avatar

Yunfeng Zhu ymcdull

  • Glasgow
View GitHub Profile
@ymcdull
ymcdull / security-group-cleanup.py
Created April 14, 2016 11:29
A simple python file to clean up all unused AWS security groups with boto3
#!/usr/bin/env python
import boto3
### ###
# Need aws credentails already been configured #
### ###
### Code based on https://gist.github.com/miketheman/2630437
client = boto3.client('ec2')
@mbn18
mbn18 / gist:0d6ff5cb217c36419661
Last active October 21, 2023 10:22
How to install nsenter on Ubuntu 14.04
# Ubuntu 14.04 don't have nsenter - the straight forward way required me to install build tools and etc.
# I preferred to keep the system clean and install nsenter in a container and then copy the command to the host
# Note - its also possible to run nsenter from a container (didn't tried) https://github.com/jpetazzo/nsenter
# start a container
docker run --name nsenter -it ubuntu:14.04 bash
## in the docker
apt-get update
apt-get install git build-essential libncurses5-dev libslang2-dev gettext zlib1g-dev libselinux1-dev debhelper lsb-release pkg-config po-debconf autoconf automake autopoint libtool
@bhoung
bhoung / k-fold CV.r
Created April 24, 2014 00:52
starter code for k fold cross validation using the iris dataset
# original example from Digg Data website (Takashi J. OZAKI, Ph. D.)
# http://diggdata.in/post/58333540883/k-fold-cross-validation-in-r
library(plyr)
library(randomForest)
data <- iris
# in this cross validation example, we use the iris data set to