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
@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
@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
@imontesino
imontesino / zotero_setup.md
Last active August 22, 2025 16:30
Zotero + SyncThing + Zotfile + SciHub setup (Windows and Linux)

3x worker nodes with 50GB disk (where applicable), 1 load balancer (where applicable)

Provider Node Class Node Details CPU Node Node Disk LB Total EUR
Civo Medium 2vCPU 4GB RAM 50GB NVMe Dedicated 20 0 10 75.803
Digital Ocean Basic 2vCPU 4GB RAM 80GB SSD Shared 24 0 12 90.9636
GCP N1 Spot n1-standard-1, 50GB Disk Dedicated 8.03 5.5 0 32.043011
GCP N1 n1-standard-1, 50GB Disk Dedicated 26.72 5.5 0 92.761214
GCP E2 e2-medium, 50GB Disk Shared 26.93 5.5 0 93.443441
Scaleway* PLAY2 NANO Cost-Optimized- 2 - 4 GB Shared 19.71 4.31 14.6 80.814
@iamalbert
iamalbert / README.md
Last active November 30, 2023 22:39
Git skip LFS on local repo

Because GitKraken and SourceTree are FUCKING SLOW for repo with large LFS objects.

Need to completely skip LFS operation when pull/fetch/checkout/...

Skip downloading when clone

GIT_LFS_SKIP_SMUDGE=1 git clone SERVER-REPOSITORY

Skip downloading when fetch/checkout/pull

@staaldraad
staaldraad / awk_netstat.sh
Last active August 11, 2025 02:57
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){