Skip to content

Instantly share code, notes, and snippets.

Dmitriy Martynov kainam00

  • United States
Block or report user

Report or block kainam00

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kainam00
kainam00 / slowserver.py
Created Nov 4, 2016
A simple HTTP server designed to be slow. Useful for testing LB timeouts and such.
View slowserver.py
#!/usr/bin/env python
# Includes
import getopt
import sys
import os.path
import subprocess
import BaseHTTPServer
import SocketServer
import time
@kainam00
kainam00 / partx
Created Jun 10, 2016
Newer partx. Base64 encoded
View partx
IyEgL2Jpbi9zaAoKIyBwYXJ0eCAtIHRlbXBvcmFyeSB3cmFwcGVyIHNjcmlwdCBmb3IgLmxpYnMvcGFydHgKIyBHZW5lcmF0ZWQgYnkgbGlidG9vbCAoR05VIGxpYnRvb2wpIDIuNC4yCiMKIyBUaGUgcGFydHggcHJvZ3JhbSBjYW5ub3QgYmUgZGlyZWN0bHkgZXhlY3V0ZWQgdW50aWwgYWxsIHRoZSBsaWJ0b29sCiMgbGlicmFyaWVzIHRoYXQgaXQgZGVwZW5kcyBvbiBhcmUgaW5zdGFsbGVkLgojCiMgVGhpcyB3cmFwcGVyIHNjcmlwdCBzaG91bGQgbmV2ZXIgYmUgbW92ZWQgb3V0IG9mIHRoZSBidWlsZCBkaXJlY3RvcnkuCiMgSWYgaXQgaXMsIGl0IHdpbGwgbm90IG9wZXJhdGUgY29ycmVjdGx5LgoKIyBTZWQgc3Vic3RpdHV0aW9uIHRoYXQgaGVscHMgdXMgZG8gcm9idXN0IHF1b3RpbmcuICBJdCBiYWNrc2xhc2hpZmllcwojIG1ldGFjaGFyYWN0ZXJzIHRoYXQgYXJlIHN0aWxsIGFjdGl2ZSB3aXRoaW4gZG91YmxlLXF1b3RlZCBzdHJpbmdzLgpzZWRfcXVvdGVfc3Vic3Q9J3MvXChbYCIkXFxdXCkvXFxcMS9nJwoKIyBCZSBCb3VybmUgY29tcGF0aWJsZQppZiB0ZXN0IC1uICIke1pTSF9WRVJTSU9OK3NldH0iICYmIChlbXVsYXRlIHNoKSA+L2Rldi9udWxsIDI+JjE7IHRoZW4KICBlbXVsYXRlIHNoCiAgTlVMTENNRD06CiAgIyBac2ggMy54IGFuZCA0LnggcGVyZm9ybXMgd29yZCBzcGxpdHRpbmcgb24gJHsxKyIkQCJ9LCB3aGljaAogICMgaXMgY29udHJhcnkgdG8gb3VyIHVzYWdlLiAgRGlzYWJsZSB0aGlzIGZlYXR1cmUuCiAgYWxpYXMgLWcg
@kainam00
kainam00 / yazproxy
Created Feb 29, 2016
Yaz Proxy / yazproxy init script
View yazproxy
#!/bin/bash
# Simple yazproxy init script
# chkconfig: 345 20 80
# description: yazproxy
# processname: yazproxy
# Variables
PORT=9001
LOGDEST=/var/log/yazproxy.log
@kainam00
kainam00 / prettygenerate.rb
Created Sep 17, 2015
ruby pretty JSON generate
View prettygenerate.rb
require 'json'
JSON.pretty_generate(string)
@kainam00
kainam00 / aws-nfs-client.bash
Last active Sep 2, 2015
NFS client on Amazon (AWS) linux
View aws-nfs-client.bash
#!/bin/bash -x
yum install nfs-utils rpcbind -y
service rpcbind start
service nfslock start
chkconfig rpcbind on
chkconfig nfslock on
@kainam00
kainam00 / asg-control.bash
Created Aug 13, 2015
Script to suspend and resume AWS autoscaling groups (ASG)
View asg-control.bash
#!/bin/bash
TMPFILE="/tmp/asgs.temp"
function usage()
{
echo "Usage: $0 -a {suspend|resume} -f name-filter -p profile-name"
echo "Where: "
echo " -a - Action - suspend or resume autoscaling."
echo " -f - Name filter - filter for autoscaling groups. Allows you to select autoscaling groups matching a specific string."
@kainam00
kainam00 / bucket-policy.json
Created Aug 7, 2015
S3 bucket policy template
View bucket-policy.json
{
"Version": "2008-10-17",
"Id": "Policy1357935677554",
"Statement": [
{
"Sid": "Stmt1357935647218",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::123123123123:root"
},
@kainam00
kainam00 / secure-s3-bucket.rb
Last active Aug 29, 2015
Remove Everyone / public permissions from S3 bucket objects
View secure-s3-bucket.rb
#!/usr/bin/env ruby
require 'aws-sdk'
require 'yaml'
# Check args
if ARGV[0].nil? || ARGV[1].nil?
puts "Usage: securey-s3-bucket.rb bucket_name path-to-config-file.yml dryrun(optional)"
puts " Where the config file is a YAML formatted file with the following data:"
puts " access_key_id: xxx"
puts " secret_access_key: yyy"
@kainam00
kainam00 / jruby-amazon-linux.bash
Created Jul 31, 2015
Install jruby on Amazon Linux
View jruby-amazon-linux.bash
#!/bin/bash
# Install prerequisites
yum install -y gcc openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel ruby-devel gcc-c++ jq git
# Import key
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
# Install RVM
curl -sSL https://get.rvm.io | bash -s stable --ruby
@kainam00
kainam00 / rvm-amazon-linux.bash
Created Jul 31, 2015
Install RVM on Amazon Linux
View rvm-amazon-linux.bash
#!/bin/bash
# Install prerequisites
yum install -y gcc openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel ruby-devel gcc-c++ jq git
# Import key
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
# Install RVM
curl -sSL https://get.rvm.io | bash -s stable --ruby
You can’t perform that action at this time.