Skip to content

Instantly share code, notes, and snippets.

View altherlex's full-sized avatar

Alther Alves altherlex

View GitHub Profile
@altherlex
altherlex / ec2-benchmark.md
Last active March 18, 2017 00:49
Stress test forAWS EC2

Stress-test EC2

Ferramenta: ab - Apache HTTP server benchmarking tool

  • Application server: m3.2xlarge (São Paulo)
  • DataBase server: db.m3.xlarge (São Paulo)
  • ElasticSearch server: m3.2xlarge (São Paulo - mesma máquina da aplicação)

Requests

@altherlex
altherlex / ops-benchmark.md
Last active March 18, 2017 00:49
Stress test for Opsworks

Stress-test OpsWorks+LoadBalancer

~9 min - para ligar uma nova instância (teste c3.large)

Ferramenta: ab - Apache HTTP server benchmarking tool

  • Application server: t2.small (Virgínia)
  • DataBase server: db.t2.small (Virgínia)
  • ElasticSearch server: m3.medium (Virgínia)
@altherlex
altherlex / optparse+rake.rb
Created April 20, 2016 19:10
How use optparse gem into rake tasks
require 'optparse'
namespace :programs do |args|
desc "Download whatever"
task :download => [:environment] do
# USAGE: rake programs:download -- rm
#-- Setting options $ rake programs:download -- --rm
options = {}
option_parser = OptionParser.new
@altherlex
altherlex / devops.md
Last active September 26, 2016 16:43
hints
@altherlex
altherlex / homebrew_multiple_mysql_versions.md
Last active February 15, 2016 12:31 — forked from benlinton/multiple_mysql_versions_for_development.md
Multiple MySQL Versions with Homebrew

more tips

Multiple MySQL Versions with Homebrew

For homebrew version 0.9.5.

brew -v # => Homebrew 0.9.5

Install the current version of mysql.

@altherlex
altherlex / starting_w_DOCKER
Last active February 14, 2016 02:36
starting_w_DOCKER
vim +PluginInstall +qall
vi ../.vimrc
vim README.md
vim .
sudo vi /etc/fstab
open /Volumes
bash --login '/Applications/Docker/Docker Quickstart Terminal.app/Contents/Resources/Scripts/start.sh'
ps -ef | grep -i docker
ps -ef | grep -i vm
docker-machine env default
@altherlex
altherlex / template-jenkins-railsapp.markdown
Last active April 28, 2016 20:38
template-steps-jenkins-railsapp

###1-bundle

Verifica qualquer alteração no repositório remote e dispara um bundle install
if ! gem list | grep -q bundler 
then
  gem install bundler
fi
bundle

###2-unittest

@altherlex
altherlex / bash.ssh
Last active October 26, 2016 19:33
Track Back around who execute your method
# All users crontab. More http://www.thegeekstuff.com/2009/11/how-to-install-edit-or-remove-cron-jobs-in-batch-mode/
ls /var/spool/cron/crontabs/
# An array with a list of files who invoke to irrive in method inspected.
ruby method caller
# list all linux users
cat /etc/passwd
# list w/ filters
@altherlex
altherlex / git_commands.rb
Last active July 13, 2022 20:49
git commands
stty sane
# Discard unstaged changes
git checkout file
# For all unstaged files use:
git checkout -- .
#http://rogerdudler.github.io/git-guide/index.pt_BR.html
# remove from stage
git reset file
@altherlex
altherlex / index.rdoc
Last active August 29, 2015 14:21
Tools for nodejs webservice and client-side architecture
  • Rewire (require module): Easy dependency injection for node.js unit testing

  • Mocha (to test js)

  • Moment: Parse, validate, manipulate, and display dates in JavaScript.

  • Swagger: A Powerful Interface to your RESTful API

  • usejsdoc

  • Yeoman(make scaffold): to kickstart new projects, prescribing best practices and tools to help you stay productive

  • Underscore: useful functional programming helpers

  • MVC client-side: AngularJs vs Backbone vs Emberjs

  • ApacheBench: Tool for benchmarking the HTTP server