Skip to content

Instantly share code, notes, and snippets.

View spikegrobstein's full-sized avatar

spike grobstein spikegrobstein

View GitHub Profile
@spikegrobstein
spikegrobstein / plex_data_to_graphite.rb
Created May 6, 2014 03:04
graph who is streaming plex to graphite
#! /usr/bin/env ruby
require 'nokogiri'
require 'faraday'
host = 'http://plex.example.com:32400'
uri = '/status/sessions'
f = Faraday.new( host )

Keybase proof

I hereby claim:

  • I am spikegrobstein on github.
  • I am spizzike (https://keybase.io/spizzike) on keybase.
  • I have a public key whose fingerprint is 0633 0076 8FE7 AEFE 4E03 9CDA 75BC D287 70D0 33E3

To claim this, I am signing this object:

@spikegrobstein
spikegrobstein / bluetooth_try.sh
Last active August 29, 2015 14:10
tool to automatically connect to a bluetooth device (using on emulationstation w/ retropie)
#! /bin/bash -
# The MIT License (MIT)
#
# Copyright (c) 2014 Spike Grobstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@spikegrobstein
spikegrobstein / emulationstation.gprof
Created January 1, 2015 23:37
dump of emulationstation's gprof data
This file has been truncated, but you can view the full file.
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
75.00 0.09 0.09 205 0.44 0.44 nsvgRasterize
8.33 0.10 0.01 6667 0.00 0.00 resolvePath(boost::filesystem::path const&, boost::filesystem::path const&, bool)
8.33 0.11 0.01 206 0.05 0.05 ImageIO::flipPixelsVert(unsigned char*, unsigned int const&, unsigned int const&)
8.33 0.12 0.01 10 1.00 1.00 ImageIO::loadFromMemoryRGBA32(unsigned char const*, unsigned int, unsigned int&, unsigned int&)
0.00 0.12 0.00 52364 0.00 0.00 __gnu_cxx::__exchange_and_add_dispatch(int*, int) [clone .constprop.34]
@spikegrobstein
spikegrobstein / es_report.txt
Created January 3, 2015 18:20
EmulationStation gprof data (sitting for a couple minutes)
This file has been truncated, but you can view the full file.
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
37.50 0.06 0.06 165 0.36 0.36 nsvgRasterize
18.75 0.09 0.03 8511 0.00 0.00 Font::renderTextCache(TextCache*)
18.75 0.12 0.03 166 0.18 0.18 ImageIO::flipPixelsVert(unsigned char*, unsigned int const&, unsigned int const&)
6.25 0.13 0.01 675 0.01 0.01 MetaDataList::appendToXML(pugi::xml_node, bool, boost::filesystem::path const&) const
6.25 0.14 0.01 246 0.04 0.04 nsvg__startElement(void*, char const*, char const**)
@spikegrobstein
spikegrobstein / es_report2.txt
Created January 3, 2015 18:26
EmulationStation gprof data with 60 seconds idle, then navigating the emulators, listing ROMs, then quitting.
This file has been truncated, but you can view the full file.
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
44.83 0.13 0.13 372 0.35 0.38 nsvgRasterize
13.79 0.17 0.04 10753 0.00 0.00 Font::renderTextCache(TextCache*)
6.90 0.19 0.02 373 0.05 0.05 ImageIO::flipPixelsVert(unsigned char*, unsigned int const&, unsigned int const&)
3.45 0.20 0.01 17825 0.00 0.00 nsvg__getNextPathItem(char const*, char*)
3.45 0.21 0.01 11062 0.00 0.00 nsvg__flattenCubicBez(NSVGrasterizer*, float, float, float, float, float, float, float, float, float, int)
$ ping -c 25 google.com
PING google.com (74.125.239.99) 56(84) bytes of data.
64 bytes from nuq05s01-in-f3.1e100.net (74.125.239.99): icmp_seq=1 ttl=55 time=2256 ms
64 bytes from nuq05s01-in-f3.1e100.net (74.125.239.99): icmp_seq=2 ttl=55 time=1249 ms
64 bytes from nuq05s01-in-f3.1e100.net (74.125.239.99): icmp_seq=3 ttl=55 time=251 ms
64 bytes from nuq05s01-in-f3.1e100.net (74.125.239.99): icmp_seq=4 ttl=55 time=20548 ms
64 bytes from nuq05s01-in-f3.1e100.net (74.125.239.99): icmp_seq=5 ttl=55 time=19548 ms
64 bytes from nuq05s01-in-f3.1e100.net (74.125.239.99): icmp_seq=6 ttl=55 time=18540 ms
64 bytes from nuq05s01-in-f3.1e100.net (74.125.239.99): icmp_seq=7 ttl=55 time=17571 ms
64 bytes from nuq05s01-in-f3.1e100.net (74.125.239.99): icmp_seq=8 ttl=55 time=16565 ms
@spikegrobstein
spikegrobstein / get_version.sh
Created November 2, 2010 19:16
Prints the version of a .app or .bundle in OSX
#! /bin/bash
##
# returns the version of the OSX application that's passed to the script
# can determine if you're passing a bundle or an application (.bundle | .app | .component)
# and figure out the proper info
#
# written by Spike Grobstein
# spike.grobstein@wmg.com
# 2010/11/02
@spikegrobstein
spikegrobstein / random_pw
Created November 2, 2010 23:23
random password generator for OSX
#! /bin/bash
##
# spit out random password. default length of 32 characters
# usage:
# ./random_pw <pw_length>
##
COUNT=$1
DEFAULT_COUNT=32
@spikegrobstein
spikegrobstein / throughput.rb
Created November 9, 2010 01:11
shows current throughput (per second) on the selected interface
# usage:
# netstat -I bond0 -w 1 -b | ruby throughput.rb
# shows throughput on selected interface (OSX only)
def parse_line(line)
column_titles = [ :packets_in, :errs_in, :bytes_in, :packets_out, :errs_out, :bytes_out, :colls ]
columns = line.split(/\s+/)
columns.shift
columns = columns.collect { |c| c.to_i }