Skip to content

Instantly share code, notes, and snippets.

View amontalban's full-sized avatar

Andres Montalban amontalban

View GitHub Profile
@amontalban
amontalban / Dockerfile
Created February 13, 2017 13:55
RVM install issue on Debian Jessie
FROM debian:jessie
RUN apt-get update \
&& apt-get install -y bash curl patch bzip2 gawk libreadline6-dev zlib1g \
zlib1g-dev libssl-dev libc6-dev libyaml-dev libsqlite3-dev sqlite3 autoconf \
libgmp-dev libgdbm-dev libncurses5-dev automake make libtool bison \
pkg-config libffi-dev openssl
RUN \curl -L https://get.rvm.io | bash -s stable --autolibs=read-fail
Successfully installed bundler-1.14.3
Parsing documentation for bundler-1.14.3
Installing ri documentation for bundler-1.14.3
Done installing documentation for bundler after 4 seconds
1 gem installed
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Fetching https://github.com/devopxteam/kitchen-salt.git
Fetching https://github.com/devopxteam/kitchen-sync.git
INFO global: Vagrant version: 1.9.1
INFO global: Ruby version: 2.2.5
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_OLD_ENV_IRBRC="/Users/andres/.rvm/rubies/ruby-2.2.5/.irbrc"
INFO global: VAGRANT_OLD_ENV_MY_RUBY_HOME="/Users/andres/.rvm/rubies/ruby-2.2.5"
INFO global: VAGRANT_OLD_ENV_WORKON_HOME="/Users/andres/.virtualenvs"
INFO global: VAGRANT_OLD_ENV__system_arch="x86_64"
INFO global: VAGRANT_OLD_ENV_rvm_version="1.27.0 (latest)"
INFO global: VAGRANT_OLD_ENV_SSH_AUTH_SOCK="/private/tmp/com.apple.launchd.01bvwy7CqK/Listeners"
INFO global: VAGRANT_OLD_ENV_XPC_FLAGS="0x0"
@amontalban
amontalban / patch-xs-APR-aprext-Makefile.PL
Created December 8, 2016 16:51
mod_perl2 patch for FreeBSD
--- xs/APR/aprext/Makefile.PL.orig 2016-12-08 16:49:41.385132000 +0000
+++ xs/APR/aprext/Makefile.PL 2016-12-08 16:49:54.270002000 +0000
@@ -22,8 +22,6 @@
push @obj, q{modperl_dummy.o};
my @skip = qw(dynamic test);
-push @skip, q{static}
- unless (Apache2::Build::BUILD_APREXT);
my %args = (NAME => 'lib' . $build->{MP_APR_LIB},
@amontalban
amontalban / patch-Build.PL
Created November 23, 2016 18:25
GD patch to allow copyRotated()
--- Build.PL.orig 2016-11-23 15:18:04.000000000 -0300
+++ Build.PL 2016-11-23 15:18:41.000000000 -0300
@@ -28,40 +28,6 @@
@LIBPATH = (@LIBPATH,@libs64);
}
-#############################################################################################
-# Build options passed in to script to support reproducible builds via Makefiles
-#############################################################################################
-my $result = GetOptions("options=s" => \$options,
@amontalban
amontalban / checkiftablexists
Last active August 11, 2016 21:44 — forked from SpekkoRice/checkiftablexists
BASH: Check if MySQL Table exists
#!/bin/bash
checkIfMySQLTableExists() {
table=$1;
DB=$2;
if [ $(mysql -N -s -u root -p -e \
"select count(*) from information_schema.tables where \
table_schema='${DB}' and table_name='${table}';") -eq 1 ]; then
echo "Table ${table} exists! ...";
else
@amontalban
amontalban / dumper.pl
Last active April 25, 2017 17:22 — forked from erincerys/dumper.pl
MySQLdump filter -- Removes or replaces the DEFINER clauses from a dump
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long qw(:config no_ignore_case );
my $replace = undef;
my $delete = undef;
my $help = 0;
GetOptions (
@amontalban
amontalban / attach-elastic-network-interface.sh
Last active September 7, 2020 04:32
Attach an ENI (Elastic Network Interface) to an instance
#!/usr/bin/env bash
# This script assigns Elastic Network Interface (ENI) passed as argument to current instance.
# The goal of this script is to attach an ENI to a single instance running in an ASG for example.
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin
PROG_NAME=$(basename $0)
AWSCLI=$(which aws)
JQ=$(which jq)
@amontalban
amontalban / basebox-vagrantfile
Created June 23, 2016 20:54
Basebox Vagrantfile
# The contents below were provided by the Packer Vagrant post-processor
Vagrant.configure("2") do |config|
config.vm.base_mac = "080027AAA818"
end
# The contents below (if any) are custom contents provided by the
# Packer template during image build.
@amontalban
amontalban / vagrantup
Created June 23, 2016 20:50
vagrant-winnfsd
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'OBSCURED/freebsd-10.1-amd64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...