$ brew install pdnsd
$ sudo chown -R nobody /usr/local/var/cache/pdnsd
$ curl -L http://goo.gl/kMlyQ -o pdnsd.conf
$ mv pdnsd.conf /usr/local/etc
$ sudo chown root /usr/local/etc/pdnsd.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
namespace :deploy do | |
desc 'Restart application' | |
task :restart => ["eye:reload", "eye:restart"] | |
after :published, :restart | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.fadeinDown { | |
-webkit-animation: fadeInDown 500ms ease-in-out; /* Chrome, Safari, Opera */ | |
animation: fadeInDown 500ms ease-in-out; | |
} | |
/* Chrome, Safari, Opera */ | |
@-webkit-keyframes fadeInDown { | |
0% { |
WAL-E needs to be installed on all machines, masters and slaves.
Only one machine, the master, writes WAL segments via continuous archiving. The configuration for the master postgresql.conf
is:
archive_mode = on
archive_command = 'envdir /etc/wal-e.d/env wal-e wal-push %p'
archive_timeout = 60
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?PHP | |
/** | |
* pingdom.php | |
* | |
* This application will check your server swap, hard drive, cpu, and MySQL conditions. | |
* It will then generate an appropriate XML file for a Pingdom HTTP Custom check. | |
* | |
* If any usage is above your preset thresholds, then a down message will be returned, | |
* indicating that your server may be under more load than usual, hopefully, providing | |
* a bit of advanced notice before a true failure due to lack of resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://cgit.freedesktop.org/xorg/app/edid-decode/plain/edid-decode.c | |
compile with: | |
gcc edid-decode.c -o edid-decode | |
get EDID from IORegistryExplorer (mine, an old 24" Apple Cinema Display, is attached). | |
Convert to binary with this command: | |
ruby -e 'File.open("edid", "wb").write(File.read("edid.txt").split.map { |s| ("0x"+s).to_i(16) }.inject("", "<<"))' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# send email using STARTTLS; Net::SMTP#enable_starttls requires ruby >=1.8.7 | |
# this hack is needed for rails <2.3; apparently >=2.3 has something for this already | |
ActionMailer::Base.class_eval do | |
private | |
def perform_delivery_smtp(mail) | |
destinations = mail.destinations | |
mail.ready_to_send | |
smtp = Net::SMTP.new(smtp_settings[:address], smtp_settings[:port]) |
OlderNewer