Skip to content

Instantly share code, notes, and snippets.

View poolMetadata.json
{ "name": "Sunshine Stake Pool", "description": "Bringing sunshine to your ADA", "ticker": "SHINE", "homepage": "https://sunshinestake.com" }
View keybase.md

Keybase proof

I hereby claim:

  • I am toma-r on github.
  • I am tomarbesser (https://keybase.io/tomarbesser) on keybase.
  • I have a public key ASAbz--dqg3STYISNlWjTD13fx-9PubNnmS8Th6lSj0F0Ao

To claim this, I am signing this object:

@TomA-R
TomA-R / clean-beanstalkd.sh
Created Jul 16, 2018
Purge beanstalkd tubes
View clean-beanstalkd.sh
# clean-beanstalkd.sh
#!/bin/bash
echo "list-tubes" | nc -C beanstalkd.host.example 11300 | grep pattern-example[0-9]-xyz | awk '{ print $2 }' > process-tubes.txt
while [ -s process-tubes.txt ]
do
while read line; do ./beanstalk-purge beanstalkd.ec2.edminfra.com 11300 $line 2; done < process-tubes.txt
echo "list-tubes" | nc -C beanstalkd.ec2.edminfra.com 11300 | grep [0-9].ssm-i | awk '{print $2}' > process-tubes.txt
done;
@TomA-R
TomA-R / getinstances.py
Created Jul 12, 2018
Print EC2 instances by tag value
View getinstances.py
#!/usr/bin/python
# Used on bastion host (jumpbox)
# e.g.: for feedserver in $(/usr/bin/getinstances feed-server); do echo $feedserver; ssh $feedserver; done;
# @todo: make VPC detection automatic
import sys
import json
import subprocess
@TomA-R
TomA-R / install-redis.sh
Last active May 9, 2018
Install Redis stable
View install-redis.sh
#!/bin/bash
# Dependencies
yum install -y tcl
# Download and extract source code
cd /usr/local/src
wget http://download.redis.io/redis-stable.tar.gz
tar xzvf redis-stable.tar.gz
rm -f redis-stable.tar.gz
@TomA-R
TomA-R / packer-iam-policy.json
Created Apr 12, 2018
Packer Amazon AWS IAM policy permission document
View packer-iam-policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:AttachVolume",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:CopyImage",
"ec2:CreateImage",
View beanstalkd
#!/bin/sh
#
# beanstalkd - a simple, fast workqueue service
#
# chkconfig: - 57 47
# description: a simple, fast workqueue service
# processname: beanstalkd
# config: /etc/sysconfig/beanstalkd
#
@TomA-R
TomA-R / ec2-instance-subnet-id.md
Created Nov 15, 2017 — forked from samkeen/ec2-instance-subnet-id.md
Get the subnet and VPC id of a running EC2 instance
View ec2-instance-subnet-id.md

First get the Interface mac address, then use that to run the full command

INTERFACE=$(curl --silent http://169.254.169.254/latest/meta-data/network/interfaces/macs/)
SUBNET_ID=$(curl --silent http://169.254.169.254/latest/meta-data/network/interfaces/macs/${INTERFACE}/subnet-id)
VPC_ID=$(curl --silent http://169.254.169.254/latest/meta-data/network/interfaces/macs/${INTERFACE}/vpc-id)

echo $SUBNET_ID
View Arduino parts
1 x Uno R3 board +1 x USB cable
1 x Uno R3 Extension baord + 1 x GPIO Extension Board + 1 x Connecting Cable
1 x Breadboard
1 x Mini Breadboard
10 x 3mm Red LEDs
10 x 3mm Green LEDs
10 x 3mm Yellow LEDs
1 x 5mm RGB LED
5 x Button
20 x (330 ohm + 1k ohm +10k ohm)resistor
View gist:aaca4f6c7fb53319d5f1
# Serve .vtt files with Access-Control-Allow-Origin: * header if referer is the correct domain
<IfModule mod_setenvif.c>
<FilesMatch "\.vtt$">
SetEnvIf Referer "^http(s)?://(.+\.)?somedomain\.com/" VALID_REFERER=$1
Header set Access-Control-Allow-Origin "*" env=VALID_REFERER
</FilesMatch>
</IfModule>
You could also use origin