Skip to content

Instantly share code, notes, and snippets.

@kyledrake
kyledrake / gist:3af997f6f58d4d58f728
Created August 21, 2014 19:10
50-synaptics.conf
# Example xorg.conf.d snippet that assigns the touchpad driver
# to all touchpads. See xorg.conf.d(5) for more information on
# InputClass.
# DO NOT EDIT THIS FILE, your distribution will likely overwrite
# it when updating. Copy (and rename) this file into
# /etc/X11/xorg.conf.d first.
# Additional options may be added in the form of
# Option "OptionName" "value"
#
Section "InputClass"
# 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 July 31, 2014 05:06
Testing darkwallet/stealth.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 June 6, 2014 19:15
Verification of my PGP key on Keybase.io

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 April 6, 2024 00:30
How to throttle the FCC to dial up modem speeds on your website using Nginx
# 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 December 20, 2015 16:38
Probably the smallest feature-complete bitcoind RPC interface in existence.
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);
};
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 July 14, 2013 18:49
Current sysctl tweaks for NeoCities
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 December 19, 2015 06:59
Using Ruby to fuck up a file system
```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)
@kyledrake
kyledrake / gist:5906731
Last active December 19, 2015 05:49
Current SSL Cipher config for NeoCities, pulled from http://blog.cloudflare.com/new-ssl-vulnerabilities-cloudflare-users-prot
ssl_ciphers ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH;