Skip to content

Instantly share code, notes, and snippets.

View jcolson's full-sized avatar
🐱
cat herding

Jay Colson jcolson

🐱
cat herding
View GitHub Profile
@jcolson
jcolson / weechat.rb
Created June 1, 2022 20:59
changes to weechat formula to compile 3.5
diff --git a/Formula/weechat.rb b/Formula/weechat.rb
index b8b4af479e2..8a11aa547dd 100644
--- a/Formula/weechat.rb
+++ b/Formula/weechat.rb
@@ -1,20 +1,13 @@
class Weechat < Formula
desc "Extensible IRC client"
homepage "https://www.weechat.org"
- url "https://weechat.org/files/src/weechat-3.4.1.tar.xz"
- sha256 "7e088109ad5dfbcb08a9a6b1dd70ea8236093fed8a13ee9d9c98881d7b1aeae7"
main()
async function main() {
console.log(`About to convert these tiles to tokens`, canvas.tiles.controlled);
if (canvas.tiles.controlled.length == 0) {
ui.notifications.error(`You need to select at least one tile to convert`);
return;
}
for (let theOldTile of canvas.tiles.controlled) {
console.log(`theOldTile`, theOldTile);
@jcolson
jcolson / tour_tree_exercise.go
Created February 24, 2020 10:30
golang tour tree exercise
package main
import (
"fmt"
"golang.org/x/tour/tree"
)
// Walk walks the tree t sending all values
// from the tree to the channel ch.
@jcolson
jcolson / exercise-web-crawler.go
Last active March 10, 2020 10:37
my solution to tour.golang.org/concurrency/10
package main
import (
"fmt"
"sync"
)
// Fetcher interface
type Fetcher interface {
// Fetch returns the body of URL and
#!/bin/sh
number=200
CMDS="curl jq"
for i in $CMDS
do
# command -v will return >0 when the $i is not found
command -v $i >/dev/null && continue || { echo "please install $i for this script to work"; exit 1; }
done
dogrep() {
sudo grep -h "$today.*Ban " /var/log/fail2ban.log | tail -$number | awk -F[\ \:] '{print $19,$17}' | sort | uniq -c | awk '{cmd="curl -s https://ipvigilante.com/"$2"|jq -j \"[.data.city_name//empty, .data.country_name//empty] | @csv\"";cmd|getline country;close(cmd)}{cmd2="sudo grep "$2" /var/log/fail2ban.log | tail -1|cut -f1,2 -d \" \" --output-delimiter \"-\"";cmd2|getline timestamp;close(cmd2)}{print timestamp,$1,$2,$3,country}' | sort
@jcolson
jcolson / generate.c
Created September 16, 2019 12:28 — forked from munificent/generate.c
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
jail.d/quasselcore.conf:
[quasselcore]
enabled = true
port = 6697
findtime = 3600
filter = quasselcore
logpath = /var/log/messages
maxretry = 2
filter.d/quasselcore.conf:
@jcolson
jcolson / keybase-proof.txt
Last active March 31, 2019 13:58
gpg keybase proof
### Keybase proof
I hereby claim:
* I am jcolson on github.
* I am jaycolson (https://keybase.io/jaycolson) on keybase.
* I have a public key whose fingerprint is 1328 6216 0548 38B7 D723 5AE4 841E CE89 C918 B527
To claim this, I am signing this object: