Skip to content

Instantly share code, notes, and snippets.

@winduptoy
winduptoy / fail2ban.log
Created Jan 16, 2019
fail2ban / nft errors
View fail2ban.log
2019-01-15 01:49:07,522 fail2ban.utils [32277]: Level 39 7f916c5a46c0 -- exec: nft list chain inet fail2ban input | grep -q '@f2b-sshd[ \t]'
2019-01-15 01:49:07,522 fail2ban.utils [32277]: ERROR 7f916c5a46c0 -- returned 1
2019-01-15 01:49:07,522 fail2ban.CommandAction [32277]: ERROR Invariant check failed. Trying to restore a sane environment
2019-01-15 01:49:07,537 fail2ban.utils [32277]: Level 39 7f916e94a260 -- exec: HANDLE_ID=$(nft --handle --numeric list chain inet fail2ban input | grep -m1 'ip saddr @f2b-sshd drop # handle' | grep -oe ' handle [0-9]*')
nft delete rule inet fail2ban input $HANDLE_ID
nft delete set inet fail2ban f2b-sshd
2019-01-15 01:49:07,538 fail2ban.utils [32277]: ERROR 7f916e94a260 -- stderr: 'Error: syntax error, unexpected newline, expecting handle'
2019-01-15 01:49:07,538 fail2ban.utils [32277]: ERROR 7f916e94a260 -- stderr: 'delete rule inet fail2ban input'
2019-01-15 01:49:07,538 fail2ban.utils [32277]: ERROR 7f916
@winduptoy
winduptoy / gl.h
Created Nov 27, 2018
GALOGEN GL/3.3/core Zig translation
View gl.h
/* This file was auto-generated by Galogen */
#ifndef _GALOGEN_HEADER_
#define _GALOGEN_HEADER_
#if defined(__gl_h_) || defined(__GL_H__) || defined(__glext_h_) || defined(__GLEXT_H_) || defined(__gltypes_h_) || defined(__glcorearb_h_) || defined(__gl_glcorearb_h)
#error Galogen-generated header included after a GL header.
#endif
#define __gl_h_ 1
#define __gl32_h_ 1
#define __gl31_h_ 1
@winduptoy
winduptoy / main.js
Last active Aug 14, 2018
Taskwarrior: Import Google Reminders
View main.js
/*
- Export Google Reminders from Google Takeout
- Add this script to the HTML page
- Open the console and copy the results into a file
- Run task import results.json
- Recurring events are not processed, but logged for manual entry
*/
const root = document.body.children[0];
View passc
#!/bin/bash
FIELD=
case $1 in
u)
FIELD="username"
;;
p)
FIELD="password"
;;
@winduptoy
winduptoy / roundCorners.js
Last active Mar 18, 2019
Paper.js – Rounded corners in plain JavaScript
View roundCorners.js
// Rounds the corners of a path in Paper.js
// Demo: http://sketch.paperjs.org/#S/lVRNj5swEP0rIy4LDSEQqRey0R52VamHqivtoYeQgxcmixXHRsawrVb8944NBfLRw3IA+c2b92bGNh+eZCf0Uu/liCYvvdDLVWHXLdNQG3ptQeI7PDNT+sEmkxbXrOBN/YsXpqRwEhOcydUKHjUyg8BcRl2yCgFb1H/goMnEUZgsQNU5F8IyTYlzsUweGpkbriQo+c3m+JQvTfCRSaDH1hNpPKkWXS0W69OpDP8HlRjVXPY5Ua4aaVbrOFgkwZeZyWbSmvUWvdDaH3zsk5MG6hRaju9RvwinaKW4NHUKydcZ2JskhMbxFby25DlcG62O+KiEIpe7V8Hy410f7YLzGjV1UrgNsEA4CFpSZwc/zmziVfQKBxpQU5lx24lvJ2rEDqtysxrWUS14jn5sFTNzFiLqbu/gg9K+FeEExSEI+oz5AuUbDZZi9yDos1gMrr1v3uhnO69Zyo7vIzfDzUST+Ntc82ABCWy3ZPgAMaTggOvkSmN7I3lJyfeU93BZrItYteUtNVvKEwrDSG2sfjlVeGF8gzrWM1BHxX/+22Ebh/go87+43RVWFPMjOh7E9MLYCYXnxJJunsCfjUknymrdi3fBZ13Gdm66fJfpxLgw6cYzlgtVY0GNGt2gi2k0jZbucNrDTT+jV/qjHPvL5qW7ffcX
// -- Translated from PaperScript to plain JavaScript. Originally by Alex Blackwood.
// -- http://stackoverflow.com/questions/25936566/paper-js-achieving-smoother-edges-with-closed-paths
function roundCorners(path,radius) {
var segments = path.segments.slice(0);
path.remov
@winduptoy
winduptoy / Vector2D.js
Last active Mar 25, 2019
JavaScript 2D Vector Class
View Vector2D.js
/*
Simple 2D JavaScript Vector Class
Hacked from evanw's lightgl.js
https://github.com/evanw/lightgl.js/blob/master/src/vector.js
*/
function Vector(x, y) {
You can’t perform that action at this time.