Skip to content

Instantly share code, notes, and snippets.

View edgarsandi's full-sized avatar
👋
Hi there

Edgar R. Sandi edgarsandi

👋
Hi there
View GitHub Profile
tree ansible-deploy/
config/
dev-aws.ansible.cfg
live-aws.ansible.cfg
group_vars/
dev
staging
live
host_vars/
@edgarsandi
edgarsandi / configure_docker0.sh
Created May 4, 2017 19:36
Change the IP subnet of Docker's docker0 interface
#!/bin/sh -e
#
# You can run this script directly from github as root like this:
# curl -sS https://gist.githubusercontent.com/fabiorphp/a94e0ea2558b3d10185d6d69d053c2b2/raw/configure_docker0.sh | sudo bash -s - 172.31.0.21/16
#
# * Make sure you replace "192.168.254.0/24" with the network that you want to use
#
# NOTE: This script is intended for Debian / Ubuntu only!
if [ $# -lt 1 ]; then

Quick install PHP 7.0:

1. Install depends PHP 7.0
$ brew install autoconf automake gmp homebrew/versions/bison27 gd freetype t1lib gettext zlib mcrypt
2. Configure PHP 7.0
$ git clone --depth=1 https://github.com/php/php-src.git

$ cd php-src

@edgarsandi
edgarsandi / gist:362f91433407a483d55cea91b3075291
Created March 6, 2017 14:30 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat

I recently got a new Macbook Pro and wanted to document how I setup my PHP environment. I like full control of how PHP is built and I usually build it from source. I do this because I often add custom extensions and modules not found in the common PHP OSX installers. If your looking for a easier method than building from source try https://php-osx.liip.ch/.

NOTE: This post assumes you are running a fresh install of MacOS Sierra 10.12.2 with System Integrity Protection disabled. If you don't know how to disable it just boot into recovery mode and open a terminal and type csrutil disable, or google search it :) This post also assumes you are using Zsh instead of Bash shell. If you are using Bash you can replace anytime you see ~/.zshrc with ~/.bashrc.

First lets get some of the prerequisites. Start by grabbing the command line tools neccessary:

xcode-select --install
@edgarsandi
edgarsandi / new_relic_alert.sh
Created September 5, 2016 21:59 — forked from lichti/new_relic_alert.sh
Script to enable or disable newrelic alerts
#!/bin/bash
if [ ! -x /usr/bin/curl ]; then
echo "Please install curl"
exit 1
fi
if [ ! -x /usr/bin/jq ]; then
echo "Please install jq"
exit 1
@edgarsandi
edgarsandi / slack_deploy_bot_template.py
Created August 21, 2016 01:16 — forked from achauve/slack_deploy_bot_template.py
Template of Slack bot for deployment
import logging
import os
import time
import traceback
# pip install slackclient
from slackclient import SlackClient
@edgarsandi
edgarsandi / ansible_conditionals_examples.yaml
Created August 10, 2016 22:17 — forked from marcusphi/ansible_conditionals_examples.yaml
Ansible 1.3 Conditional Execution -- Very complete example with comments -- I find the conditional expressions to be ridiculously hard to get right in Ansible. I don't have a good model of what's going on under the surface so I often get it wrong. What makes it even harder is that there has been at least three different variants over the course …
---
# This has been tested with ansible 1.3 with these commands:
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false"
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true"
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts"
# NB: The type of the variable is crucial!
- name: Ansible Conditionals Examples
hosts: $hosts
vars_files:
@edgarsandi
edgarsandi / multi-namespaces.php
Last active October 27, 2015 17:32
multi-namespaces
<?php
namespace Rua;
class Mae
{
public function darBronca()
{
return 'mae dando bronca na rua' . PHP_EOL;
}
@edgarsandi
edgarsandi / Oracle 11G - SQL Essencial
Last active August 29, 2015 14:16
Oracle SQL Essencial
Edgar R. Sandi
@edgarsandi
[email protected]
lk/edgar.r.sandi
fb/edgar.r.sandi
Oracle Essencial
24h
6 aulas