Skip to content

Instantly share code, notes, and snippets.

View aespinosa's full-sized avatar

Allan Espinosa aespinosa

View GitHub Profile
@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 / 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 / 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
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: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:
#!/usr/bin/env nix-shell
#!nix-shell -i bash
jupyter --version
@aespinosa
aespinosa / haskell.nix
Created March 17, 2016 16:29
haskell Env
haskellEnv = haskellPackages.ghcWithPackages (p: with p; [
hakyll
])
/*! normalize.css v3.0.1 | MIT License | git.io/normalize */
// * 1. Set default font family to sans-serif.
// * 2. Prevent iOS text size adjust after orientation change, without disabling user zoom.
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
@aespinosa
aespinosa / gist:7d0d6726ccfb31bbba4f
Created March 25, 2016 20:25
RSA .pem public key to jwk
ruby -r'json/jwt' -e 'puts OpenSSL::PKey::RSA.new(STDIN.read).to_jwk.to_json'
@aespinosa
aespinosa / job.groovy
Last active September 16, 2024 18:27
create a jenkins job in the script console
import jenkins.model.Jenkins;
import hudson.model.FreeStyleProject;
import hudson.tasks.Shell;
job = Jenkins.instance.createProject(FreeStyleProject, 'job-name')
job.buildersList.add(new Shell('echo hello world'))
job.save()