Skip to content

Instantly share code, notes, and snippets.

View dennmart's full-sized avatar

Dennis Martinez dennmart

View GitHub Profile
@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 / .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
#/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
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
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
______________________________________________________________________
/ Q: What does it say on the bottom of Coke cans in North Dakota? \
\ A: Open other end. /
----------------------------------------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
We couldn’t find that file to show.
We couldn’t find that file to show.
mysql> SELECT * FROM logs LIMIT 1;
+----+--------------+---------------+--------+---------+
| ID | ipaddress | date | user | time |
+----+--------------+---------------+--------+---------+
| 1 | 192.168.1.23 | March 3, 2004 | dennis | 1:28 pm |
+----+--------------+---------------+--------+---------+
1 row in set (0.00 sec)
#!/bin/bash
echo "Deleting dennmart.com archive for $(date +%A) if it exists..."
tarsnap --cachedir /usr/local/tarsnap-cache --keyfile /root/tarsnap.key -d -f dennmart.com-daily-$(date +%A)
echo "Creating dennmart.com archive for $(date +%A)..."
tarsnap --cachedir /usr/local/tarsnap-cache --keyfile /root/tarsnap.key -c -f dennmart.com-daily-$(date +%A) /var/www/dennmart.com
echo "Making temporary database dump..."
mysqldump -u root -pxxxxxx --all-databases --add-drop-table > /tmp/mysqldump.sql
echo "Deleting database dump archive for $(date +%A) if it exists..."