Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Dye dandye

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am dandye on github.
  • I am dandye (https://keybase.io/dandye) on keybase.
  • I have a public key ASA-gPRwMft8T6zm3iIHKh2VSVhf1naW-T-xvApafZesnQo

To claim this, I am signing this object:

View gist:be7a94280e6d4fbec29e7e2146df767a
python -c 'import yaml,sys;yaml.safe_load(sys.stdin)' < .travis.yml
@dandye
dandye / aws_reports.py
Created Feb 6, 2018 — forked from Eyjafjallajokull/README.md
AWS EBS - Find unused snapshots - this script generates csv raport about snapshot usage
View aws_reports.py
import re
import boto3
import csv
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2')
def get_snapshots():
return ec2.describe_snapshots(OwnerIds=['self'])['Snapshots']
View splitDate.js
function splitDate(date) {
var rdate = /(\d+).(\d+).(\d+)/
return rdate.exec(date)
}
var [ , year, month, day] = splitDate('2015-11-06')
@dandye
dandye / mount_edge.sh
Last active May 25, 2017
VBox Shared Folder mount script
View mount_edge.sh
#!/bin/bash
#
# Mount a MacOS Directory via VirtualBox Shared Folder
# and open port 8000 for Django development server
#
# Args:
# ${1} mount name (optional; default: "edge_dev")
#
# Usage:
# sudo ./mount_edge.sh edge_dev
View lxc_centos.sh
[admin@edge ~]$ sudo yum install lxc lxc-templates
...
[admin@edge ~]$ rpm -qil lxc-templates | grep centos
/usr/share/lxc/config/centos.common.conf
/usr/share/lxc/config/centos.userns.conf
/usr/share/lxc/templates/lxc-centos
[admin@edge ~]$ sudo lxc-create -t centos -n c1
View gist:3b2439bad4893dbb0f3f0bbf37d47b7d
mkdir ~/Documents/Screenshots
defaults write com.apple.screencapture location ~/Documents/Screenshots
killall SystemUIServer
@dandye
dandye / compile_install_tmux2.3.sh
Created Apr 6, 2017
Compile tmux 2.3 on CentOS 6
View compile_install_tmux2.3.sh
sudo yum install gcc kernel-devel make ncurses-devel wget automake
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xzvf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
make
sudo make install
@dandye
dandye / ranpwd.spec
Created Jan 19, 2017
RPM spec file for ranpwd v1.1-1
View ranpwd.spec
[admin@localhost ~]$ vim ranpwd.spec
Summary: A program to generate random passwords
Name: ranpwd
Version: 1.1
Release: 1
License: GPL
Group: Applications/System
Source0: ftp://ftp.kernel.org/pub/software/utils/admin/ranpwd/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
@dandye
dandye / aws_cli_open_port.sh
Created Jan 17, 2017
AWS CLI Open Port for my IP in specified security group
View aws_cli_open_port.sh
pip install awscli
export AWS_ACCESS_KEY_ID=$AWS_alice_ACCESS_KEY_ID
export AWS_SECRET_ACCESS_KEY=$AWS_alice_SECRET_ACCESS_KEY
export AWS_DEFAULT_REGION=$AWS_alice_DEFAULT_REGION
export AWS_GROUP_ID=$AWS_alice_GROUP_ID
aws ec2 authorize-security-group-ingress \
--group-id $AWS_GROUP_ID \
--protocol tcp \
--port 22 \
--cidr $(dig +short myip.opendns.com @resolver1.opendns.com)/32)
You can’t perform that action at this time.