Skip to content

Instantly share code, notes, and snippets.

@sivel
sivel / better-ssh-authorized-keys-management.md
Last active December 15, 2025 12:56
Better SSH Authorized Keys Management

Better SSH Authorized Keys Management

A seemingly common problem that people encounter is how to handle all of your users authorized_keys file.

People struggle over management, ensuring that users only have specific keys in the authorized_keys file or even a method for expiring keys. A centralized key management system could help provide all of this functionality with a little scripting.

One piece of functionality overlooked in OpenSSH is the AuthorizedKeysCommand configuration keyword. This configuration allows you to specify a command that will run during login to retrieve a users public key file from a remote source and perform validation just as if the authorized_keys file was local.

Here is an example directory structure for a set of users with SSH public keys that can be shared out via a web server:

@kyledrake
kyledrake / ferengi-plan.txt
Last active November 14, 2025 04:39
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 / {
@psyark
psyark / keyboard-us.reg
Created April 28, 2014 02:25
US Keyboard
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\i8042prt\Parameters]
"PollingIterations"=dword:00002ee0
"PollingIterationsMaximum"=dword:00002ee0
"ResendIterations"=dword:00000003
"LayerDriver JPN"="kbd101.dll"
"OverrideKeyboardIdentifier"="PCAT_101KEY"
"OverrideKeyboardType"=dword:00000007
"OverrideKeyboardSubtype"=dword:00000000
@takeshixx
takeshixx / hb-test.py
Last active September 8, 2025 01:16
OpenSSL heartbeat PoC with STARTTLS support.
#!/usr/bin/env python2
"""
Author: takeshix <[email protected]>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford ([email protected]).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser
@iphoting
iphoting / pin_gen.rb
Created November 18, 2012 09:24
Simple Numeric PIN Generator
#!/usr/bin/env ruby
#
# A simple numerical PIN generator.
# For passphrases, use pwqgen.rb.
#
# Usage:
# gem install docopt
# ./pin_gen.rb --help
#
@iphoting
iphoting / tumblr_video_downloader.sh
Created October 12, 2012 04:23
Tumblr Video Downloader
#!/usr/bin/env bash
#
# This scripts searches for a video_file link from the a Tumblr
# video premalink page and uses wget to download the video file.
#
# Requirements: curl, 7.21.2 or newer.
#
if [ -z "$1" ];
then
@iphoting
iphoting / simple_http_server.ru
Created July 25, 2012 04:06
Simple HTTP Server for Ruby
#!/usr/bin/env rackup
#\ -E deployment
# Description:
#
# Start a simple static HTTP server for the current directory.
#
# Prerequisites:
#
# gem install 'rack'
@iphoting
iphoting / get-input-encoder.php
Created May 18, 2012 07:43
RESTful PHP Mail Interface
#!/usr/bin/env php
<?php
$ss = 'changeit';
$rand = mt_rand();
$input = array(
"shared" => sha1($ss . $rand),
"salt" => $rand,
"to" => '[email protected]',
"subject" => "This is a test subject.",
@iphoting
iphoting / build-php.sh
Created May 10, 2012 04:06
Precompile Heroku PHP Binaries
#!/bin/bash
# use AMI ami-04c9306d
# run this script as root.
## EDIT
export S3_BUCKET="heroku-buildpack-php-tyler"
export LIBMCRYPT_VERSION="2.5.8"
export PHP_VERSION="5.4.1"
export APC_VERSION="3.1.10"
export PHPREDIS_VERSION="2.2.1"
@bmann
bmann / tumblr.rb
Created January 18, 2012 08:56 — forked from derek-watson/tumblr.rb
Tumblr to Jekyll migration (Octopress / link blog edition)
#!/usr/bin/env ruby
# Script to import tumblr posts into local markdown posts ready to be consumed by Jekyll.
# Inspired by New Bamboo's post http://blog.new-bamboo.co.uk/2009/2/20/migrating-from-mephisto-to-jekyll
# Supports post types: regular, quote, link, photo, video and audio
# Saves local copies of images
# via gist at https://gist.github.com/867468
require 'rubygems'
require 'open-uri'