Skip to content

Instantly share code, notes, and snippets.

View gist:4cb1325461b040b07d66
# The Nginx configuration based on https://coderwall.com/p/rlguog
http {
ssl_certificate server.crt;
ssl_certificate_key server.key;
ssl_session_timeout 15m;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
@kyledrake
kyledrake / test.js
Created Jul 31, 2014
Testing darkwallet/stealth.js
View test.js
var stealth = require('stealth.js')
var b = require('bitcoinjs-lib')
// Receiver generates a scan and spend keypair
var receiverScanPrivateKey = new b.ECKey(undefined, true)
var receiverScanPublicKey = receiverScanPrivateKey.getPub()
var receiverSpendPrivateKey = new b.ECKey(undefined, true)
var receiverSpendPublicKey = receiverSpendPrivateKey.getPub()
@kyledrake
kyledrake / keybase.md
Created Jun 6, 2014
Verification of my PGP key on Keybase.io
View keybase.md

Keybase proof

I hereby claim:

  • I am kyledrake on github.
  • I am kyledrake (https://keybase.io/kyledrake) on keybase.
  • I have a public key whose fingerprint is 9C30 FA7B EA38 CBCD AB4D B12C 8BE7 2107 2E18 64BE

To claim this, I am signing this object:

@kyledrake
kyledrake / ferengi-plan.txt
Last active Mar 31, 2022
How to throttle the FCC to dial up modem speeds on your website using Nginx
View ferengi-plan.txt
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@kyledrake
kyledrake / bitcoind.js
Last active Dec 20, 2015
Probably the smallest feature-complete bitcoind RPC interface in existence.
View bitcoind.js
var request = require('request');
function Bitcoind(url) {
this.url = url;
};
Bitcoind.prototype.rpc = function(method, params, callback) {
this.request({jsonrpc: '2.0', method: method, params: params}, callback);
};
View bitcoin-decoderawtransaction.coffee
decode_raw_tx = do ->
{ Transaction, TransactionIn, TransactionOut } = Bitcoin
{ bytesToBase64 } = Crypto.util
# Parse an bytearray of length `size` as an integer
# Works for numbers up to 32-bit only
parse_int = (size) -> (bytes) ->
n = 0
n += (bytes.shift() & 0xff) << (8 * i) for i in [0...size]
@kyledrake
kyledrake / gist:5995326
Created Jul 14, 2013
Current sysctl tweaks for NeoCities
View gist:5995326
net.ipv4.tcp_max_syn_backlog = 3240000
net.core.somaxconn = 3240000
net.ipv4.tcp_max_tw_buckets = 1440000
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_congestion_control = cubic
net.core.netdev_max_backlog = 30000
@kyledrake
kyledrake / gist:5915757
Last active Dec 19, 2015
Using Ruby to fuck up a file system
View gist:5915757
```ruby
require 'fileutils'
require 'securerandom'
2_000_000.times do |site|
site_name = SecureRandom.hex[0...20]
puts site_name
Dir.mkdir File.join('./', 'sites', site_name)
View gist:5906731
ssl_ciphers ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH;
View gist:5697330
server {
root /home/web/neocities-web/public;
server_name neocities.org www.neocities.org;
# location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
# expires 60s;
# log_not_found off;
# }
try_files $uri @neocities;