Skip to content

Instantly share code, notes, and snippets.

View slacksec's full-sized avatar

Jason Huang slacksec

View GitHub Profile
var utils = require('../lib/utils.js');
var ORIENTATION = {north: 'vertical', east: 'horizontal', south: 'vertical', west: 'horizontal'};
var redplayer = {
info: {
name: 'redplayer',
style: 3
},
ai: function(playerState, enemiesStates, gameEnvironment) {
var response;
@slacksec
slacksec / clean_sqs.py
Created November 8, 2017 01:57 — forked from alexmojaki/clean_sqs.py
Clean out old SQS queues
"""
This script iterates through all your SQS queues (based on your default
AWS credentials), shows you a few helpful attributes, and asks if you want
to delete it. It's meant as an easy way to clean out old queues that are
no longer needed.
Requires boto3 (pip install boto3).
The names of queues are derived from their URLs which are assumed to have
a common prefix: replace the 12345 in the URL below. If you don't know what
@slacksec
slacksec / save-sqs-queue.py
Created January 29, 2018 20:34 — forked from kern/save-sqs-queue.py
Saves all messages from an AWS SQS queue into a folder
import argparse
import boto.sqs
import json
import os
parser = argparse.ArgumentParser(description='Saves all messages from an AWS SQS queue into a folder.')
parser.add_argument(
'-q', '--queue', dest='queue', type=str, required=True,
help='The name of the AWS SQS queue to save.')
@slacksec
slacksec / ansible-vault-pass.bash
Created April 3, 2018 05:23 — forked from toke/ansible-vault-pass.bash
Small helper script for usage with ansible-vault and ansible-playbook together with pass https://www.passwordstore.org/ Two implementations: first in bash and anotger one in python, which should be better as the git config hack to get ini files may fail due to incompatibilities in git vs. ansible ini style. The bash version is kept for reference.
#!/usr/bin/env bash
set -e
#
# Written by Thomas Kerpe <toke@toke.de> - Public Domain
#
# Small helper script for usage with ansible-vault and ansible-playbook
# together with [pass](https://www.passwordstore.org/)
#
# Say you have stored the vault-password for the current ansible playbook in pass
import requests
import time
import json
token = ''
#Delete files older than this:
ts_to = int(time.time()) - 30 * 24 * 60 * 60
def list_files():
@slacksec
slacksec / setenv.sh
Created July 16, 2018 10:08 — forked from terrancesnyder/setenv.sh
./setenv.sh - example setenv.sh with defaults set for minimal time spent in garbage collection
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft