Skip to content

Instantly share code, notes, and snippets.

View amejiarosario's full-sized avatar
🎯
Think big, start small, learn fast!

Adrian Mejia amejiarosario

🎯
Think big, start small, learn fast!
View GitHub Profile
@amejiarosario
amejiarosario / vagrant.md
Created June 21, 2012 02:36
Vagrant - Virtual Development Enviroment

Vagrant

Virtualized development http://vagrantup.com/

Setup

 $ gem install vagrant
 $ mkdir vagrant-box && cd vagrant-box # (optional)
 $ vagrant box add {title} {url}
 $ vagrant init {title}
@amejiarosario
amejiarosario / rails_setup.sh
Created June 21, 2012 03:08
Ubuntu and Rails
# Getting Up To Date
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
#reboot your system $ sudo reboot
# Some required programs
sudo apt-get -y install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev ctags vim libreadline-dev libyaml-dev libcurl4-openssl-dev subversion
@amejiarosario
amejiarosario / rbenv.sh
Created June 21, 2012 04:17
rbenv setup
# Ruby Enviroment (rbenv)[https://github.com/sstephenson/rbenv] (installer) [https://github.com/fesplugas/rbenv-installer]
curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
## Install Ruby
rbenv install 1.9.3-p194
rbenv install 1.9.2-p320
rbenv global 1.9.2-p320
@amejiarosario
amejiarosario / dotfiles_installer.sh
Last active October 6, 2015 10:07
Dotfile installer - Let's automate the boring process for awesome results
# curl -k https://gist.github.com/raw/2976697/a2e9f2ff292a1fe5ceb7ddb05900f73a249abcdb/dotfiles_installer.sh | sudo sh
# create directory
cd ~/
mkdir gists
cd gists
# download git stuff
git clone git://gist.github.com/2931603.git gitconfig
ln -s ~/gists/gitconfig/.gitconfig ~/.gitconfig
@amejiarosario
amejiarosario / capybara cheat sheet
Created July 18, 2012 15:10 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@amejiarosario
amejiarosario / elastic_search_tire.rb
Created November 15, 2012 16:41
elastic search cheatsheet
# ~/elasticsearch-0.19.11/bin/elasticsearch -f
#
# Include to and active record model
#
class Log < ActiveRecord::Base
include Tire::Model::Search
include Tire::Model::Callbacks
end
@amejiarosario
amejiarosario / benchmark_meanshop_digital_ocean.txt
Created October 14, 2015 20:40
Benchmark of meanshop app deployed at Digital Ocean
$ ab -c 100 -n 10000 http://PUBLIC-IP-ADDRESS/api/products
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking PUBLIC-IP-ADDRESS (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
@amejiarosario
amejiarosario / redis_es_ls.md
Last active December 14, 2015 02:48 — forked from garlandkr/redis_es_ls.md
new elasticsearch version (elasticsearch-0.20.5)

This will be a copy/paste doc for installing redis, elasticsearch and logstash on ubuntu 12.04

Pre-Requisites

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install tcl8.5 tcl8.5-dev build-essential rubygems git \
htop python-dev openjdk-7-jre-headless libcurl4-openssl-dev \
bison ctags flex gperf libevent-dev libpcre3-dev libssl-dev libreadline6-dev \
libtokyocabinet-dev libncursesw5-dev libxml2-dev libxslt1-dev libsqlite3-dev \
# ./sublime_text
# libgio version is less than 2.26, single instance support disabled
# Segmentation fault (core dumped)
## FIX ##
# You must have gtk-doc installed to compile GLib.
sudo apt-get install gtk-doc-tools
git clone git://git.gnome.org/gtk-doc
@amejiarosario
amejiarosario / unix_tricks
Created March 12, 2013 16:18
unix tricks
I have marked with a * those which I think are absolutely essential
Items for each section are sorted by oldest to newest. Come back soon for more!
BASH
* In bash, 'ctrl-r' searches your command history as you type
- Input from the commandline as if it were a file by replacing
'command < file.in' with 'command <<< "some input text"'
- '^' is a sed-like operator to replace chars from last command
'ls docs; ^docs^web^' is equal to 'ls web'. The second argument can be empty.
* '!!:n' selects the nth argument of the last command, and '!$' the last arg