Skip to content

Instantly share code, notes, and snippets.

Fernando Aleman fernandoaleman

  • Dallas, TX
Block or report user

Report or block fernandoaleman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View rabbitmq-cluster.sh
#!/bin/bash
set -e
function getHostname()
{
local HOST=''
while test -z "$HOST"
do
read -p "$1 : " HOST
@fernandoaleman
fernandoaleman / node-0.10.48.rb
Last active Sep 11, 2018
Install Node 0.10.48 via Homebrew
View node-0.10.48.rb
class Node01048 < Formula
desc "Platform built on V8 to build network applications"
homepage "https://nodejs.org/"
url "https://nodejs.org/dist/v0.10.48/node-v0.10.48.tar.xz"
sha256 "365a93d9acc076a0d93f087d269f376abeebccad599a9dab72f2f6ed96c8ae6e"
revision 2
head "https://github.com/nodejs/node.git", :branch => "v0.10-staging"
bottle do
sha256 "0053425c1c78f3afc8c7b311d7808d4e0f9ff955ec5edcef972529eabdf05856" => :sierra
@fernandoaleman
fernandoaleman / install-mongodb-ubuntu1604.md
Last active Nov 23, 2018
Install MongoDB on Ubuntu 16.06
View install-mongodb-ubuntu1604.md

Install MongoDB on Ubuntu 16.04

Import MongoDB GPG Key

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5

Add MongoDB apt repository

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
@fernandoaleman
fernandoaleman / homebrew-elasticsearch-1.0.2.rb
Created Jul 21, 2017
Homebrew Elasticsearch 1.0.2 Formula
View homebrew-elasticsearch-1.0.2.rb
require 'formula'
class Elasticsearch < Formula
homepage 'http://www.elasticsearch.org'
url 'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.2.tar.gz'
sha256 '2fc2cd05e5f301ba972c9bf90232b70592568990f526f2634b3a768c4615ad70'
head do
url 'https://github.com/elasticsearch/elasticsearch.git'
depends_on 'maven'
@fernandoaleman
fernandoaleman / clone-git-repo.txt
Last active Feb 14, 2020
How to clone git repo with all branches and tags
View clone-git-repo.txt
# Clone repo
git clone --mirror git@github.com/fernandoaleman/app.git app/.git
# Change into app directory
cd app
# Update git config
git config --unset core.bare
# Checkout master branch
View auto-install-ruby-with-rbenv.zsh
# This snippet checks your current directory for a .ruby-version file
# and if it exists, it then checks to see if that version of ruby is
# installed. If not, it will ask you if you want to install it.
#
# Add this snippet to $HOME/.zshrc
# In zsh, the chpwd will run a command every time you change directories.
function chpwd {
# Check if a .ruby-version file exists
if [[ -f "$PWD/.ruby-version" ]]; then
@fernandoaleman
fernandoaleman / redid-cannot-allocate-memory.txt
Created Dec 7, 2016
redis bgsave failed because fork Cannot allocate memory
View redid-cannot-allocate-memory.txt
Modify /etc/sysctl.conf and add
vm.overcommit_memory=1
Then restart sysctl by:
$ sudo sysctl -p /etc/sysctl.conf
View sed-commands.sh
# Command to replace php memory limit in php.ini with env var
sed -i "s|;*memory_limit =.*|memory_limit = ${PHP_MEMORY_LIMIT}|i" /etc/php5/php.ini
@fernandoaleman
fernandoaleman / INSTALL.txt
Last active Dec 24, 2019
Shell script to sync remote branches from upstream and push them up to forked origin
View INSTALL.txt
1. Copy 'git-sync-fork' script code from gist
2. Create a file called 'git-sync-fork' in any 'bin' directory in your $PATH
3. Paste script into this new file 'git-sync-fork' and save
4. Make the file executable `chmod +x git-sync-fork`
5. Run the script inside your locally forked git repo
Example:
git-sync-fork upstream origin
View dnsmasq.md

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.

Requirements

Install

You can’t perform that action at this time.