Skip to content

Instantly share code, notes, and snippets.

{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Alexander Bason",
"label": "Red Team Operator",
"image": "",
"email": "[email protected]",
"phone": "(530) 675-4199",
"url": "https://nonsleepr.github.io/",
"summary": "Highly skilled Red Team Operator and Security Researcher with demonstrated\nexpertise in advanced persistent threat emulation and critical\nvulnerability discovery, backed by close to 20 years of software\nengineering experience. Track record of discovering multiple high-impact\nCVEs and successfully compromising complex enterprise environments through\ncustom exploit development, Active Directory attacks, and cloud\ninfrastructure exploitation. Proven ability to develop offensive tooling,\nautomate attack frameworks, and deliver technical mentorship to engineering\nteams. Combines deep technical knowledge in both offensive security and\nsoftware development to identify and exploit vulnerabiliti
@nonsleepr
nonsleepr / docker-compose.yml
Last active September 24, 2024 22:41
Piped on Tailscale
services:
piped-frontend:
image: 1337kavin/piped-frontend:latest
restart: unless-stopped
depends_on:
- piped-backend
container_name: piped-frontend
entrypoint: ""
command:
- /bin/sh
@nonsleepr
nonsleepr / flake.nix
Created September 22, 2024 13:31
LXD container for AdGuardHome capable running with cgroups v1
# Install with:
# incus image import --alias nixos/adguard-home \
# $(nix build .#nixosConfigurations.adguard-home.config.system.build.metadata --print-out-paths)/tarball/nixos-system-x86_64-linux.tar.xz \
# $(nix build .#nixosConfigurations.adguard-home.config.system.build.tarball --print-out-paths)/tarball/nixos-system-x86_64-linux.tar.xz
{
description = "AdGuardHome Container";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; # The systemd supporting cgroups v1
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
@nonsleepr
nonsleepr / officepy_repl.py
Created September 6, 2023 16:10
OfficePy REPL
import requests
from io import BytesIO
import sys
import json
OFFICEPY_HOST = "service-preview-p1-eastus2.officepy.microsoftusercontent.com"
USER_AGENT = "Microsoft Office/16.0 (Windows NT 10.0; Microsoft Excel 16.0.16827; Pro)"
GREEN = '\033[32m'

Keybase proof

I hereby claim:

  • I am nonsleepr on github.

  • I am nonsleepr (https://keybase.io/nonsleepr) on keybase.

  • I have a public key ASD2K73fCmJ6Ruf8af6CwpPQKYiBD3vk2tdhKIG1qydczgo

@nonsleepr
nonsleepr / demo.py
Created July 5, 2018 21:13
Multiplexer for trio: my take on python-trio/trio#467
import trio
from multiplexer import Multiplexer
async def reader(mx, key, timeout=100):
print(f'Waiting for "{key}"...')
try:
with trio.fail_after(timeout):
value = await mx[key]
print(f'Got value "{value}" for key {key}')
@nonsleepr
nonsleepr / Makefile
Created March 27, 2015 15:40
Makefile to download Kaggle's datasets
# Requires presence of credentials.txt file containing login/password in the following format:
# UserName=my_username&Password=my_password
COMPETITION=diabetic-retinopathy-detection
all: download_files
session.cookie: credentials.txt
curl -o /dev/null -c session.cookie https://www.kaggle.com/account/login
curl -o /dev/null -c session.cookie -b session.cookie -L -d @credentials.txt https://www.kaggle.com/account/login
@nonsleepr
nonsleepr / tokenizer.R
Created February 12, 2015 21:58
N-gram tokenizer function without any Java dependencies (like in RWeka)
ngrams.tokenizer <- function(x, n = 2) {
trim <- function(x) gsub("(^\\s+|\\s+$)", "", x)
terms <- strsplit(trim(x), split = "\\s+")[[1]]
ngrams <- vector()
if (length(terms) >= n) {
for (i in n:length(terms)) {
ngram <- paste(terms[(i-n+1):i], collapse = " ")
ngrams <- c(ngrams,ngram)
}
}
@nonsleepr
nonsleepr / kfold.R
Last active August 29, 2015 14:06
Implementation of K-fold cross validation
require(plyr)
kfold <- function(df, k, train.f, predict.f) {
progress.bar <- create_progress_bar("text")
progress.bar$init(k)
N <- nrow(df)
subsample.id <- sample(1:k, N, replace = TRUE)
r <- vector(length = N)
@nonsleepr
nonsleepr / kaggle.R
Created September 24, 2014 15:42
Set of functions to download datasets from Kaggle
### Set of functions to download datasets from Kaggle
# Usage:
#
# > train <- kaggle_get_file("train.csv",
# + competition.name = "titanic-gettingStarted",
# + username = "username",
# + password = "password")
#
# > head(train, n = 2)