Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/ruby
# Send an SMS using OVH SOAPI. Requires an OVH account.
#
# Best used when installed somewhere in your PATH.
#
# TODO: Read from STDIN. Send multiple SMS if the input > 160 chars.
#
# README: Create ~/.sms.yml like this:
# credentials:
# user: "xxx-OVH"
[~]$ npm install formidable -g npm http GET https://registry.npmjs.org/formidable
npm http 304 https://registry.npmjs.org/formidable
npm ERR! Error: ENOENT, open '/usr/local/lib/node_modules/formidable/package.json'
npm ERR! You may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR!
npm ERR! System Darwin 11.2.0
sara# cat /usr/share/calendar/calendar.lotr
/*
* Lord Of The Rings
*
* $FreeBSD: release/9.0.0/usr.bin/calendar/calendars/calendar.lotr 120919 2003-10-09 00:31:48Z grog $
*/
#ifndef _calendar_lotr_
#define _calendar_lotr_
@eraserewind
eraserewind / munin_pkgng.sh
Last active December 14, 2015 20:38
Small Munin plugin to check pkgng.
#!/bin/sh
case $1 in
config)
cat <<'EOM'
graph_title pkgng
graph_vlabel packages
graph_category system
installed.label installed
audit.label with security audit
This file has been truncated, but you can view the full file.
** Invoke default (first_time)
** Invoke spec (first_time)
** Invoke spec18 (first_time)
** Invoke build (first_time)
** Invoke build:build (first_time)
** Invoke build:llvm (first_time)
** Execute build:llvm
** Invoke vm/vm (first_time)
** Invoke vm/gen/revision.h (first_time)
** Execute vm/gen/revision.h
/tmp/ruby-build.20130506113644.13305 ~
Cloning into 'rubinius-2.0.0-dev'...
/tmp/ruby-build.20130506113644.13305/rubinius-2.0.0-dev /tmp/ruby-build.20130506113644.13305 ~
Checking gcc: found
Checking g++: found
Checking bison: found
Configuring LLVM...
Checking for existing LLVM library tree: not found.
Checking for 'llvm-config': not found
Checking for prebuilt LLVM package...
# acts like screen
unbind C-b
set -g prefix C-a
# good colors
set -g default-terminal "screen-256color"
# can haz history
set -g history-limit 10000
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
npm http GET https://registry.npmjs.org/mapnik-vector-tile
npm http 304 https://registry.npmjs.org/mapnik-vector-tile
> mapnik-vector-tile@0.0.4 install /Users/j/dev/tm2/node_modules/mapnik/node_modules/mapnik-vector-tile
> protoc -Iproto/ --cpp_out=./src/ ./proto/vector_tile.proto
> mapnik@1.0.0 install /Users/j/dev/tm2/node_modules/mapnik
> node-gyp rebuild
@eraserewind
eraserewind / bootstrap_horizontal_form.rb
Created July 28, 2013 19:08
bootstrap 3 horizontal form rails builder
class BootstrapHorizontalForm < ActionView::Helpers::FormBuilder
def text_field(method, options={})
width = options[:width] || 10
t = @template
t.content_tag(:div, :class => "form-group#{' has-error' unless @object.errors[method].blank?}") {
t.concat(t.label(@object_name, method, class: 'col-lg-2 control-label'))
t.concat(t.content_tag(:div, class: "col-lg-#{width}") {
t.concat(t.text_field(@object_name, method, options.merge(class: 'form-control')))
if @object.errors[method].present?
irb(main):023:0> Device.find_by_index('ident', '42942424242')
Zlib::DataError: incorrect header check
from /Users/j/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/http/response.rb:357:in `finish'
from /Users/j/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/http/response.rb:357:in `finish'
from /Users/j/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/http/response.rb:262:in `ensure in inflater'
from /Users/j/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/http/response.rb:262:in `inflater'
from /Users/j/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/http/response.rb:274:in `read_body_0'
from /Users/j/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/http/response.rb:201:in `read_body'
from /Users/j/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/http/response.rb:226:in `body'
from /Users/j/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/riak-client-1.0.5/lib/riak/client/net_http_backend.rb:58:in `block (2 levels) in perform'