Skip to content

Instantly share code, notes, and snippets.

Thomas Hurst Freaky

Block or report user

Report or block Freaky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Freaky / Dockerfile
Last active Apr 7, 2019
tarssh Dockerfile
View Dockerfile
FROM rust:1.33-stretch as build
WORKDIR /usr/src/tarssh
# Make a blank project with our deps for Docker to cache.
# We skip rusty-sandbox because it does nothing useful on Linux.
COPY Cargo.toml Cargo.lock .
RUN mkdir -p src \
&& echo 'fn main() { }' >src/ \
&& cargo build --release --no-default-features --features drop_privs
Freaky /
Last active Mar 26, 2019
Rust ssh tarpit
use std::env;
use std::net::SocketAddr;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::time::{Duration, Instant};
use exitcode;
use env_logger;
use log::{error, info, warn};
View fast-memchr.c
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#define MIN(a,b) (((a)<(b))?(a):(b))
#define LO ((uint64_t)0x0101010101010101L)
#define HI ((uint64_t)0x8080808080808080L)
#define LOOP_SIZE (2 * sizeof(uint64_t))
Freaky / readline-prefixed-junk.rb
Created Jan 2, 2019
Print crap before readline
View readline-prefixed-junk.rb
#!/usr/bin/env ruby
require 'readline'
run = true
worker = do
i = 0
while run
STDOUT.print("\e[s\r\e[A\e[KMoo moo baa #{i += 1}\n\e[u");
Freaky / vm_superhub.rb
Created Dec 28, 2018
Munin plugin for Virgin Media Superhub
View vm_superhub.rb
Host = ''
require 'net/http'
require 'timeout'
def get(page)
Timeout.timeout(5) { Net::HTTP.get(Host, page) }
rescue => e
STDERR.puts "GET http://#{Host}/#{page} failure: #{e.class}: #{e.message}"
Freaky / freebsd-update-progress.patch
Last active Dec 13, 2018
Patch to CURRENT freebsd-update to replace the 10....20....30.... progress indicator
View freebsd-update-progress.patch
--- 2018-12-13 16:28:44.343075728 +0000
+++ 2018-12-13 16:44:41.440009430 +0000
@@ -1059,6 +1059,30 @@
# Print user-friendly progress statistics
fetch_progress () {
+ if [ "$1" -gt 0 -a -t 1 ]; then
+ fetch_progress_tty $1
+ else
+ fetch_progress_classic
Freaky / divebar.rb
Last active Dec 6, 2018
Start of yet another progress bar library?
View divebar.rb
# require "divebar/version"
module Divebar
Style =, :tick_chars, :progress_chars, :template)
module Styles
Default =
"⠁⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈⠈ ".chars,
" %<bar>s %<spinner>s %<pos>d/%<len>d %<msg>s"
View iptest.rb
module IpTest
module V4
MAX_LEN = ''.size
SEGMENT = /(?:25[0-5]|(?:2[0-4]|1?[0-9])?[0-9])/
def self.contains?(str)
Freaky /
Created Sep 3, 2018
Quick and dirty email search index test thing that sucks completely
/// Email Sucks Completely / Email Search Command
extern crate mailparse;
extern crate tantivy;
extern crate walkdir;
use mailparse::*;
use tantivy::collector::TopCollector;
use tantivy::query::QueryParser;
View check_listen_ports.rb
#!/usr/bin/env ruby
# frozen_string_literal: true
require_relative 'ragios'
Listener =, :command, :pid, :fd, :proto, :local_addr, :foreign_addr) do
def to_s
"#{user}/#{command} (#{pid}) on #{local_addr}"
You can’t perform that action at this time.