Skip to content

Instantly share code, notes, and snippets.

@madblobfish
madblobfish / radius.rb
Created August 3, 2022 23:05
Plain Ruby Radius (experiment)
require 'openssl'
require 'socket'
require 'stringio'
SECRET = 'radsec' # note: this is not radsec yet
USERS = {'user'=>'password'}
DEBUG = ARGV.include?('--debug')
tls_connections = {}
tls_context = OpenSSL::SSL::SSLContext.new
@madblobfish
madblobfish / gitpull.service
Created June 23, 2017 08:39
Systemd service file to pull a git repositoy when recieveing tcp packets (webhook)
[Unit]
Description=Autopull through webhook
After=network.target
[Service]
User=<user>
Type=simple
Environment="GITPATH=%h/somegitfolder/"
Environment="PORT=9999"
Environment="LOGFILE=%h/.gitpull.log"
@madblobfish
madblobfish / gist:4b9883e3d7593f4f90b8fe0f3a1e1dc0
Created August 17, 2016 13:40 — forked from anonymous/gist:1e15601f9771abef580d5c2ed9c2bf14
Recursive RegExp to find empty sectionings in latex
\\(chapter|(sub)*section)(\{([^{}]*(?3)?[^{}]*)*\})\s*\\(chapter|(sub)*section)
Matching Examples:
1
\section{yoooo{} \textbf{asd}}
\section
2