Skip to content

Instantly share code, notes, and snippets.

View visualdensity's full-sized avatar
🤷‍♂️
Whassup?

Wicked visualdensity

🤷‍♂️
Whassup?
View GitHub Profile
@visualdensity
visualdensity / self_sign_proc.sh
Last active February 11, 2019 00:50 — forked from yuezhu/gist:47b15b4b8e944221861ccf7d7f5868f5
Generate self-signed certificate for HAProxy
# Generate a unique private key (KEY)
sudo openssl genrsa -out mydomain.key 2048
# Generating a Certificate Signing Request (CSR)
sudo openssl req -new -key mydomain.key -out mydomain.csr
# Creating a Self-Signed Certificate (CRT)
openssl x509 -req -days 365 -in mydomain.csr -signkey mydomain.key -out mydomain.crt
# Append KEY and CRT to mydomain.pem
@visualdensity
visualdensity / list.txt
Created October 25, 2018 03:07 — forked from shortjared/list.txt
List of AWS Service Principals
acm.amazonaws.com
apigateway.amazonaws.com
athena.amazonaws.com
autoscaling.amazonaws.com
clouddirectory.amazonaws.com
cloudformation.amazonaws.com
cloudfront.amazonaws.com
cloudsearch.amazonaws.com
cloudtrail.amazonaws.com
codecommit.amazonaws.com
@visualdensity
visualdensity / uuid.sh
Last active April 29, 2017 12:19 — forked from markusfisch/uuid.sh
Generate a random UUID in bash and looped 30k times to generate more random bytes
#!/usr/bin/env bash
# Generate a pseudo UUID
uuid()
{
local N B C='89ab'
for (( N=0; N < 16; ++N ))
do
B=$(( $RANDOM%256 ))
CMDB:
I do not have names on specific commentors. These notes have been re-ordered to make a bit more sense.
We have dynamic environments, with information coming from systems and builds.
Systems need configuration from runtime data based on service discovery and build configuration (IP addresses, versions, etc).
CMDB use contexts:
On call users - The sysadmin who has been paged at 4 am needs to determine context for the page.
Deployment systems - To know where to deploy software, what version(s) to deploy, etc.
Maintenance - Downtimes, escalate, software versions, hardware info...
@visualdensity
visualdensity / tmux.md
Created September 22, 2016 07:27 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

#! /usr/bin/env python
import fileinput
import argparse
from operator import itemgetter
parser = argparse.ArgumentParser()
parser.add_argument('--target-mb', action = 'store', dest = 'target_mb', default = 61000, type = int)
parser.add_argument('vmtouch_output_file', action = 'store', nargs = '+')
args = parser.parse_args()
@visualdensity
visualdensity / push.py
Last active August 29, 2015 14:23 — forked from ndfred/push.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A simple standalone script to test an Apple Push Notification setup.
Uses the feedback packets to provide the best information on how to fix things.
Steps to send a push notification:

1: Generate CSR

openssl req -new -newkey rsa:2048 -nodes -keyout server-cert.key -out server-cert-sign-req.csr

	# Country Name (2 letter code) [AU]:US
	# State or Province Name (full name) [Some-State]:California
	# Locality Name (eg, city) []:
	# Organization Name (eg, company) [Internet Widgits Pty Ltd]:Flutterby Labs, Inc.
	# Organizational Unit Name (eg, section) []:
@visualdensity
visualdensity / dnn.py
Last active August 29, 2015 14:05 — forked from syhw/dnn.py
"""
A deep neural network with or w/o dropout in one file.
http://snippyhollow.github.io/blog/2014/08/09/so-you-wanna-try-deep-learning/
"""
import numpy, theano, sys, math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams
from collections import OrderedDict
#!/bin/bash
function jsonval {
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop`
echo ${temp##*|}
}
json=`curl -s -X GET http://twitter.com/users/show/$1.json`
prop='profile_image_url'
picurl=`jsonval`