Skip to content

Instantly share code, notes, and snippets.

import os
import tempfile
import tarfile
from concurrent import futures
from io import BytesIO
import boto3
import logging
logger = logging.getLogger()
@arjunurs
arjunurs / init.vim
Created February 10, 2019 19:38 — forked from matthewbdaly/init.vim
My NeoVim config
call plug#begin()
" NERDTree
Plug 'scrooloose/nerdtree'
" Git integration
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
" Linting
@arjunurs
arjunurs / README.md
Created January 23, 2019 11:02 — forked from magnetikonline/README.md
Bash getopts usage template.

Bash getopts usage template

#!/bin/bash -e

function usage {
	cat <<EOM
Usage: $(basename "$0") [OPTION]...

 -a VALUE argument description
@arjunurs
arjunurs / Ansible Email
Created January 22, 2019 00:40 — forked from sudheerchamarthi/Ansible Email
This Ansible is to Send an email using Google SMTP credentials
###############################################################
############### PREREQUISITE #################################
## Make Sure that "Access for less secure apps has been turned on" in you Gmail account by following the below link
## LINK: https://myaccount.google.com/lesssecureapps
## If Not your email will not be delivered and you will recieve a Warning Notifcation like "Review blocked sign-in attempt"
---
- name: Sending email
mail:
host: smtp.gmail.com
@arjunurs
arjunurs / install-pre-commit.sh
Created December 12, 2016 02:20 — forked from stefansundin/install-pre-commit.sh
Git pre-commit check to stop accidental commits to master and develop branches. There is also a variant with a core.whitespace check.
#!/bin/sh
# This script will install a Git pre-commit hook that stop accidental commits to master and develop branches.
# There is also a variant that includes a core.whitespace check. See pre-commit-2 below.
# Install in current Git repo:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh
# Install with core.whitespace check:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-2
# Install with core.whitespace check and EOF-newline-check:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-3
# Install only core.whitespace check:
@arjunurs
arjunurs / topological.py
Last active August 29, 2015 14:27 — forked from kachayev/topological.py
Topological sort with Python (using DFS and gray/black colors)
# Simple:
# a --> b
# --> c --> d
# --> d
graph1 = {
"a": ["b", "c", "d"],
"b": [],
"c": ["d"],
"d": []
}

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@arjunurs
arjunurs / .vimrc
Created January 12, 2014 13:03 — forked from JeffreyWay/.vimrc
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
Scripts:
* setup.py creates cloud instances,installs and starts jmeter-server
* cleanup.py destroys cloud instances who's name matches a pattern
Usage:
1) edit setup.py, and insert your username/api key/ssh keys. Define the number of instances you want
1a) install the dependencies listed at the top of setup.py
2) run setup.py
3) edit jmeter.properties and add the line specified at the end of setup.py's output
4) run jmeter, build a test plan, and start on all remotes.
// This file is a super-simple example of capturing a webcam up to a flash media server
// You can use RED5 1.0, Wowza, or FMS for this example - there are demo recording apps
// (oflaDemo for red5, vod for Wowza) included with each. Note: red5 .9xx reportedly
// does not like the buffered upstream sending we're doing here.
// All of the existing examples I could find simply had you "stop" the netstream object
// when the user was done recording, which, if you have any client-side buffer at all completely
// borks the recorded FLV. This example uses a 60 second client-side buffer, which
// allows you to capture high-quality webcam videos even if the upstream bandwidth
// isn't perfect or consistent. Once the user is done, the buffer continues sending up