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 | |
# | |
# Create a swarm manager and consul | |
# | |
# 1. Create 7 servers | |
# CONSUL_ADDRESS= | |
# SWARM_MANAGER_1_ADDRESS= | |
# SWARM_MANAGER_2_ADDRESS= | |
# LOAD_BALANCER_1_ADDRESS= |
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
openssl genrsa -out server.key 2048 | |
openssl req -new -x509 -sha256 -key server.key -out server.crt -days 365 |
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
<html> | |
<img src="" hide> | |
</html> |
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 FacebookClubsController < ApplicationController | |
layout "facebook_canvas" | |
after_filter :allow_iframe | |
def index | |
end | |
private | |
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
# Block access from IP | |
server { | |
listen 80 default; | |
server_name _; | |
ssl off; | |
# No response | |
return 444; | |
} |
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
# | |
# You should add the Facebook App ID and the channel url (optional), in the #fb-root element, as a data- attribute: | |
# <div id="fb-root" data-app-id="<%= ENV['FACEBOOK_APP_ID'] %>" data-channel-url="<%= url_no_scheme('/channel.html') %>"></div> | |
# | |
window.fbAsyncInit = -> | |
FB.init | |
appId: document.getElementById("fb-root").getAttribute("data-app-id") | |
channelUrl: document.getElementById("fb-root").getAttribute("data-channel-url") | |
status: true, | |
cookie: 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
#!/bin/sh | |
sudo perl -e'%h=map{/.\s/;99**(ord$&&7)-$`,$_}`du -h`;die@h{sort%h}' |
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 | |
cat /dev/urandom | envcd 'a-f0-9' | head -c 16 |
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 Router { | |
constructor(){ | |
const path = (window.location.href.split("/#!")[1]) | |
?(window.location.href.split("/#!")[1]) | |
:(window.location.href.split(/src\/html/)[1]) | |
// callbacks | |
this.actions = [] | |
this.state = { | |
baseURL: window.location.protocol+"://"+window.location.host, | |
path: path, |
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 | |
import ( | |
"net" | |
) | |
func main(){ | |
message := []byte("Hello world") | |
localAddress, _ := net.ResolveUDPAddr("udp", "127.0.0.1:0") | |
remoteAddress, _ := net.ResolveUDPAddr("udp", "127.0.0.1:1936") |