Skip to content

Instantly share code, notes, and snippets.

View jespada's full-sized avatar

jespada jespada

View GitHub Profile
#!/bin/sh
# Cleanup docker files: untagged containers and images.
#
# Use `docker-cleanup -n` for a dry run to see what would be deleted.
untagged_containers() {
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1.
docker ps -a | awk '$2 ~ "[0-9a-f]{12}" {print $'$1'}'
}
@jespada
jespada / chef-dk
Created April 24, 2014 15:02
chef-dk pak
➜ ~ ls -l /usr/bin/ | grep chefdk
lrwxrwxrwx 1 root root 21 apr 16 13:31 berks -> /opt/chefdk/bin/berks
lrwxrwxrwx 1 root root 20 apr 16 13:31 chef -> /opt/chefdk/bin/chef
lrwxrwxrwx 1 root root 26 apr 16 13:31 chef-apply -> /opt/chefdk/bin/chef-apply
lrwxrwxrwx 1 root root 27 apr 16 13:31 chef-client -> /opt/chefdk/bin/chef-client
lrwxrwxrwx 1 root root 26 apr 16 13:31 chef-shell -> /opt/chefdk/bin/chef-shell
lrwxrwxrwx 1 root root 25 apr 16 13:31 chef-solo -> /opt/chefdk/bin/chef-solo
lrwxrwxrwx 1 root root 25 apr 16 13:31 chef-zero -> /opt/chefdk/bin/chef-zero
lrwxrwxrwx 1 root root 23 apr 16 13:31 fauxhai -> /opt/chefdk/bin/fauxhai
lrwxrwxrwx 1 root root 26 apr 16 13:31 foodcritic -> /opt/chefdk/bin/foodcritic
@jespada
jespada / chef-dk
Created April 24, 2014 15:02
chef-dk pak
➜ ~ ls -l /usr/bin/ | grep chefdk
lrwxrwxrwx 1 root root 21 apr 16 13:31 berks -> /opt/chefdk/bin/berks
lrwxrwxrwx 1 root root 20 apr 16 13:31 chef -> /opt/chefdk/bin/chef
lrwxrwxrwx 1 root root 26 apr 16 13:31 chef-apply -> /opt/chefdk/bin/chef-apply
lrwxrwxrwx 1 root root 27 apr 16 13:31 chef-client -> /opt/chefdk/bin/chef-client
lrwxrwxrwx 1 root root 26 apr 16 13:31 chef-shell -> /opt/chefdk/bin/chef-shell
lrwxrwxrwx 1 root root 25 apr 16 13:31 chef-solo -> /opt/chefdk/bin/chef-solo
lrwxrwxrwx 1 root root 25 apr 16 13:31 chef-zero -> /opt/chefdk/bin/chef-zero
lrwxrwxrwx 1 root root 23 apr 16 13:31 fauxhai -> /opt/chefdk/bin/fauxhai
lrwxrwxrwx 1 root root 26 apr 16 13:31 foodcritic -> /opt/chefdk/bin/foodcritic
@jespada
jespada / .gitconfig
Created April 11, 2014 12:09
git global config
[user]
email = espada.jorge@gmail.com
name = Jorge Espada
[push]
default = current
[color]
ui = auto
branch = auto
diff = auto
interactive = auto
@jespada
jespada / view1.js
Created March 25, 2014 13:36
view.js double click
var self = this;
this.clickFocusable = true;
this.el.dblclick(function() {
if (self.clickFocusable) {
self.focus();
}
});
};
types.View = View;
@jespada
jespada / git.config
Created February 25, 2014 06:59
git nice log
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit"
@jespada
jespada / mate.py
Created December 21, 2013 18:22
test robot
import rg
class Robot:
def act(self, game):
# if we're in the center, stay put
if self.location == rg.CENTER_POINT:
return ['guard']
# if there are enemies around, attack them
for loc, bot in game.robots.iteritems():
@jespada
jespada / xmonad.hs
Created August 6, 2013 13:21
my xmonad conf
--
-- xmonad example config file.
-- https://github.com/ckoch786/Xmonad
-- A template showing all available configuration hooks,
-- and how to override the defaults in your own xmonad.hs conf file.
--
-- Normally, you'd only override those defaults you care about.
--
@jespada
jespada / haproxy.cfg
Created March 9, 2013 21:03
haproxy(1.5) + ssl + websockets (see comments on how to create a .pem file)
defaults
log global
mode http
option httplog
option dontlognull
retries 3
option redispatch
timeout connect 5s
timeout client 50s
timeout server 50s
@jespada
jespada / sensu-riemann
Created December 17, 2012 14:02
sensu + riemann
* Sensu
- As a nagios replacement basically, plus the extra goodies tha sensu has itself
(mutators, events filters , handlers, API, etc).
* Riemann
- When state tracking is needed, cause of the powerful stream processing language,
I'm planning to aggregate events from client agents running on riak nodes,
erlang queue size grow, cassandra, others, to track trends and report
on events, the idea is to report posible problems before they became critical.