Skip to content

Instantly share code, notes, and snippets.

View aespinosa's full-sized avatar

Allan Espinosa aespinosa

View GitHub Profile
@aespinosa
aespinosa / gist:00d81f95d1a9e060c51d
Created January 24, 2016 02:43
kitchen diagnose (provisioner part)
---
provisioner:
attributes: {}
chef_client_path: "/bin/chef-client"
chef_omnibus_install_options:
chef_omnibus_url: https://www.chef.io/chef/install.sh
chef_zero_host:
chef_zero_port: 8889
client_rb: {}
clients_path:
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.5.1
- RUBY VERSION: 2.2.3 (2015-08-18 patchlevel 172) [x86_64-darwin13]
- INSTALLATION DIRECTORY: /nix/store/98bvsipdpmd23hnxpbq002544p9ssdrj-ruby-2.2.3-p0/lib/ruby/gems/2.2.0
- RUBY EXECUTABLE: /nix/store/98bvsipdpmd23hnxpbq002544p9ssdrj-ruby-2.2.3-p0/bin/ruby
- EXECUTABLE DIRECTORY: /nix/store/98bvsipdpmd23hnxpbq002544p9ssdrj-ruby-2.2.3-p0/bin
- SPEC CACHE DIRECTORY: /Users/myuser/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /nix/store/98bvsipdpmd23hnxpbq002544p9ssdrj-ruby-2.2.3-p0/etc
- RUBYGEMS PLATFORMS:
- ruby
@aespinosa
aespinosa / gist:7923649d922467110ee4
Created December 18, 2015 05:01
nix-shell -p screen
nix-shell -p screen
these derivations will be built:
/nix/store/imllr5vbrvbjb30sm9kvy1l4ii0fjvf8-screen-4.3.1.drv
building path(s) ‘/nix/store/jgdd2x4l5rhhp51r86ssi1cramm239s0-screen-4.3.1’
unpacking sources
unpacking source archive /nix/store/h2yicr397vakb4ijs74vngkvmm1gk56f-screen-4.3.1.tar.gz
source root is screen-4.3.1
patching sources
applying patch /nix/store/sycysq7bdffvz64g7d2452hqjny5c7ia-CVE-2015-6806.patch
patching file ansi.c
@aespinosa
aespinosa / etcd.sh
Created October 12, 2015 23:20
Launch an etcdcluster manually one by one
# IP address of the local VM's network
docker run --net=host -d --name etcd00 etcd --name etcd00 \
--listen-client-urls http://0.0.0.0:4001 \
--advertise-client-urls http://172.16.132.237:4001 \
--listen-peer-urls http://0.0.0.0:7001
etcdctl member update xxxxx http://172.16.132.237:7001
etcdctl member add etcd01 http://172.16.132.237:7101
docker run -d --net=host --name etcd01 etcd --name etcd01 \
@aespinosa
aespinosa / SparkTest.java
Created September 16, 2015 12:49
Messing with Apache Spark
public final class SparkTest {
private JavaSparkContext _spark;
private int slices;
public static void main(String[] args) throws Exception {
int slices = (args.length == 1) ? Integer.parseInt(args[0]) : 2;
SparkConf conf = new SparkConf().setAppName("SparkPi");
JavaSparkContext spark = new JavaSparkContext(conf)
@aespinosa
aespinosa / clone.rb
Created September 1, 2015 05:49
Download Bundle from vimrc
#!/usr/bin/env ruby -ns
bundle = $F[2]
url, basename = if bundle =~ /^[A-Za-z0-9-]+\/[A-Za-z0-9._-]+$/
["https://github.com/#{bundle}/archive/master.tar.gz", File.basename(bundle)]
elsif bundle =~ /^[A-Za-z0-9._-]+$/
["https://github.com/vim-scripts/#{bundle}/archive/master.tar.gz", bundle]
end
system "mkdir -p #{basename}"
@aespinosa
aespinosa / gist:5ba3c9276a03b5fdf426
Created August 7, 2015 02:13
Download the docker.vim syntax files to your pathogen bundle dirs
curl -L https://github.com/docker/docker/archive/master.tar.gz | tar xvz --strip-components 4 -C docker.vim docker-master/contrib/syntax/vim
@aespinosa
aespinosa / freebsd.patch
Last active August 29, 2015 14:15
Difference of ports installed between chef/bento and digitalocean's FreeBSD 10.0
--- vagrant.lst 2015-02-17 23:43:54.000000000 +0900
+++ digitalocean.lst 2015-02-17 23:43:47.000000000 +0900
@@ -1,8 +1,37 @@
+arping
+avahi
+avahi
ca_root_nss
-compat6x
curl
+dbus
@aespinosa
aespinosa / gist:6e8252691b26ce6f2e9e
Created November 1, 2014 14:05
nix-env macvim sha256sum problem
nix-env -i macvim
installing `macvim-7.4.479'
these derivations will be built:
/nix/store/0x0v33h6823klxdqm3hhjm6r9srxjj4c-luajit-2.0.3.drv
/nix/store/0zdy26p9fxfbmvav0j15a3ffy9d2iwmc-macvim-7.4.479.drv
/nix/store/1vrkqbqrkkmdqs21ydi1l8maws90y561-ruby-1.9.3-p547.drv
/nix/store/2633v4gbdinqxfhlncjfb9gl5dj8kbqz-libarchive-3.1.2.drv
/nix/store/27sdqrznrmw15n8b89p0prkaix4szpgs-stdenv.drv
/nix/store/7mp25ifirn2zgcvjddn0p4j0qla6hlcp-cmake-2.8.12.2.tar.gz.drv
/nix/store/8masdmqnkddafsrm1vcx54x20bnrbm7r-macvim-f9c084b97fa9d5cad2448dfd3eff3d9b7f0fac59-src.drv
@aespinosa
aespinosa / init.groovy
Created October 21, 2014 13:46
all-in-one Jenkins configuration
import jenkins.model.*;
pm = Jenkins.instance.pluginManager
pm.doCheckUpdatesServer()
plugins = pm.plugins
# FIXME idempotency needed here
plugins.each {
if (it.isEnabled()) {
it.disable()
}