Skip to content

Instantly share code, notes, and snippets.

View jippi's full-sized avatar

Christian Winther jippi

View GitHub Profile
@thpham
thpham / migration.sh
Created March 27, 2015 12:05
Consul.io Leader discovery and election to invoque migration...
# check if leader exist (means associated session with the )
hasSession=$(curl -s http://localhost:8500/v1/kv/service/migration/leader | jq -r .[] | jq 'has("Session")')
if [ -z "$hasSession" ] || [ "$hasSession" = false ]; then
# create session
session=$(curl -s -X PUT -d '{"Name": "migration"}' http://localhost:8500/v1/session/create | jq -r .ID)
echo "session=$session"
leaderValue=$(curl -s http://localhost:8500/v1/kv/service/migration/leader | jq -r .[].Value | base64 --decode)
echo "leaderValue=$leaderValue"
if [ -z "$leaderValue" ] || [ "$leaderValue" != "JOB_DONE" ]; then
# try to put a lock
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active February 5, 2026 06:11
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@lefthand
lefthand / rundeck-execution-trip
Created March 21, 2017 23:26
Shell script that will remove old Rundeck executions
#!/bin/bash
# for rundeck with mysql db
# keep last X executions for each job
KEEP=300
cd /var/lib/rundeck/logs/rundeck
JOBS=`find . -maxdepth 3 -path "*/job/*" -type d`
@cutiful
cutiful / mastodon-ip.md
Last active August 31, 2025 17:41
Detecting the real IP of a Cloudflare'd Mastodon instance

Detecting the real IP of a Cloudflare'd Mastodon instance

NB: This will not work for instances that proxy outgoing requests!

Reading the docs

I wanted to find a way to detect the real IP address of a Mastodon/Pleroma/Misskey/etc instance hosted behind Cloudflare. How to do that? Well, it's federated, which means I can probably get it to send a request to a server of mine! And how to do that? I tried reading the ActivityPub spec. The following caught my attention:

Servers should not trust client submitted content, and federated servers also should not trust content received from a server other than the content's origin without some form of verification.