Skip to content

Instantly share code, notes, and snippets.

View dennmart's full-sized avatar

Dennis Martinez dennmart

View GitHub Profile
______________________________________________________________________
/ Q: What does it say on the bottom of Coke cans in North Dakota? \
\ A: Open other end. /
----------------------------------------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
#!/bin/bash
wget -m -nd http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
# If the file doesn't exist, send an alert to Fail Notifier.
if [ ! -f GeoIpCountryCSV.zip ]
then
curl http://my-fail-notifier.heroku.com/fail -X POST -u basic_auth_user:basic_auth_password -d message="The download failed!"
fi
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_HEAP_SLOTS_INCREMENT=1000000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=1000000000
export RUBY_HEAP_FREE_MIN=500000
#/bin/bash
ls /boot/ | grep vmlinuz | sed 's@vmlinuz-@linux-image-@g' | grep -v `uname -r` > /tmp/kernelList
for I in `cat /tmp/kernelList`
do
aptitude remove $I
done
rm -f /tmp/kernelList
update-grub
@dennmart
dennmart / benchmark.rb
Created June 11, 2012 17:19 — forked from panthomakos/benchmark.rb
Benchmark Your Bundle
#!/usr/bin/env ruby
require 'benchmark'
REGEXPS = [
/^no such file to load -- (.+)$/i,
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
/^Missing API definition file in (.+)$/i,
/^cannot load such file -- (.+)$/i,
]
@dennmart
dennmart / changes.md
Created November 29, 2012 21:40 — forked from funny-falcon/changes.md
Performance patch for ruby-1.9.3-p327

Changes:

  • this version includes backport of Greg Price's patch for speedup startup http://bugs.ruby-lang.org/issues/7158 .

    ruby-core prefers his way to do thing, so that I abandon cached-lp and sorted-lf patches of mine.

  • this version integrates 'array as queue' patch, which improves performance when push/shift pattern is heavily used on Array.

    This patch is accepted into trunk for Ruby 2.0 and last possible bug is found by Yui Naruse. It is used in production* for a couple of months without issues even with this bug.

@dennmart
dennmart / errbit-heroku.log
Created January 5, 2016 08:56
Errbit Heroku - Stack Level Too Deep
2016-01-05T08:49:34.769952+00:00 heroku[web.1]: State changed from up to starting
2016-01-05T08:49:37.809847+00:00 heroku[web.1]: Starting process with command `bundle exec unicorn -c ./config/unicorn.default.rb`
2016-01-05T08:49:38.037022+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2016-01-05T08:49:39.010966+00:00 app[web.1]: I, [2016-01-05T08:49:39.010042 #3] INFO -- : reaped #<Process::Status: pid 6 exit 0> worker=0
2016-01-05T08:49:39.011117+00:00 app[web.1]: I, [2016-01-05T08:49:39.011070 #3] INFO -- : reaped #<Process::Status: pid 9 exit 0> worker=1
2016-01-05T08:49:39.011224+00:00 app[web.1]: I, [2016-01-05T08:49:39.011178 #3] INFO -- : reaped #<Process::Status: pid 12 exit 0> worker=2
2016-01-05T08:49:39.012261+00:00 app[web.1]: I, [2016-01-05T08:49:39.012198 #3] INFO -- : master complete
2016-01-05T08:49:39.142886+00:00 app[web.1]: I, [2016-01-05T08:49:39.142802 #3] INFO -- : Refreshing Gem list
2016-01-05T08:49:39.833970+00:00 heroku[web.1]: Process exited with status 0
2016-01-05T
server@www:~> sudo mysql_secure_installation
root's password: <Enter server's root password>
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
@dennmart
dennmart / .osx
Created September 8, 2011 18:54
Sensible defaults for Mac OS X Lion
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Enable the 2D Dock
defaults write com.apple.dock no-glass -bool true
# Make Dock icons of hidden applications translucent
defaults write com.apple.dock showhidden -bool true
# Disable menu bar transparency
version: 1
transactions:
- id: "GET /airports/:id"
steps:
- id: "Get information about a single airport"
request:
method: GET
endpoint: "{{ env.AIRPORT_GAP_API_URL }}/airports/KIX"
expect: