time telnet www-org.example.com 80
GET / HTTP/1.1
Host: www-org.example.com
Connection: keep-alive
(wait)
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
# Create 4 volumes and attach them to hdb | |
%w[sdi sdj sdk sdl].each do |dev| | |
volume = AWS.volumes.new :device => "/dev/#{dev}", :size => 5, :availability_zone => hdb.availability_zone | |
volume.server = hdb | |
volume.save | |
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
framework 'Cocoa' | |
class NSColor | |
def toCGColor | |
color_RGB = colorUsingColorSpaceName(NSCalibratedRGBColorSpace) | |
## approach #1 | |
# components = Array.new(4){Pointer.new(:double)} | |
# color_RGB.getRed(components[0], | |
# green: components[1], | |
# blue: components[2], |
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 'formula' | |
class Carbon < Formula | |
homepage 'http://graphite.wikidot.com/' | |
url 'http://pypi.python.org/packages/source/c/carbon/carbon-0.9.10.tar.gz' | |
md5 '1d85d91fe220ec69c0db3037359b691a' | |
depends_on 'python' | |
depends_on 'twisted' => :python | |
depends_on 'whisper' |
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
ubuntu@continubus:~/dockerfiles/go-agent$ docker ps | |
ID IMAGE COMMAND CREATED STATUS PORTS | |
d89f44c4df5b fujin/go-agent:latest /bin/sh -c /start.sh About a minute ago Up About a minute | |
a132f54a0442 fujin/go-agent:latest /bin/sh -c /start.sh About a minute ago Up About a minute | |
da8b513fbb2a fujin/go-agent:latest /bin/sh -c /start.sh About a minute ago Up About a minute | |
c100df11f9d7 fujin/go-agent:latest /bin/sh -c /start.sh About a minute ago Up About a minute | |
929adf4cbc3b fujin/go-agent:latest /bin/sh -c /start.sh About a minute ago Up About a minute | |
79720ed86e0b fujin/go-agent:latest /bin/sh -c /start.sh About a minute ago Up About a minute | |
ca9403fe93e2 fujin/go-agent:latest /b |
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
#!/usr/bin/env ruby | |
require 'bundler' | |
gems = ARGV | |
if gems.empty? | |
puts "Updating all gems" | |
Bundler.definition(true) |
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
class ApplicationController < ActionController::Base | |
... | |
# FORCE to implement content_for in controller | |
def view_context | |
super.tap do |view| | |
(@_content_for || {}).each do |name,content| | |
view.content_for name, content | |
end | |
end | |
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
#!/bin/sh | |
NGINX_VERSION=1.3.8 | |
TMP_PATH=/tmp | |
# Fetch and extract Nginx | |
cd $TMP_PATH | |
wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz | |
tar xvfz nginx-$NGINX_VERSION.tar.gz | |
cd nginx-$NGINX_VERSION |
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
# Gemfile | |
gem "puma" | |
# Procfile | |
web: bundle exec puma -p $PORT -e $RACK_ENV -C config/puma.rb | |
# add to config block config/environments/production.rb | |
config.threadsafe! | |
# get rid of NewRelic after_fork code, if you were doing this: |
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
package main | |
/* | |
#cgo CFLAGS: -x objective-c | |
#cgo LDFLAGS: -framework Cocoa | |
#import <Cocoa/Cocoa.h> | |
int | |
StartApp(void) { | |
[NSAutoreleasePool new]; |
OlderNewer