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
server { | |
#root /usr/share/nginx/www; | |
root /home/myuser/blog/public; | |
index index.html index.htm; | |
server_name app.hostname; | |
location ~ ^/assets/ { | |
root /home/myuser/blog/app/assets/$1; |
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
worker_processes 2 # setting this low for aws t1.micro | |
listen "0.0.0.0:3000" | |
pid "/home/myuser/project/log/unicorn.pid" | |
stderr_path "/home/myuser/project/log/unicorn_stderr.log" | |
stdout_path "/home/myuser/project/log/unicorn_stdout.log" |
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
############################################################# | |
# Aliases | |
############################################################# | |
# | |
# print time | |
alias t="date +%H:%M" | |
# print date | |
alias d="date +%b-%d-%Y" |
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
*/5 * * * * bash -c 'IPADDR=`cat /tmp/myip.txt` perl -e 's/^(.*)home\.remotehost/$ENV{'IPADDR'} home.remotehost/g' -p -i /etc/hosts' |
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
*/5 * * * * bash -c 'echo `wget -q -t 5 --output-document=- "http://automation.whatismyip.com/n09230945.asp"` > /tmp/myip.txt && scp /tmp/myip.txt <remote_host>:/tmp/myip.txt' |
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
$ sudo cat /etc/nginx/sites-enabled/blog | |
server { | |
server_name blog.mervine.net; | |
location / { | |
proxy_pass http://f2h1gg.tumblr.com; | |
} | |
} | |
$ sudo ls -al /etc/nginx/sites-enabled/blog | |
lrwxrwxrwx 1 root root 23 2012-03-18 00:23 /etc/nginx/sites-enabled/blog |
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
require 'sinatra' | |
helpers do | |
def get_layout | |
@layout_default = ( request.env['X_MOBILE_DEVICE'] ? :layout_mobile : true ) | |
end | |
end | |
before do | |
get_layout() |
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
require 'mongomapper' | |
class Collection | |
include MongoMapper::Document | |
# default collection name is "collections" which | |
# looks for 'db.collections' in mongo. | |
set_collection_name "some_collections" | |
# new collection name is "some_collections" which | |
# looks for 'db.some_collections' in mongo. |
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
var post_count = function() { | |
db.posts.find( { "_type" : /^Ditty/ } ); | |
} | |
var update_posts = function() { | |
db.posts.update( { "_type" : "Ditty::Post" }, { $set : { "_type" : "Post" } }, true, true); | |
} | |
var tag_count = function() { | |
db.tags.find( { "_type" : /^Ditty/ } ); |
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
# | |
# This file configures the New Relic Agent. New Relic monitors | |
# Ruby, Java, .NET, PHP, and Python applications with deep visibility and low overhead. | |
# For more information, visit www.newrelic.com. | |
# | |
# Generated June 16, 2012 | |
# | |
# This configuration file is custom generated for AT&T Interactive | |
# Here are the settings that are common to all environments: |