Skip to content

Instantly share code, notes, and snippets.

View sachajw's full-sized avatar
💭
Have you tried turning it off and on again?

Sacha Wharton sachajw

💭
Have you tried turning it off and on again?
View GitHub Profile
import os
import json
import datetime
from flask import Flask, url_for, redirect, \
render_template, session, request
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager, login_required, login_user, \
logout_user, current_user, UserMixin
from requests_oauthlib import OAuth2Session
@sachajw
sachajw / all.txt
Created July 31, 2020 18:15 — forked from jhaddix/all.txt
all wordlists from every dns enumeration tool... ever. Please excuse the lewd entries =/
This file has been truncated, but you can view the full file.
.
..
........
@
*
*.*
*.*.*
🐎

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@sachajw
sachajw / awk_netstat.sh
Created July 30, 2021 13:04 — forked from staaldraad/awk_netstat.sh
AWK to get details from /proc/net/tcp and /proc/net/udp when netstat and lsof are not available
# Gawk version
# Remote
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($3,index($3,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($3,i,2))}{print x":"strtonum("0x"substr($3,index($3,":")+1,4))}'
# Local
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($2,index($2,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($2,i,2))}{print x":"strtonum("0x"substr($2,index($2,":")+1,4))}'
# No Gawk
# Local
grep -v "rem_address" /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){
@sachajw
sachajw / ai-open-source-stack.md
Last active May 20, 2025 17:16
Ai Open Source Stack

Layer Cake Architecture View

The following diagram represents the stack as a layer cake architecture, with uniform layers stacked on top of each other:

%%{init: {'theme': 'forest'}}%%
flowchart TD
    %% Layer styling with distinct colors for each layer
    classDef frontendLayer fill:#e6f7ff,stroke:#1890ff,stroke-width:4px,color:#0050b3,font-weight:bold
    classDef ragLayer fill:#f6ffed,stroke:#52c41a,stroke-width:4px,color:#135200,font-weight:bold
@sachajw
sachajw / ZOTERO_SYNCTHING_SETUP.md
Created August 22, 2025 17:21
Sync Zotero between two Macs with Syncthing

Syncing Zotero Between Two Computers Using SyncThing

This guide shows you how to sync Zotero's PDF attachments and files between two computers (macOS or Windows) using SyncThing while keeping the database sync through Zotero's built-in service.

Prerequisites

  • Two computers (macOS/Windows) on the same local network
  • Zotero installed on both machines
  • SyncThing installed on both machines