This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // # AI Sed-like Tool | |
| // A Go script that behaves like sed but uses AI models to edit files. It can read from stdin or edit files in-place with the `-i` flag. The tool supports splitting files into sections using delimiters and can work with multiple AI providers. | |
| // ## Features | |
| // - Edit files in-place with the `-i` flag | |
| // - Read from stdin for pipe-based operations | |
| // - Support for multiple AI providers (OpenAI, Anthropic, OpenRouter, Vertex AI) | |
| // - Delimiter-based file sectioning for processing large files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import struct | |
| import datetime | |
| import sys | |
| def read_pcap_timestamps(filename): | |
| """ | |
| Quickly extract first and last packet timestamps from a pcap file | |
| by reading the binary structure directly. | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "debug/buildinfo" | |
| "encoding/json" | |
| "flag" | |
| "fmt" | |
| "log" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // use: | |
| // cat nested.json | go run . > flattenned.json | |
| package main | |
| import ( | |
| "bytes" | |
| "compress/gzip" | |
| "encoding/base64" | |
| "fmt" | |
| "io" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # recursively replace base64-encoded strings in a JSON file with the decoded string | |
| # usage: python main.py <input_file> <output_file> | |
| import sys | |
| import json | |
| import base64 | |
| def decode_json(data): | |
| if isinstance(data, dict): | |
| return {decode_json(key): decode_json(value) for key, value in data.items()} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/env python3 | |
| from bottle import Bottle, request, response, static_file | |
| import json | |
| import xml.etree.ElementTree as ET | |
| from datetime import datetime | |
| import pytz | |
| import os | |
| app = Bottle() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "testing" | |
| json "github.com/bytedance/sonic" | |
| "github.com/miekg/dns" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // email parser built to process large amounts of .tgz exports containing one or more .eml files inside | |
| package main | |
| import ( | |
| "archive/tar" | |
| "bytes" | |
| "compress/gzip" | |
| "crypto/sha256" | |
| "encoding/json" | |
| "fmt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "log" | |
| "net" | |
| "os" | |
| "strconv" | |
| "syscall" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| This script trys to add and delete records from cloudflare based on the current status of the account in tailscale, and eliminate the need for TailScale's magic DNS. | |
| Each domain will be created under a subdomain "SUBDOMAIN", that way it'll be easier to find and detele records. | |
| IMPORTANT: this script is not very well tested and it tries to DELETE some DNS records. Use it at your own risk, especially if your SUBDOMAIN value is generic and it's also used elsewhere in your domain. | |
| """ | |
| import os | |
| import requests |
NewerOlder