Skip to content

Instantly share code, notes, and snippets.

iex(22)> exif
[JPEGInterchangeFormatLength: [7164], JPEGInterchangeFormat: [862],
ResolutionUnit: [2], YResolution: [{72, 1}], XResolution: [{72, 1}],
Compression: [6], Software: ['Adobe Photoshop CS4 Macintosh'],
ResolutionUnit: [2], YResolution: [{2400000, 10000}],
XResolution: [{2400000, 10000}], Orientation: [1], Model: ['NIKON D80'],
Make: ['NIKON CORPORATION']]
iex(23)> JSON.encode(exif)
** (ArgumentError) argument error
:erlang.apply(72, :to_keywords, [])
iex(1)> rec = :erl_img.load("/tmp/img.01052272347D8C5DA78E655299E8176")
{:ok,
{:erl_image, :image_gif, :undefined,
"/tmp/img.01052272347D8C5DA78E655299E8176", :undefined, :undefined,
:undefined, :undefined, [], :palette8, 400, 212, 8, 3, 1,
[ApplicationIdentifier: 'XMP Data', ApplicationAuthenticationCode: 'XMP',
ApplicationData: <<63, 120, 112, 97, 99, 107, 101, 116, 32, 98, 101, 103, 105, 110, 61, 34, 239, 187, 191, 34, 32, 105, 100, 61, 34, 87, 53, 77, 48, 77, 112, 67, 101, 104, 105, 72, 122, 114, 101, 83, 122, 78, 84, 99, 122, 107, 99, 57, 100, 34, ...>>,
ApplicationIdentifier: 'NETSCAPE', ApplicationAuthenticationCode: '2.0',
ApplicationData: <<1, 0, 0>>, Background: 255, AspectRatio: 0, Sort: 0],
:left_to_right,
@eraserewind
eraserewind / free-mobile-sms.zsh
Last active August 29, 2015 14:02
Send SMS to yourself using Free Mobile's SMS notifications API.
FREE_MOBILE_SMS_USER="..."
FREE_MOBILE_SMS_PASS="..."
function self-sms {
setopt extendedglob
encoded="${${(j: :)@}//(#b)(?)/%$[[##16]##${match[1]}]}"
curl -q https://smsapi.free-mobile.fr/sendmsg\?user\=${FREE_MOBILE_SMS_USER}\&pass\=${FREE_MOBILE_SMS_PASS}\&msg\=${encoded}
}
# self-sms hello my friend how are you\?
@eraserewind
eraserewind / programme-tv.css
Last active August 29, 2015 14:04
programme-tv.net css fix.
#videoPush { display:none }
#newsPush { display:none }
#sidebar { display:none }
#header { display:none }
#col_left { width: 100% }
.channel .programme .readmore { display:none }
.block.sondages { display:none }
.baseline, .footer-layout, .sf-extensionfactory-link { display:none }
begin
wait_for_miracle do |miracle|
return miracle.proof_that_god_exists
end
rescue Timeout::Error => e
return e.proof_that_god_exists
end
### Keybase proof
I hereby claim:
* I am eraserewind on github.
* I am jbracco (https://keybase.io/jbracco) on keybase.
* I have a public key whose fingerprint is 8891 E1E7 26CC 8030 4B84 885A E89A 181D 331D 2B12
To claim this, I am signing this object:
#!/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