Skip to content

Instantly share code, notes, and snippets.

View tfolbrecht's full-sized avatar
🤠
New boot goofin

tfolbrecht

🤠
New boot goofin
View GitHub Profile
@chocolatkey
chocolatkey / README.MD
Last active April 8, 2023 08:13
Cloudflare S2 Browser Isolation Trace

This is just some quick data from the CF browser isolation beta. If you inspect the isolated webpage, there's a debug-sidebar you can add a show class to to make visible. From there, you can run a trace and get some info about the machines these VMs are on. These are the stubs of the metadata elements of two random traces I made.

P.S. no exploits found yet ;)

@adam-hanna
adam-hanna / systemd-cloudwatch-logs-tutorial.md
Last active June 3, 2025 21:33
Forward systemd service logs to AWS Cloudwatch

Introduction

I often find myself ssh'ing into my servers and checking my systemd service logs with $ journalctl -f -u {name}.service. One day I got tired of this and wanted all of my important logs in once place (Amazon AWS Cloudwatch). To my dismay, there weren't any real good tutorials on how to do so. So, voilà.

Steps

Overall, it's a fairly simple process consisting of the following few steps.

1. Modify the service file

Open the service file with $ sudo vi /lib/systemd/system/{name}.service

Modify the [Service] section:

@ad8e
ad8e / glfw_ship.cpp
Last active June 2, 2025 12:28
instructions to use skia and glfw together. (download, installation, first program). as of Sept 2023, Windows is broken but this is still sadly the best starting resource for skia on Windows too.
/* Note: this Google copyright notice only applies to the original file, which has large sections copy-pasted here. my changes are under CC0 (public domain).
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
The official instructions don't work well. These alternative instructions are intended to be the shortest path to get a minimal setup running.
@totomz
totomz / send-to-cloudwatch.sh
Last active September 11, 2023 08:37
A simple script to push a JSON log to AWS CLoudWatch
#!/bin/bash
AWS_REGION="--region XXX_REGION"
AWS_PROFILE="--profile XXX_PROFILE"
LOG_GROUP="XXX_YOUR_LOG_GROUP"
LOG_STREAM="$(whoami)-$( date "+%Y%m%d-%H-%M-%S")"
aws logs create-log-stream --log-group-name $LOG_GROUP --log-stream-name $LOG_STREAM $AWS_REGION $AWS_PROFILE
@mcdickenson
mcdickenson / blur_faces.py
Created July 21, 2017 17:52
Blur faces in imagery with Google Cloud Vision
import cv2
import io
import json
import numpy as np
import os
from google.cloud import vision
from PIL import Image, ImageDraw
from StringIO import StringIO
@simonw
simonw / recover_source_code.md
Last active September 28, 2024 08:10
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@harababurel
harababurel / tellphone.sh
Last active June 17, 2024 13:37
Small script for sending notifications to phone using kde-connect.
#!/bin/bash
command -v kdeconnect-cli >/dev/null 2>&1 || { echo >&2 "kdeconnect is not installed. Aborting."; exit 1; }
if [ $# -eq 0 ]; then
echo "Usage: $0 <message>"
exit 1
fi
device=`kdeconnect-cli -a --id-only 2>/dev/null | head`
@rjcorwin
rjcorwin / wpa2-wifi-connect.sh
Last active April 26, 2022 23:07
A simple `wifi` command for Debian that will connect you to a WPA2 WiFi network
#!/bin/sh
## A simple `wifi` command for Debian that will connect you to a WPA2 WiFi network
## usage:
## sudo ./wpa2-wifi-connect.sh <ssid> <pass>
ifdown wlan0
# build the interfaces file that will point to the file that holds our configuration
rm /etc/network/interfaces
touch /etc/network/interfaces