First, ensure the following tools are available on the local system and reasonably up to date:
- Git
- Git-flow
- RVM
- Bash
- SSH
Source: Love Your lib Directory By: Brian Cardarella
Far too often I’ve needed to extend a class that is being defined outside of my project. There are a few ways to deal with this. You can use a Composite to define a new class that you can then play around with. The downside to this is that I sometimes want to modify a class that is being inherited by other classes. This is when I think it is appropriate to Monkey Patch.
The pattern I have fallen upon is to define a gem_ext/ directory and a gem_ext.rb file in lib. I then make sure the extensions are loaded up using an initializer.
Copy config/master.key
from local filesystem to the production server under <project_root>/shared/config/master.key
.
Configure capistrano’s config/deploy.rb to include this line:
If you ever get key not found
errors when deploying with Capistrano, then:
When ~/.bashrc
contains first lines like this, any code afterwards won't be sourced:
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
git ls-files --deleted | xargs git rm | |
git commit |
SELECT table_schema "DB Name",
ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
FROM information_schema.tables
GROUP BY table_schema;
Wireshark Filter for SSL Traffic
Client Hello:
ssl.handshake.type == 1
Server Hello:
Simply put $(date +%Y-%m-%d-%H.%M.%S)
mysqldump -u <user> -p <database> | bzip2 -c > <backup>$(date +%Y-%m-%d-%H.%M.%S).sql.bz2
require 'capybara'
require 'selenium-webdriver'
Capybara.register_driver :selenium_w_proxy do |app|
proxy = Selenium::WebDriver::Proxy.new(http: 'host:port', ssl: 'host:port')
desired_caps = Selenium::WebDriver::Remote::Capabilities.firefox
options = Selenium::WebDriver::Firefox::Options.new
options.add_argument('--headless') # To make the browser headless
options.add_preference('browser.download.dir', "/some/path/to/folder/") # Custom downloads directory