Skip to content

Instantly share code, notes, and snippets.

View fishi0x01's full-sized avatar
💾
0x01

Karl Fischer fishi0x01

💾
0x01
View GitHub Profile
@fishi0x01
fishi0x01 / bw_msrmnt.c
Last active November 17, 2023 07:44
Measuring Bandwidth and Round-Trip Time of a TCP Connection inside the Application Layer. Code for blog post https://fishi.devtail.io/weblog/2015/04/12/measuring-bandwidth-and-round-trip-time-tcp-connection-inside-application-layer/
/* Code snippet for measuring bandwidth with harmonic mean */
#define SKIPS 10 // initial measurement skips - skip the first slow-start values
// bandwidth metrics
double bandwidth = -1; // in MB/s
float total_bytes = 0;
int n = 0; // number of measure values
int skips = SKIPS;
@fishi0x01
fishi0x01 / baseURL.groovy
Last active June 15, 2023 19:55
This is a collection of groovy scripts I gathered and use for bootstrapping Jenkins. Most of this can also be achieved with the CasC Plugin https://github.com/jenkinsci/configuration-as-code-plugin
#!groovy
/*
* This script configures the Jenkins base URL.
*/
import jenkins.model.JenkinsLocationConfiguration
JenkinsLocationConfiguration location = Jenkins.instance.getExtensionList('jenkins.model.JenkinsLocationConfiguration')[0]
location.url = 'https://jenkins-as-code-poc.devtail.io/'
@fishi0x01
fishi0x01 / homebrew.md
Last active February 21, 2023 10:32
bump vsh version
  1. Install brew locally.
  2. Make sure this repo exists: $(brew --repository homebrew/core)
  3. Make sure the fork exists in $(brew --repository homebrew/core)
cd $(brew --repository homebrew/core)
brew bump-formula-pr --sha256 713d8f8901c7fc3b2c9c620ce928fa17e3b5a5f949d0dd37ad5ad48ae46dab4b --url https://github.com/fishi0x01/vsh/archive/refs/tags/v0.12.2.tar.gz vsh

You need a github API token -> the tool will generate a link to create one.

https://github.com/fishi0x01/k8s-manifests 98606b177fdbe4305035abd3d38dcf844d8cca0e
@fishi0x01
fishi0x01 / luks-encryption.md
Last active January 5, 2022 18:28
Creating an encrypted drive with cryptsetup

Ensure to select the proper drive

fdisk -l
lsblk

Setup encryption

Assuming sdX is the device to encrypt

@fishi0x01
fishi0x01 / header.sh
Last active November 11, 2021 15:02
Dynamic login messages with update-motd framework. Code for blog post https://fishi.devtail.io/weblog/2015/02/06/dyamic-login-messages-update-motd/
# Simple static header for update-motd framework
COLOR_GREEN="\033[0;32m"
# print personal static banner in green
printf "${COLOR_GREEN}
_____ .__ .__ .__
_/ ____\|__| ______| |__ |__|
\ __\ | | / ___/| | \ | |
| | | | \___ \ | Y \| |
@fishi0x01
fishi0x01 / dashboard.tf
Created April 22, 2021 14:11
Terraform Datadog Debug
This file has been truncated, but you can view the full file.
terraform {
required_providers {
datadog = {
source = "DataDog/datadog"
version = "2.25.0"
}
}
}
@fishi0x01
fishi0x01 / dcom-access-x64.ps1
Last active March 4, 2021 07:38
Script to configure DCOM remote access on Windows machines. Code for blog post https://fishi.devtail.io/weblog/2015/01/16/enabling-dcom-windows-7-8-and-server-2012/
# Original script taken and modified from http://shrekpoint.blogspot.de/2012/08/taking-ownership-of-dcom-registry.html
#
# Enable remote DCOM access to the WbemScripting.SWbemLocator class on 64-bit Windows 7/8 and Server 2012 machines,
# by setting the necessary keys inside the registry.
# Use this script at your own risk.
# I do not guarantee that it works, nor do I give any kinds of support in case it doesn't
Try {
[void][TokenAdjuster]
} Catch {
@fishi0x01
fishi0x01 / setup_rpi_openocd.md
Created February 13, 2021 09:36 — forked from tstellanova/setup_rpi_openocd.md
Setup rpi0 with openocd for flashing nrf52

Instructions for setting up a Raspberry Pi Zero for running OpenOCD specifically for the purpose of disabling Access Port Protection on nrf52 boards.

Build OpenOCD with CMSIS-DAP and GPIO support

The below script builds natively on the RPi0, and will take a very long time.

sudo apt install wget git autoconf libtool make pkg-config libusb-1.0-0 libusb-1.0-0-dev libhidapi-dev libftdi-dev libhidapi-dev telnet
git clone https://github.com/ntfreak/openocd
cd openocd
./bootstrap
#! /bin/bash
usage() {
echo "measureTraffic.sh <targetIP>"
}
if [ -z "$1" ]; then
usage
exit 1
fi