Skip to content

Instantly share code, notes, and snippets.

@tripplyons
tripplyons / run-searx.sh
Last active September 26, 2025 14:32
Free web search MCP using a local SearXNG instance
mkdir -p config data
cat > config/settings.yml << 'EOF'
server:
bind_address: "0.0.0.0"
secret_key: "secret"
search:
formats:
- html
- json
EOF

Imperative Computer Configuration is Playing a Losing Game

I often categorize games into the buckets of winning and losing games. Some games are both winning and losing games simultaneously, depending on your skill level. An example of this is the difference between amateur and pro tennis. When playing amateur tennis, you are usually playing a losing game. That is to mean, don't lose, and you will win! Most games of amateur tennis are decided by the player who has the least un forced errors. You will win the game by making fewer mistakes than your opponent.

The pros, on the other hand, is a much different story. When you watch two pro tennis players face off, they tend to make very few mistakes. This then becomes a winning game where you have to take an action to acheive victory instead of just try to minimize your mistakes.

Using imperative style configuration management tools like Ansible and docker are ultimately losing games.

Wait! I thought Ansible was Declarative and Idempotent

@francbartoli
francbartoli / fastapi_demo.py
Created June 2, 2019 13:08 — forked from wshayes/fastapi_demo.py
[FastAPI Single File Demo] Example fastapi single file testable example #fastapi
import logging
from fastapi import FastAPI
from starlette.responses import RedirectResponse
from starlette.testclient import TestClient
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
app = FastAPI()
@terabyte
terabyte / amazon.md
Created December 6, 2017 02:27
Amazon's Build System

Prologue

I wrote this answer on stackexchange, here: https://stackoverflow.com/posts/12597919/

It was wrongly deleted for containing "proprietary information" years later. I think that's bullshit so I am posting it here. Come at me.

The Question

Amazon is a SOA system with 100s of services (or so says Amazon Chief Technology Officer Werner Vogels). How do they handle build and release?

@beeman
beeman / remove-all-from-docker.sh
Created November 15, 2016 03:04
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@kartikkukreja
kartikkukreja / IterativeDeepeningAlphaBetaSearch.py
Created July 11, 2015 18:13
Iterative Deepening Alpha Beta Search
def iterativeDeepeningAlphaBeta(state, evaluationFunc):
startTime = time()
def alphaBetaSearch(state, alpha, beta, depth):
def maxValue(state, alpha, beta, depth):
val = -MaxUtility
for successor in state.getSuccessors():
val = max(val, alphaBetaSearch(successor, alpha, beta, depth))
if val >= beta: return val
alpha = max(alpha, val)