Skip to content

Instantly share code, notes, and snippets.

View picatz's full-sized avatar
Graph Theory

Kent Gruber picatz

Graph Theory
View GitHub Profile
@picatz
picatz / goanalysischecker.go
Created November 22, 2023 00:32
Go Analysis Standalone Checker
package goanalysischecker
import (
"fmt"
"go/types"
"log"
"reflect"
"sort"
"strings"
"sync"
@picatz
picatz / main.go
Created August 28, 2023 21:42
Frontal Surface Area STL
package main
import (
"bufio"
"fmt"
"math"
"os"
"strings"
)
@picatz
picatz / monitoring.hcl
Created December 12, 2020 19:43
A simple Nomad job file to deploy Prometheus and Grafana
job "metrics" {
datacenters = ["dc1"]
group "prometheus" {
network {
mode = "bridge"
}
service {
name = "prometheus"
@picatz
picatz / http-req-content-type.go
Created April 29, 2020 19:53
POC for an analyzer that finds http requests that unnecessarily set a content-type header
package request
import (
"fmt"
"go/ast"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
"golang.org/x/tools/go/ast/inspector"
)
require 'json'
require 'async'
require 'async/http/internet'
require 'base64'
module RESTEasy
class Failure < StandardError
end
class Client
@picatz
picatz / job-postings
Last active June 24, 2021 23:36
for demo
This file has been truncated, but you can view the full file.
{"company":"0x","url":"https://boards.greenhouse.io/0x/jobs/5277385002","title":"Developer Advocacy Lead","location":"San Francisco, Remote"}
{"company":"0x","url":"https://boards.greenhouse.io/0x/jobs/5262475002","title":"DevOps Engineer","location":"San Francisco, Remote"}
{"company":"0x","url":"https://boards.greenhouse.io/0x/jobs/4338282002","title":"Don't See What You're Looking For?","location":"San Francisco, Remote"}
{"company":"0x","url":"https://boards.greenhouse.io/0x/jobs/4993063002","title":"Engineering Manager — Maker","location":"San Francisco, Remote"}
{"company":"0x","url":"https://boards.greenhouse.io/0x/jobs/4029873002","title":"Integrations Engineer","location":"San Francisco, Remote"}
{"company":"0x","url":"https://boards.greenhouse.io/0x/jobs/5262491002","title":"Product Manager - 0x Liquidity","location":"San Francisco, Remote"}
{"company":"0x","url":"https://boards.greenhouse.io/0x/jobs/5262496002","title":"Product Manager - Matcha","location":"San Francisco, Remote"}
{"company":"0x","
#!/usr/bin/env ruby
require 'async/io'
require 'async/semaphore'
def scan_port(host, port, timeout)
Async do |task|
task.with_timeout(timeout) do
address = Async::IO::Address.tcp(host, port)
Async::IO::Socket.connect(address).close
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
require 'async'
require 'shodanz'
client = Shodanz.client.new
# Asynchronously stream banner info from shodan and check any
# IP addresses against the experimental honeypot scoring service.
client.streaming_api.banners do |banner|
if ip = banner['ip_str']
Async do
@picatz
picatz / ids_with_example_rules.rb
Created April 5, 2019 17:30
Simple IDS with example rules
require "packetgen"
class IDS
def initialize(interface: PacketGen.default_iface, &block)
@rules = {}
instance_eval &block
PacketGen.capture(iface: interface) do |packet|
@rules.each do |header, blocks|
next unless packet.is? header
blocks.each do |block|