Skip to content

Instantly share code, notes, and snippets.

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

Wicked visualdensity

🤷‍♂️
Whassup?
View GitHub Profile
<?php
/**
* PHP Akamai Purge
*
* By: Jason Rundell <jason dot rundell (at) gmail dot com> http://jasonrundell.com @jasonrundell
* Started: December 20th 2011
* Fork me: https://github.com/jasonrundell/PHP-Akamai-Purge
* Cudos: https://github.com/hradtke http://hermanradtke.com @hermanradtke
* I came across https://bugs.php.net/bug.php?id=43910 while doing a Google search for
* other folks who have worked with Akamai's SOAP API and PHP. The original function
#!/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`
@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

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 / 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:
#! /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 / 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

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 / 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 ))
@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