Skip to content

Instantly share code, notes, and snippets.

View vovimayhem's full-sized avatar
🎸
Taking names and kicking ass

Roberto Quintanilla vovimayhem

🎸
Taking names and kicking ass
View GitHub Profile
@vovimayhem
vovimayhem / gist:4448604
Created January 3, 2013 23:47
Basic 2-hop tunneling... I keep forgetting this...
# ssh -N gateway_ssh_server -L local_port:target_server:target_server_port
@vovimayhem
vovimayhem / CreateRailsAppOrEngine.md
Last active December 10, 2015 20:58
Crear app/engine de Rails usando MySQL y RSpec.

New Rails App

At Terminal/Command:

  • The -T option tells rails not to include Test::Unit
  • The --database=mysql tells rails to include Mysql gem and configs
  • The --skip-bundle is self explanatory... rails new myapp -T --skip-bundle --database=mysql

in Gemfile:

@vovimayhem
vovimayhem / README.md
Last active December 31, 2015 14:48
System Wide Chruby

System Wide Chruby

@vovimayhem
vovimayhem / install.sh
Last active November 20, 2023 22:33
Install on Linux Mint the latest version of JMeter that has the redirects behavior correct (2.9)
# Download the jmeter gzipped tarball to a temporary folder:
wget -O /tmp/jmeter.tgz http://archive.apache.org/dist/jmeter/binaries/apache-jmeter-2.9.tgz
# Extract to /usr/share
sudo tar -xzvf /tmp/jmeter.tgz -C /usr/share
# Edit the provided JMeter start script, changing the string '`dirname "$0"`' for '/usr/share/jmeter/bin':
sudo sed -i 's/`dirname "\$0"`/\/usr\/share\/apache-jmeter-2.9\/bin/g' /usr/share/apache-jmeter-2.9/bin/jmeter
# Generate the following symlinks:
@vovimayhem
vovimayhem / tidy_bytes_in_request.rb
Created April 21, 2015 20:27
TidyBytesInRequest Rack Middleware
require "active_support/core_ext/string/multibyte"
class TidyBytesInRequest
TIDY_BYTES_ENV_KEYS = %w(
HTTP_USER_AGENT
HTTP_REFERER
PATH_INFO
QUERY_STRING
REQUEST_PATH
@vovimayhem
vovimayhem / something.sh
Created April 30, 2015 19:50
Truncate the fuck those docker logs!
#
function clearDockerContainerLog() {
_dirname=$(sudo ls /var/lib/docker/containers/ | grep $1)
sudo sh -c "cat /dev/null > /var/lib/docker/containers/$_dirname/$_dirname-json.log"
_dirname=""
}
alias clean-docker-log="clearDockerContainerLog"
sudo lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)
00:1c.2 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 3 (rev b4)
@vovimayhem
vovimayhem / rorod.sh
Last active August 30, 2015 20:38
My first try to a web-based shell script
#! /bin/bash
DIR_ON_HOST=${PWD}
APP_NAME=${PWD##*/}
echo $DIR_ON_HOST;
echo $APP_NAME;
docker run --rm -v $(pwd):/app vovimayhem/app-dev:mri-2.2.3 sh -c "gem install rails --no-rdoc --no-ri && rails new ."
@vovimayhem
vovimayhem / dev-entrypoint.sh
Last active September 29, 2015 16:32
docker rails starter
#! /bin/bash
# Include the app's bin directory to $PATH:
export PATH=/usr/src/app/bin:$PATH
set -e
# The container was invoked without any particular command... we must check if is a new development environment, install whatever we need to install, and then run the default command:
if [ -z "$1" ]; then
@vovimayhem
vovimayhem / .gitignore
Last active November 10, 2015 00:26
Sample Docer+Phoenix project
# App artifacts
/_build
/db
/deps
/*.ez
# Generate on crash by the VM
erl_crash.dump
# The config/prod.secret.exs file by default contains sensitive