Skip to content

Instantly share code, notes, and snippets.

View siavashs's full-sized avatar
🔨
Building stuff...

Siavash Safi siavashs

🔨
Building stuff...
View GitHub Profile
@siavashs
siavashs / gist:798fa9619b91918d4524
Created May 4, 2015 13:51
mysqld_exporter sample output
# HELP http_request_duration_microseconds The HTTP request latencies in microseconds.
# TYPE http_request_duration_microseconds summary
http_request_duration_microseconds{handler="prometheus",quantile="0.5"} 9206.461
http_request_duration_microseconds{handler="prometheus",quantile="0.9"} 11817.503
http_request_duration_microseconds{handler="prometheus",quantile="0.99"} 12880.886
http_request_duration_microseconds_sum{handler="prometheus"} 6.201126414000001e+06
http_request_duration_microseconds_count{handler="prometheus"} 653
# HELP http_request_size_bytes The HTTP request sizes in bytes.
# TYPE http_request_size_bytes summary
http_request_size_bytes{handler="prometheus",quantile="0.5"} 299
@siavashs
siavashs / ip2location-c.spec
Created February 1, 2015 08:12
ip2location C library rpm SPEC
Name: ip2location-c
Version: 7.0.0
Release: 1%{?dist}
Summary: IP2Location C Library
Group: Development/Libraries
License: GPLv3+
URL: http://www.ip2location.com/c.aspx
Source0: http://www.ip2location.com/downloads/%{name}-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
@siavashs
siavashs / remote_syslog
Last active August 29, 2015 14:12
remote_syslog2 rc.d script for FreeBSD
#!/bin/sh
#
# PROVIDE: remote_syslog
#
. /etc/rc.subr
name="remote_syslog"
rcvar="${name}_enable"
@siavashs
siavashs / lyrics.rb
Created August 31, 2012 17:50
Ruby script to fetch lyrics from Lyric Wiki
# lyrics.rb: Ruby script to fetch lyrics from Lyric Wiki
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@siavashs
siavashs / gist:3146099
Created July 19, 2012 19:14
Open Ruby Gems Docs from Fish Shell (Mac OS X)
set gemdir (gem env gemdir)
function gemdoc
set -l doc $gemdir/doc/$argv*/rdoc/index.html
open $doc
end
complete -xc gemdoc -a "(ls $gemdir/doc/ | cut -d '-' -f 1)"