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!
- liblinear-ruby: Ruby interface to LIBLINEAR using SWIG
#!/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)) |
# 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% |
import boto3 | |
print(boto3.client('sts').get_caller_identity()['Account']) |
########### | |
# Variables | |
########### | |
variable "aws_key_name" { | |
default = "mykeypair" | |
} | |
variable "region" { | |
default = "eu-west-1" | |
} |
git checkout -b T1234-boo-foo
git commit -am 'first'
git commit -am 'now it works'
arc lint
arc diff
#!/usr/bin/env tumblr_ruby | |
require 'zk' | |
require 'json' | |
require 'logger' | |
require 'socket' | |
require 'timeout' | |
require 'nrpe_check' | |
class CheckHBase | |
include NRPE::Check |
#!/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 " |