Skip to content

Instantly share code, notes, and snippets.

@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'

2021 Retrospective

Based on An End of the Year Retrospective by Pat Kua.

What happened during your year?

Go through your planning tools (e.g. personal and work calendars, to-do lists, journals, etc) and list any events or activities (by month) of significance to you. Capture these as if you were a neutral bystander.

Examples might include: “Moved house”, “Took part in a virtual panel”, or “Read Lord of the Rings for the 2nd time”

@bradfitz
bradfitz / tailscale-acl.cue
Created May 2, 2021 04:59
Tailscale ACL schema WIP
import "net"
#Policy
#Policy: {
ACLs: [...#ACLRow]
Groups: #Groups
Hosts: #Hosts
TagOwners: [#TagName]: [...#TagOwner]
Tests: [...#ACLTest]

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@uogbuji
uogbuji / pixelbook-dev-setup.md
Last active May 17, 2024 00:35 — forked from cassiozen/pixelbook-dev-setup.md
Notes on setting up Pixelbook for development

Pixelbook or Pixel Slate Setup

Partly updated June 2023

General caution: Chrome OS is a secure OS by design, but this has at least one key consequence. If you change your Google account password, you will still be required to enter the old password the next time you access each Chrome OS device. Devices are encrypted with that password, so the OS needs to decrypt using the old password then re-encrypt using the new one. If you forget your old password you will lose access to your Chrome OS device data. As always, make sure you keep backups up to date.

Fast User Switching

If you have multiple Chrome OS accounts (Say, work and play), you can quickly sitch between them without logging out:

@crsimmons
crsimmons / credhub_backup.rb
Created May 17, 2018 16:52
Extract all credhub parameters into a yaml file in a format compatible with credhub import
require 'json'
require 'yaml'
json = JSON.parse(`credhub find -j`)
output = {
'credentials' => json['credentials'].map do |cred|
name = cred['name']
credential = JSON.parse(`credhub get -n #{name} -j`)
@shortjared
shortjared / list.txt
Last active May 20, 2024 07:26
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@jpswade
jpswade / devops_best_practices.md
Last active May 3, 2024 11:49
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, at the Agile Conference in Toronto, Andrew Shafer posted an offer to moderate an ad hoc "Birds of a Feather" meeting to discuss the topic of "Agile Infrastructure". Only one person showed up to discuss the topic: Patrick Debois. Their discussions and sharing of ideas with others advanced the concept of "agile systems administration". Debois and Shafer formed an Agile Systems Administrator group on Google, with limited success. Patrick Debois did a presentation called "Infrastructure and Operations" addressing

@m-richo
m-richo / cf-app-audit.sh
Last active December 12, 2017 22:15
query Cloud Foundry environment for all running applications and dump them into a CSV file
#!/bin/bash
set -eu
set -o pipefail
API_ENDPOINT=$(cf api |grep "endpoint" |awk -F "https://" '{print $2}')
rm -f $API_ENDPOINT.csv
echo "Running audit for $API_ENDPOINT"
echo "Output is in $API_ENDPOINT.csv"
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active May 21, 2024 05:57 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy