This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
server { | |
listen 80; | |
listen 443 ssl; | |
server_name servername.domain; | |
ssl on; | |
ssl_certificate /etc/apache2/ssl/apache.crt; | |
ssl_certificate_key /etc/apache2/ssl/apache.key; | |
ssl_session_timeout 5m; | |
ssl_protocols SSLv2 SSLv3 TLSv1; |
curl --include \ | |
--no-buffer \ | |
--header "Connection: Upgrade" \ | |
--header "Upgrade: websocket" \ | |
--header "Host: example.com:80" \ | |
--header "Origin: http://example.com:80" \ | |
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \ | |
--header "Sec-WebSocket-Version: 13" \ | |
http://example.com:80/ |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<title>Title</title> | |
<link rel="stylesheet" href="style.css"/> | |
<style></style> | |
<script src="script.js"></script> |
{ | |
"aps":{ | |
"alert":{ | |
"body":"The status of flight KL123 scheduled 20:30 to London Heathrow has changed to 'boarding'. Boarding at 20:05.", | |
"title":"Boarding at 20:05" | |
}, | |
"category":"openFlightCategory" | |
}, | |
} |
/* Exercise: Loops and Functions #43 */ | |
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
z := float64(2.) |
sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'` |
var p1 = { | |
x: 20, | |
y: 20 | |
}; | |
var p2 = { | |
x: 40, | |
y: 40 | |
}; |
# read more at https://terrty.net/2014/ssl-tls-in-nginx/ | |
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf | |
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net | |
# your nginx version might not have all directives included, test this configuration before using in production against your nginx: | |
# $ nginx -c /etc/nginx/nginx.conf -t | |
server { | |
# public key, contains your public key and class 1 certificate, to create: | |
# (example for startssl) | |
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
namespace :monit do | |
desc "Monit unicorn configuration" | |
task :unicorn_service_tests, roles: :web do | |
run "mkdir -p #{shared_path}/config" | |
template "monit_unicorn.rb.erb", "/tmp/monit_unicorn" | |
run "#{sudo} mv /tmp/monit_unicorn /etc/monit/conf.d/unicorn_#{application}_#{rails_env}.conf" | |
unicorn_worker_pids.each do |val| | |
worker_template "monit_unicorn_worker.rb.erb", "/tmp/monit_unicorn_#{application}_#{rails_env}_#{val}_worker", val |