Skip to content

Instantly share code, notes, and snippets.

View avinson's full-sized avatar
🤠
Cowboying up

Aaron Vinson avinson

🤠
Cowboying up
View GitHub Profile
@eklitzke
eklitzke / prime.sh
Created June 7, 2017 18:55
find primes
#!/bin/bash
prime() {
declare -i x=2 y
while [ $x -lt $1 ]; do
y=$(($1 / $x))
if [ $(($y * $x)) -eq $1 ]; then
return 1
fi
x=$(($x+1))
@jrwren
jrwren / gist:9abe22b4761dc854a66e
Last active September 29, 2019 21:30
curl to kodi examples
# drawingroom is a DNS entry to the IP of my KODI
curl -D - -H 'Content-Type: application/json' -d '{"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}' drawingroom/jsonrpc
curl -D - -H 'Content-Type: application/json' -d '{"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": ["title", "album", "artist", "season", "episode", "duration", "showtitle", "tvshowid", "thumbnail", "file", "fanart", "streamdetails"], "playerid": 1}, "id": "VideoGetItem"}' drawingroom/jsonrpc
# play a url - these don't actually work.
curl --header 'Content-Type: application/json' --data-binary '{ "id": 1, "jsonrpc": "2.0", "method": "Player.Open", "params": {"item": { "file": "http://usher.justin.tv/api/channel/hls/nathanias.m3u8?allow_source=true&token=%7B%22user_id%22%3A20783272%2C%22channel%22%3A%22nathanias%22%2C%22expires%22%3A1452203636%2C%22chansub%22%3A%7B%22view_until%22%3A1924905600%2C%22restricted_bitrates%22%3A%5B%5D%7D%2C%22private%22%3A%7B%22allowed_to_view%22%3Atrue%7D%2C%22privileged%
@gene1wood
gene1wood / 01_get_account_id_for_user_ec2instance_role_or_lambda.py
Last active November 9, 2022 16:40
Method to determine your AWS account ID using boto3 for either a user or an ec2 instance or lambda function
import boto3
print(boto3.client('sts').get_caller_identity()['Account'])
@ralph-tice
ralph-tice / gist:3d6e5b2076cbc2900aaa
Last active December 25, 2018 11:17
terraform for 3 AZ VPC with NAT instance with autorecovery
###########
# Variables
###########
variable "aws_key_name" {
default = "mykeypair"
}
variable "region" {
default = "eu-west-1"
}
@gbuesing
gbuesing / ml-ruby.md
Last active February 28, 2024 15:13
Resources for Machine Learning in Ruby

UPDATE a fork of this gist has been used as a starting point for a community-maintained "awesome" list: machine-learning-with-ruby Please look here for the most up-to-date info!

Resources for Machine Learning in Ruby

Gems

@tony612
tony612 / arcanist_cheatsheet.md
Last active July 7, 2023 05:29 — forked from sekimura/gist:6367366
arcanist cheatsheet
  • create tasks T{NNNN} asign them
  • create a branch with name like "T{NNNN}-boo-hoo"
  • git checkout -b T1234-boo-foo
  • commit changes on that branch until it gets ready to be reviewed
  • git commit -am 'first'
  • git commit -am 'now it works'
  • check if it's lint free (NOTE: it runs lint against only modified files)
  • arc lint
  • push a review request to the server. This will create a diff with id D{NNNN}
  • arc diff
@dallasmarlow
dallasmarlow / check_hbase.rb
Last active December 17, 2015 11:49
hbck nagios check
#!/usr/bin/env tumblr_ruby
require 'zk'
require 'json'
require 'logger'
require 'socket'
require 'timeout'
require 'nrpe_check'
class CheckHBase
include NRPE::Check
@tadas-s
tadas-s / mysql-rename-db.sh
Created April 18, 2013 08:58
MySQL database rename script
#!/bin/bash
# Disclaimer - make backups, use at your own risk.
#
# Based on this comment: http://stackoverflow.com/a/13944924/843067
# Views and stored procedures have to be done separately.
OLDDB="old_db_name"
NEWDB="new_db_name"
MYSQL="mysql -u root -pyour_password "