Skip to content

Instantly share code, notes, and snippets.

View cpuspellcaster's full-sized avatar

Dahlia Kelsey cpuspellcaster

  • Los Angeles
  • 23:13 (UTC -08:00)
View GitHub Profile
@cpuspellcaster
cpuspellcaster / dns_jammer.js
Created June 28, 2017 23:36
Attempt to overload DNS in a container
const dns = require('dns')
const co = require('co')
for (i = 0; i < 100; i++) {
co(function* () {
var res = yield[
d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(),
d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(),
d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(),
d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(), d(),
@cpuspellcaster
cpuspellcaster / avg_googlebot_response_time.sh
Created May 19, 2017 01:59
Average Googlebot Response Time
#! /usr/bin/env bash
# xargs to trim output
NUM_OF_GOOGLEBOT_REQS=$(zgrep -i "googlebot" *.log.gz | wc -l | xargs)
echo "NUM_OF_GOOGLEBOT_REQS: $NUM_OF_GOOGLEBOT_REQS"
SUM_RESPONSE_TIMES=$(zgrep -i "googlebot" *.log.gz | awk '{ print $6+$7+$8 }' | awk '{ sum += $1 } END { print sum }')
echo "SUM_RESPONSE_TIMES: $SUM_RESPONSE_TIMES"
@cpuspellcaster
cpuspellcaster / create-iso.sh
Created May 7, 2017 23:46 — forked from julianxhokaxhiu/create-iso.sh
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
@cpuspellcaster
cpuspellcaster / create-iso.sh
Created May 7, 2017 23:46 — forked from julianxhokaxhiu/create-iso.sh
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
@cpuspellcaster
cpuspellcaster / gunzip_all.sh
Created May 6, 2017 00:51
Gunzip all files in a dir
#! /usr/bin/env bash
find $PWD -type f -name "*.gz" -print0 | xargs -0 gunzip
@cpuspellcaster
cpuspellcaster / docker-ps-all.sh
Created May 5, 2017 19:47
Query all ECS instances and get output of 'docker ps'
#! /usr/bin/env bash
IP_ADDRS=$(
aws --profile prod ec2 describe-instances \
--filters \
"Name=tag:Environment,Values=prod" \
"Name=tag:Name,Values=blackbird_microservices" \
"Name=instance-state-name,Values=running" \
--query "Reservations[*].Instances[*].PrivateIpAddress" \
--output text
@cpuspellcaster
cpuspellcaster / gist:d660aed08681243befd7492176e6d75c
Created March 4, 2017 00:02
Elasticsearch Shard Unassigned Reason
_cat/shards?h=index,shard,prirep,state,unassigned.reason
@cpuspellcaster
cpuspellcaster / .vimrc
Created March 2, 2017 22:58
.vimrc File March 2017
"VimPlug
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'airblade/vim-gitgutter'
Plug 'hashivim/vim-terraform'
Plug 'jiangmiao/auto-pairs'
Plug 'w0rp/ale'
call plug#end()
@cpuspellcaster
cpuspellcaster / hijack.txt
Created January 8, 2017 02:20
Docker Hijack Protocol
Stream details:
When using the TTY setting is enabled in POST, the stream is the raw data from the process PTY and client’s stdin. When the TTY is disabled, then the stream is multiplexed to separate stdout and stderr.
The format is a Header and a Payload (frame).
HEADER
The header contains the information which the stream writes (stdout or stderr). It also contains the size of the associated frame encoded in the last four bytes (uint32).
@cpuspellcaster
cpuspellcaster / rabbitmq.txt
Last active February 18, 2017 22:29 — forked from sdieunidou/rabbitmq.txt
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
rabbitmqctl set_policy ha-all "" '{"ha-mode":"exactly","ha-params":2,"ha-sync-mode":"automatic"}'