Skip to content

Instantly share code, notes, and snippets.

@rodneyshupe
rodneyshupe / create-sshkey.sh
Created November 3, 2019 21:11
Bash function to create a SSH key and upload to Lastpass using the Lastpass CLI.
# Usage: create-sshkey KEYNAME PASSPHRASE [COMMENT]
# KEYNAME = The file name used for the key.
# PASSPHRASE = The pass phrase to be used. If you wish to not use a passphrase just use a blank string (i.e. "")
# COMMENT = Optional Comment. If skipped the KEYNAME will be used.
#
# Example: create-sshkey my_secret.key "This is my secret passphrase" "An example key."
function create-sshkey() {
KEYNAME=$1
PASSPHRASE=$2
COMMENT=${3:-$KEYNAME}
@jhays
jhays / characteristic.js
Created October 17, 2019 19:05
A sample BLE peripheral service and characteristic for use with Node.js and bleno.
/* characteristic.js
* A simple custom BLE peripheral characteristic for use with Node.js and bleno.
* This characteristic supports read, write, and notify properties.
* Julian Hays - 10/14/19
*/
var util = require('util');
var bleno = require('bleno-mac'); //or 'bleno-mac' if you are using that
var BlenoCharacteristic = bleno.Characteristic;
@oskar456
oskar456 / wgcf.py
Last active September 27, 2025 02:47
Cloudflare WARP linux client (using wg-quick for actual tunnel setup)
#!/usr/bin/env python3
import subprocess
import json
import os
from pathlib import Path
import requests
from requests.compat import urljoin
const bleno = require("@abandonware/bleno");
const CALCULATOR_SERVICE_UUID = "00010000-89BD-43C8-9231-40F6E305F96D";
const ARGUMENT_1_UUID = "00010001-89BD-43C8-9231-40F6E305F96D";
const ARGUMENT_2_UUID = "00010002-89BD-43C8-9231-40F6E305F96D";
const RESULT_UUID = "00010010-89BD-43C8-9231-40F6E305F96D";
class ArgumentCharacteristic extends bleno.Characteristic {
constructor(uuid, name) {
super({
@Geertvdc
Geertvdc / bearertoken.http
Created September 19, 2019 14:26
Get Bearer Token REST Client call
# @name auth
POST https://login.microsoftonline.com/{{tenantId}}/oauth2/v2.0/token HTTP/1.1
Content-type: application/x-www-form-urlencoded
grant_type=client_credentials
&client_id={{clientId}}
&client_secret={{clientSecret}}
&scope={{scope}}
@magickatt
magickatt / github_clone_using_token.sh
Created September 6, 2019 17:31
Clone a GitHub repository using a Personal Access Token
export GITHUB_USER=magickatt
export GITHUB_TOKEN=secret
export GITHUB_REPOSITORY=magickatt/ContainerisingLegacyApplicationsTalk
git clone https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
@yokawasa
yokawasa / aks-cheat-sheet.md
Last active March 20, 2026 09:21
Azure Kubernetes Services Cheat Sheet
Function Out-GridViewCode{
<#
.SYNOPSIS
Sends output to an interactive table in a separate window. With extended support to display Out-GridView as main window when using VS Code
.DESCRIPTION
The Out-GridView cmdlet sends the output from a command to a grid view window where the output is displayed in an interactive table. However, when you use VS Code the window appears in the background. Running this wrapper will bring the window to the front.
Parameters remain the same as the orginal Out-GridView
@urish
urish / circuitpython-mouse-hid-hello.py
Last active June 12, 2024 17:16
Open "MSPaint", set the foreground color to black, background color to red, and then run this script. Enjoy!
import time
import board
import digitalio
from adafruit_hid.mouse import Mouse
print("Hello!")
led = digitalio.DigitalInOut(board.LED1)
led.direction = digitalio.Direction.OUTPUT
led.value = False
@superseb
superseb / minio-letsencrypt.sh
Last active June 18, 2026 05:54
Minio using Let's Encrypt certbot obtained certificates
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 fqdn email"
exit 1
fi
docker run -p 80:80 -p 443:443 -v /etc/letsencrypt:/etc/letsencrypt certbot/certbot certonly --standalone --agree-tos --reinstall --force-renewal --non-interactive --text --rsa-key-size 4096 --email $2 --domains $1
mkdir -p /root/.minio/certs
cp /etc/letsencrypt/live/$1/fullchain.pem /root/.minio/certs/public.crt