Skip to content

Instantly share code, notes, and snippets.

View rafaelmagu's full-sized avatar

Rafael Fonseca rafaelmagu

  • @bitsignalnz
  • New Zealand
View GitHub Profile
@brikis98
brikis98 / LinkedInClient.coffee
Created June 12, 2011 07:09
LinkedIn API Client in CoffeeScript
OAuth = require('oauth').OAuth
_ = require 'underscore'
class LinkedInClient
@baseUrl: 'https://api.linkedin.com'
@requestTokenUrl: "#{@baseUrl}/uas/oauth/requestToken"
@accessTokenUrl: "#{@baseUrl}/uas/oauth/accessToken"
@authorizeUrl: "#{@baseUrl}/uas/oauth/authorize"
@profileFields: ['id', 'headline', 'first-name', 'last-name', 'public-profile-url', 'picture-url', 'educations', 'positions', 'email-address']
@grahamc
grahamc / Makefile
Last active September 30, 2015 23:19
AWS Instance Age Report (run `make`)
fresh: clean chart
chart: instance_ages
@echo "AWS EC2 Instance Age Report"
@echo "---------------------------"
@echo "Days\\tCount"
@cat instance_ages | ./chart.py -n
clean:
rm -f instance*
# Postfix stuff
QUEUEID (?:[A-F0-9]{11}|NOQUEUE)
EMAILADDRESSPART [a-zA-Z0-9_.+-=:]+
EMAILADDRESS %{EMAILADDRESSPART:local}@%{EMAILADDRESSPART:remote}
RELAY (?:%{HOSTNAME:relayhost}(?:\[%{IP:relayip}\](?::[0-9]+(.[0-9]+)?)?)?)
#RELAY (?:%{HOSTNAME:relayhost}(?:\[%{IP:relayip}\](?:%{POSREAL:relayport})))
POSREAL [0-9]+(.[0-9]+)?
#DELAYS %{POSREAL:a}/%{POSREAL:b}/%{POSREAL:c}/%{POSREAL:d}
DELAYS (%{POSREAL}[/]*)+
DSN %{NONNEGINT}.%{NONNEGINT}.%{NONNEGINT}
@nstielau
nstielau / client.sh
Created September 27, 2012 23:22
Sensu Push Example
echo '{
"handlers": ["debug"],
"name": "push_woot_test",
"output": "woot!",
"status": 0
}' | nc -w1 127.0.0.1 3030
@jaredmichaelwilliams
jaredmichaelwilliams / 0.Setup
Last active August 28, 2018 01:28
Setting up a Yubikey for use with SSH
Preparation
Purchase YubiKey NEO
Install X Code and Command Line Tools, if installing anything from source.
X Code can be installed from the App Store.
Command Line Tools are installed from X Code: X Code -> Preferences -> Downloads -> Components -> Command Line Tools.
Install YubiKey reader library libyubikey (aka yubico-c)
Using homebrew:
brew install libyubikey
brew install ykpers
@garthk
garthk / profile
Created June 21, 2015 23:51
boot2docker 1.7.0 cert fix
wait4eth1() {
CNT=0
until ip a show eth1 | grep -q UP
do
[ $((CNT++)) -gt 60 ] && break || sleep 1
done
sleep 1
}
wait4eth1
@nzakas
nzakas / alias.md
Created September 11, 2015 17:59
Some simple scripts I use to manage open source branches

Usage:

To create a new branch that is up-to-date with the remote master:

$ ws 123

Creates the branch issue123

@danriti
danriti / hipchat-v2.sh
Last active July 19, 2021 10:49
HipChat API v2 - Send a message to a room using cURL
#!/bin/bash
# Set the ROOM_ID & AUTH_TOKEN variables below.
# Further instructions at https://www.hipchat.com/docs/apiv2/auth
ROOM_ID=XXX
AUTH_TOKEN=XXX
MESSAGE="Hello world!"
curl -H "Content-Type: application/json" \
@walm
walm / image_filters.rb
Created October 3, 2012 05:03 — forked from tonycoco/image_filters.rb
Useful image filters (Instagram/Hipster/Cool) for CarrierWave using MiniMagick (ImageMagick)
module CarrierWave
module MiniMagick
def toaster_filter
manipulate! do |img|
img.modulate '150,80,100'
img.gamma 1.1
img.contrast
img.contrast
img.contrast
img.contrast
@rjamestaylor
rjamestaylor / docker-run-away.txt
Last active September 2, 2021 22:37
Replacing Docker Desktop on my MacBook in under an hour
When Darth Docker sent me the email changing the terms of use retroactively (!) I decided to start looking for alternatives.
About 30 minutes later I found Lima (and nerdctl).
Less than an hour later, I no longer use Docker Desktop.
Not even for retrieving container images in corportate repos that require credentials.
I just replaced Docker on my MacBook with Lima.
$ brew install lima
Then set up a default execution environment for nerdctl: