Skip to content

Instantly share code, notes, and snippets.

View avantassel's full-sized avatar
💯

Andrew Van Tassel avantassel

💯
View GitHub Profile
@avantassel
avantassel / country_currency_list.json
Created May 16, 2020 18:37
Country Currency List with html codes
[{
"name": "Albania Lek",
"code": "ALL",
"html": "Lek",
"sign": "Lek"
},{
"name": "Afghanistan Afghani",
"code": "AFN",
"html": "؋",
"sign": "؋"
@avantassel
avantassel / slack-verify.php
Created February 1, 2019 12:50
Verifying requests from Slack in PHP
<?php
/*
Verifying requests from Slack
https://api.slack.com/docs/verifying-requests-from-slack
The slack message has two buttons, Approve and Deny
verify the request from Slack and update approved or denied
*/
$raw_body = file_get_contents('php://input');
$response = ["message" => "success"];
@avantassel
avantassel / nginxoptimization.config
Created November 9, 2018 20:02 — forked from wearhere/nginxoptimization.config
Optimized nginx configuration for an AWS Elastic Beanstalk environment using an Application Load Balancer.
files:
"/opt/elasticbeanstalk/#etc#nginx#optimized-nginx.conf":
mode: "000644"
owner: root
group: root
encoding: plain
content: |
# Elastic Beanstalk Managed
# Elastic Beanstalk managed configuration file
@avantassel
avantassel / ebsnvme-id
Created June 19, 2018 19:20 — forked from lbernail/ebsnvme-id
ebsnvme-id script
#!/usr/bin/env python2.7
# Copyright (C) 2017 Amazon.com, Inc. or its affiliates.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/

Keybase proof

I hereby claim:

  • I am avantassel on github.
  • I am avantassel (https://keybase.io/avantassel) on keybase.
  • I have a public key ASCFd_Isf7UYZS32eGbfN7wWBl2zxYBpqFXrFx_nbCfHUgo

To claim this, I am signing this object:

@avantassel
avantassel / README.md
Last active March 1, 2018 19:59
Kafka Sentry Ansible Config

Using the on-prem version of Sentry but should work with their hosted version, just add the DSN. Setup up on Ubuntu and Kafka 1.0.0.

You will also need the environment variables when starting Kafka

export SENTRY_PROPERTIES_FILE=/etc/kafka/config/sentry.properties 
export CLASSPATH=/etc/kafka/libs/*
#!/bin/bash -xe
# requires jq and 3 brokers to start
which jq || echo 'no jq found, bye!' && exit 1
ZK_HOST=zkhost1:2181/kafka
# record all topics
/usr/local/kafka/bin/kafka-topics.sh --zookeeper $ZK_HOST --list > all_topics
# generate json for listing which topics to reassign
@avantassel
avantassel / kafka_topics.sh
Created November 7, 2017 20:52 — forked from kapkaev/kafka_topics.sh
Calculate kafka topics sizes
#!/usr/bin/ruby
require 'net/ssh'
require 'pp'
def fetch(host)
data = []
Net::SSH.start(host, 'virool') do |ssh|
index_folders = ssh.exec!("ls -d /var/lib/kafka/*").split("\n")
data = index_folders.flat_map do |ifolder|
@avantassel
avantassel / .gitconfig
Created July 5, 2017 17:08
gitconfig aliases
[alias]
# one-line log
l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
a = add
ap = add -p
c = commit --verbose
ca = commit -a --verbose
cm = commit -m
cam = commit -a -m
@avantassel
avantassel / loadtest-test
Created February 10, 2017 17:24
Bash script for load testing npm test
#!/bin/bash
for x in {1..100} ; do echo "$x runs"; npm test ||break;sleep 5; done