Skip to content

Instantly share code, notes, and snippets.


Immanuel Potter immanuelpotter

View GitHub Profile
usage() {
echo "$0 [SRC] [DST]"
echo "Example iCloud path: /Users/$(whoami)/Library/Mobile Documents/com~apple~CloudDocs/"
exit 99
[[ -z "$1" || -z "$2" ]] && usage
immanuelpotter /
Last active Dec 16, 2020
# Reads a list of profile names from a file in the local directory. Example provided.
set -e
# If a profiles.txt file doesn't exist in the current dir, fail.
[[ -f profiles.txt ]] && echo "profiles.txt found, continuing..." || echo "Please provide a profiles.txt with profile names separated by new lines."
immanuelpotter /
Created Sep 15, 2020
Get MFA code for a TOTP String, right now
#!/usr/bin/env python
import pyotp
import argparse
parser = argparse.ArgumentParser(description='Get the TOTP code, for an MFA string, right now.')
parser.add_argument('mfa_string', metavar='mfa_string', type=str, help='The MFA string to get the current totp code for.')
args = parser.parse_args()
View .zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/$(whoami)/.oh-my-zsh"
# Keep history, forever
# Set name of the theme to load --- if set to "random", it will
immanuelpotter /
Created May 28, 2020
Sending & receiving messages from Azure ServiceBus.
#!/usr/bin/env python
from azure.servicebus import QueueClient, Message
import sys, os
def main():
if 'SERVICEBUS_CONN_STRING' in os.environ:
connection_string = os.getenv("SERVICEBUS_CONN_STRING")
print("Please provide connection string as envvar: SERVICEBUS_CONN_STRING")
immanuelpotter /
Last active Apr 24, 2020
Testing out PAT tokens can hit required endpoints they need to get to in Azure DevOps.
#!/usr/bin/env python
import requests
import sys
import pprint
import base64
def encode_string(token):
to_encode_string = "Basic:" + token
encoded_str = base64.b64encode(to_encode_string.encode()).decode('utf-8')
immanuelpotter /
Last active Feb 11, 2020
Scripting dataset generation using TPC-H toolset in amazon linux, for a record of how it was done
# Ensure an S3 full access role is attached.
# Install TPC-H benchmarking tools on an rpm-based Linux machine, and generate two datasets: 10GB and 40GB of tabular data respectively.
# Create a bucket for storage of the generated data and upload to S3.
# Install tools
sudo yum install -y make git gcc
git clone
View gist:91e22525d21c337f0504a814f17b38aa
### Keybase proof
I hereby claim:
* I am immanuelpotter on github.
* I am immanuelpotter ( on keybase.
* I have a public key ASC6arnPIwraZCSzMt9Cvhvw1RPU-M4Jz3EQB_Ry4jGp3go
To claim this, I am signing this object:
immanuelpotter / schedule-task.ps1
Last active Sep 4, 2019
View schedule-task.ps1
$action = New-ScheduledTaskAction -Execute "powershell" -Argument " we -File C:\Users\Administrator\Documents\WindowsPowerShell\write-ram-cw-custom-metric.ps1 -ExecutionPolicy bypass"
$trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes 1)
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "CustomRAMCloudWatchMetricWrite" -Description "Logging percentage free memory to CloudWatch for this instance"
View cookie-signer.js