Skip to content

Instantly share code, notes, and snippets.

View aespinosa's full-sized avatar

Allan Espinosa aespinosa

View GitHub Profile
@aespinosa
aespinosa / install.sh
Last active April 3, 2016 20:50
Installing https://nixos.org/nix through a proxy like apt-cacher-ng
curl --silent http://nixos.org/nix/install | sed 's,https://nixos.org,http://proxy.dev:3142/nixos.org,' | bash
@aespinosa
aespinosa / docker.nix
Last active April 9, 2016 21:55
building a nix docker image
with import <nixpkgs> {};
let
niximage = dockerTools.buildImage {
name = "nix";
tag = "1.11.2";
contents = [ nix cacert bash ];
};
nixpkgs = import /nix/store/xxxxx-nixpkgs.drv;
@aespinosa
aespinosa / Error message
Created April 21, 2016 00:12
disabling ssl_verify_mode
Recipe: chef-server::default
* ruby_block[ensure node can resolve API FQDN] action run (skipped due to not_if)
* chef_ingredient[chef-server] action install
Recipe: <Dynamically Defined Resource>
* chef_gem[mixlib-install] action install (up to date)
* ruby_block[stop chef run] action nothing (skipped due to action :nothing)
* apt_package[chef-server] action install (up to date)
(up to date)
Recipe: chef-server::default
* file[/tmp/kitchen/cache/chef-server-core.firstrun] action create (up to date)
error: while evaluating the attribute ‘nativeBuildInputs’ of the derivation ‘haskell-environment’ at /home/user/Documents/website/default.nix:4:3:
while evaluating ‘ghcWithPackages’ at /home/user/nixpkgs/pkgs/development/haskell-modules/default.nix:60:27, called from /home/user/Documents/website/default.nix:6:6:
while evaluating ‘withPackages’ at /home/user/nixpkgs/pkgs/development/haskell-modules/default.nix:49:22, called from /home/user/nixpkgs/pkgs/development/haskell-modules/default.nix:60:39:
while evaluating ‘callPackage’ at /home/user/nixpkgs/pkgs/development/haskell-modules/default.nix:47:26, called from /home/user/nixpkgs/pkgs/development/haskell-modules/default.nix:49:32:
while evaluating ‘callPackageWithScope’ at /home/user/nixpkgs/pkgs/development/haskell-modules/default.nix:41:42, called from /home/user/nixpkgs/pkgs/development/haskell-modules/default.nix:47:32:
while evaluating ‘callPackageWith’ at /home/user/nixpkgs/lib/customisation.nix:93:35, called from /home/user/nixpkgs/pkgs/development/ha

Deepening DevOps with Math

DevOps is a young but fast evolving discipline. Like other young practices, the community may still be discovering itself. As more people learn from their experience or incorporate experiences from other backgrounds, DevOps continues to mature.

DevOpsDays is one of those events where the DevOps community gathers together and share experiences. This year, there's a lot of topics where people start stepping back and build a model around the practice of DevOps. There were a lot of DevOps talks that started using math to describe the practice this year.

@aespinosa
aespinosa / default.nix
Created October 30, 2016 13:18
ghc -O -static -threaded -optl-static app.hs
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "cpu-app";
enableSharedExecutables = false;
buildInputs = [
(haskellPackages.ghcWithPackages (p: [p.yesod ]))
];
}
@aespinosa
aespinosa / default.nix
Last active October 30, 2016 13:38
nix-store -q --tree /nix/store/c4xb0czlr9dy9j0nln9mxijylblr4vmj-cpu-app/bin/app
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "cpu-app";
enableSharedExecutables = false;
buildInputs = [
(haskellPackages.ghcWithPackages (p: [p.yesod ]))
];
@aespinosa
aespinosa / default.nix
Created October 31, 2016 15:24
NIX_CURRENT_LOAD=`pwd` NIX_REMOTE_SYSTEMS=`pwd`/remotes.conf NIX_BUILD_HOOK=$HOME/.nix-profile/libexec/nix/build-remote.pl nix-build --argstr system x86_64-linux
# To build on macOS
# NIX_CURRENT_LOAD=`pwd` NIX_REMOTE_SYSTEMS=`pwd`/remotes.conf \
# NIX_BUILD_HOOK=$HOME/.nix-profile/libexec/nix/build-remote.pl \
# nix-build --argstr system x86_64-linux
#
# remotes.conf
# vagrant@<ip> x86_64-linux $HOME/.vagrant.sh/insecure_private_key 1
{ system ? builtins.currentSystem }:
with import <nixpkgs> {
system = system;
@aespinosa
aespinosa / gist:4930a99ccb7362ebcdd940e24cd3f06b
Created January 17, 2017 04:12
image_science can't find references to libruby
irb> require 'image_science'
/tmp/ccLnaq6a.o: In function `raise_error':
Inline_ImageScience_20a6c1167e26493622aab915959b49d1.c:(.text+0xd): undefined reference to `rb_thread_current'
Inline_ImageScience_20a6c1167e26493622aab915959b49d1.c:(.text+0x18): undefined reference to `rb_thread_local_aref'
Inline_ImageScience_20a6c1167e26493622aab915959b49d1.c:(.text+0x2f): undefined reference to `rb_thread_current'
Inline_ImageScience_20a6c1167e26493622aab915959b49d1.c:(.text+0x3f): undefined reference to `rb_thread_local_aset'
Inline_ImageScience_20a6c1167e26493622aab915959b49d1.c:(.text+0x49): undefined reference to `rb_string_value_cstr'
Inline_ImageScience_20a6c1167e26493622aab915959b49d1.c:(.text+0x53): undefined reference to `rb_eRuntimeError'
Inline_ImageScience_20a6c1167e26493622aab915959b49d1.c:(.text+0x64): undefined reference to `rb_raise'
Inline_ImageScience_20a6c1167e26493622aab915959b49d1.c:(.text+0x6b): undefined reference to `rb_eRuntimeError'
@aespinosa
aespinosa / upstream_test.rb
Last active April 16, 2017 06:42
kubernetes resource autogeneration spike
require 'chef/resource'
require 'kramdown'
require 'minitest/autorun'
DOC = DATA.read
class SomeResource < Chef::Resource
property :base_properties
def self.use_version(version)
if version == '1.6.1'
load_kube_16