Skip to content

Instantly share code, notes, and snippets.

View rumblefrog's full-sized avatar
💭
I may be slow to respond.

rumblefrog rumblefrog

💭
I may be slow to respond.
  • United States
  • 06:53 (UTC -05:00)
View GitHub Profile
@rumblefrog
rumblefrog / channelsorter.go
Created February 18, 2019 08:04
Sort Discord channels (category, text, voice) in an one dimension array
package channelsorter
import (
"sort"
"github.com/rumblefrog/discordgo"
)
type ChannelGeneric struct {
Underlying *discordgo.Channel
@rumblefrog
rumblefrog / helix.js
Created March 28, 2019 02:14
Sophisticated Helix Antenna Design with matching Coax to 50 Ω
function mehrWind() { x = document.generator.n.value * 1; x = x + 1 ; document.generator.n.value = x.toFixed(0) ; rechnen();}
function wenigerWind() { x = document.generator.n.value * 1; x = x - 1 ; if (x<1) x=1; document.generator.n.value = x.toFixed(0) ; rechnen();}
function mehrCond() { x = document.generator.d4.value * 1; x = x + 0.1 ; document.generator.d4.value = x.toFixed(2) ; rechnen();}
function wenigerCond() { x = document.generator.d4.value * 1; x = x - 0.1 ; if (x<0.1) x=0.1; document.generator.d4.value = x.toFixed(2) ; rechnen();}
function rechnen()
{
var freq;
freq = document.generator.freq.value * 1;
@rumblefrog
rumblefrog / iptables.py
Created July 21, 2019 23:32
Parses iptable logs
import re
import fileinput
from collections import Counter
pair_re = re.compile('([^ ]+)=([^ ]+)')
portlist = []
iplist = []
for line in fileinput.input():
line = line.rstrip()
RefPtr<SourceFile>
SourceManager::createFromBuffer(ReportingContext& cc, UniquePtr<char[]> buffer, uint32_t length)
{
const char* path = "fish-glub-glub";
Atom* atom = strings_.add(path);
AtomMap<RefPtr<SourceFile>>::Insert p = file_cache_.findForAdd(atom);
if (p.found())
return p->value;

Abstract

A network of Raspberry Pi Zero W that interconnect via GCP and potentially deployed using Kubernetes, and could potentially incorporate some ML processing on stored traffic data.

These traffic data could be incorporated to display live heat-map for specific locations and nodes and the ability to create and predict future trends.

Infrastructure

Pi -> Redis? -> InfluxDB -> HTTP API -> Frontend

Abstract

Client CIDR filter system with polling centralized TCP polling server.

Motivation

  • Current relational structure dependence of CIDR Blocker requires full-row scan and value operation in order to determine potential candidate
  • Relational structure stores have O(n) storage instead and compute complexity.
  • Radix tree cannot be sanely implemented in such relational dependency, much less providing continuous updates.
  • Radix tree provides O(log n) storage and a worst-case of O(4) access, with the worst storage space cost of 256^4 bytes with every IPv4 address within the filter, with a mean cost of 256^3 bytes.
@rumblefrog
rumblefrog / tasks.json
Last active April 7, 2021 20:06
SourcePawn VSCode Task
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Compile plugin",
"type": "shell",
"presentation": {
This file has been truncated, but you can view the full file.
version: '3'
services:
web:
image: crinis/sourcebans:latest
environment:
# Enable on install or update and make sure to set this to 'false' afterwards
# Also set this to false if you made any manual changes to Sourcebans sourcecode you want to keep
INSTALL: 'true'
networks:
- db