I hereby claim:
- I am adamvduke on github.
- I am adamvduke (https://keybase.io/adamvduke) on keybase.
- I have a public key ASAdtHkKYGody9mlJ2r3_QeHa2uCosnLTuc9xRNrv8fdxwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
example.com { | |
root /srv/example.com/public | |
tls admin@example.com | |
proxy / localhost:5000 { | |
except /assets | |
} | |
} |
require 'restclient' | |
#flip verbose to get more or less output | |
verbose = true | |
if verbose | |
require 'net-http-spy' | |
Net::HTTP.http_logger_options = {:verbose => true} | |
end | |
# params get form-encoded |
curl -d 'auth_token=....' \ | |
-d 'device_tokens[]=...' \ | |
-d 'title=Test' \ | |
-d 'body=Hello' \ | |
-d 'label=View' \ | |
-d 'url_args[]=message_id' \ | |
-d 'url_args[]=12345' \ | |
https://api.zeropush.com/notify |
#don't send the nginx version number in error pages and Server header | |
server_tokens off; | |
# config to enable HSTS(HTTP Strict Transport Security) https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security | |
# to avoid ssl stripping https://en.wikipedia.org/wiki/SSL_stripping#SSL_stripping | |
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; | |
# config to don't allow the browser to render the page inside an frame or iframe | |
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking | |
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri |
BEGIN; | |
CREATE OR REPLACE FUNCTION primary_streaming_byte_lag() RETURNS TABLE (client_hostname text, client_addr inet, log_location_diff_bytes numeric, total_byte_lag double precision, total_byte_lag_pretty text, replay_byte_lag double precision, replay_byte_lag_pretty text) | |
LANGUAGE SQL SECURITY DEFINER | |
AS $$ | |
SELECT | |
client_hostname, | |
client_addr, | |
log_location_diff_bytes, | |
( (cur_xlog * 255 * 16 ^ 6) + cur_offset) - ((replay_xlog * 255 * 16 ^ 6) + replay_offset) AS total_byte_lag, | |
pg_size_pretty((( (cur_xlog * 255 * 16 ^ 6) + cur_offset) - ((replay_xlog * 255 * 16 ^ 6) + replay_offset))::numeric) AS total_byte_lag_pretty, |
require 'socket' | |
server = TCPServer.open(2195) | |
connection = server.accept | |
loop { | |
data = connection.read(8) | |
puts "Received \"#{data}\"" | |
if data == "CCCCCCCC" | |
connection.write("error") | |
connection.close |
set func_call_user NilOrNotNSNull | |
indent_align_string=false | |
indent_braces=false | |
indent_braces_no_func=false | |
indent_brace_parent=false | |
indent_namespace=false | |
indent_extern=false | |
indent_class=false | |
indent_class_colon=false |
curl -i "https://scontent-a.cdninstagram.com/hphotos-xaf1/outbound-distilleryimage2/t0.0-17/OBPTH/1c8dbe10a8a4....e414f2eeda2_8.jpg" | |
HTTP/1.1 400 Not Found | |
Content-Type: text/plain | |
Server: proxygen | |
Timing-Allow-Origin: * | |
X-Cache-Ts: 1447545792 | |
Date: Sun, 15 Nov 2015 00:03:12 GMT | |
X-FB-Edge-Debug: BBUHPNJ58swqQlRj0vjMAzLKyzlubMK_sF7iftGX9VpdYAnw9_02fPGxmEeelkNXf_DeSr0oNybV0ztpT-DAjg | |
Connection: keep-alive | |
Content-Length: 9 |
KEEP_EXTS = [".mp3",".jpg",".mid",".MP3",".wma",".m4a",".JPG",".mpg",".JPEG",".m4v",".mp4",".mov",".flac"] | |
UNWANTED_EXTS = [".ini",".db",".txt",".md5",".nfo",".pls",".info",".sfv",".NFO",".SFV",".url",".bal",".ogg",".php",".m3u",".LOG",".sls",".log",".pdf"] | |
CONVERT_EXTS = [".wma"] | |
def files(path) | |
Dir.glob("#{path}/**/*") | |
end | |
def find_files(path) |