Skip to content

Instantly share code, notes, and snippets.

View thcipriani's full-sized avatar

Tyler Cipriani thcipriani

View GitHub Profile
@thcipriani
thcipriani / orders.js
Created February 4, 2014 22:11
Small MC
$.observable = function(model) {
model.Vent = $({});
var handleEvent = function(vent, args) {
var argArr = Array.prototype.slice.call(args);
model.Vent[vent].apply(model.Vent, argArr);
return model;
};
model.trigger = function() { return handleEvent('trigger', arguments); };
@thcipriani
thcipriani / checkedbury.sh
Created February 5, 2014 18:39
Ebury rootkit detect
#!/usr/bin/env bash
ipcs=$(ipcs -m | grep root | grep -c 666)
if (( $ipcs > 1 )); then
echo "ROOT KIT DETECTED" | mail -s "ROOTKIT ON CCREMIX" thcipriani@gmail.com
else
echo "we're cool"
fi
@thcipriani
thcipriani / 2012-04-12-brewday.md
Last active August 29, 2015 13:59
Brew Day Checklist
@thcipriani
thcipriani / dynnds
Last active August 29, 2015 14:01
dyndns
#!/usr/bin/env python
# http://blog.vrypan.net/2012/12/20/dynamic-dns-with-route53/
from area53 import route53
from boto.route53.exception import DNSServerError
import subprocess
import sys
def get_ip():
p = subprocess.Popen("/usr/bin/dig +short @resolver1.opendns.com myip.opendns.com", stdout=subprocess.PIPE, shell=True)
(output, err) = p.communicate()
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css">
.ef0,.f0 { color: #000000; } .eb0,.b0 { background-color: #000000; }
.ef1,.f1 { color: #AA0000; } .eb1,.b1 { background-color: #AA0000; }
.ef2,.f2 { color: #00AA00; } .eb2,.b2 { background-color: #00AA00; }
.ef3,.f3 { color: #AA5500; } .eb3,.b3 { background-color: #AA5500; }
.ef4,.f4 { color: #0000AA; } .eb4,.b4 { background-color: #0000AA; }
.ef5,.f5 { color: #AA00AA; } .eb5,.b5 { background-color: #AA00AA; }
-- Lamest answer to http://www.seas.upenn.edu/~cis194/lectures.html HW1
toDigits :: Integer -> [Integer]
toDigits x
| x <= 0 = []
| otherwise = toDigits a ++ [b]
where
a = div x 10
b = mod x 10
double2nd :: [Integer] -> [Integer]
@thcipriani
thcipriani / greater_than_five
Created August 21, 2014 17:05
Find lines in file > 5 words
#!/usr/bin/env bash
while read line; do
if (( $(echo $line | wc -w) > 5 )); then
echo "$line is greater than 5 words"
fi
done < "$1"
@thcipriani
thcipriani / ds213j.md
Created September 8, 2014 20:13
Synology DS213J

Synology DS213J setup

Installing ipkg

Services:

  • synoservicecfg --list
  • synoservicecfg --restart [service]
  • synoservicecfg --status [service]
@thcipriani
thcipriani / Keys.md
Last active August 29, 2015 14:07
ssh public key

My Public Keys

I made a quick shortcut to share my public keys quickly and easily. This shortcut likely brought you to this place.

The goods

#!/bin/bash
printf "Enter OpenStack cloud password: "
read pass
# With the addition of Keystone, to use an openstack cloud you should
# authenticate against keystone, which returns a **Token** and **Service
# Catalog**. The catalog contains the endpoint for all services the
# user/tenant has access to - including nova, glance, keystone, swift.
#