Skip to content

Instantly share code, notes, and snippets.

View hotpocket's full-sized avatar

Brandon hotpocket

View GitHub Profile
@hotpocket
hotpocket / keychronctl.sh
Last active October 9, 2025 21:38
keychron enable / disable bash function so it can be modified via keychron's web UI
# this creates a (ba)sh function, so if you want to use it source it in your shell.
# Or copy it into it for a one time use
# enable/disable keychron keyboard to be editable from the web UI
# e.g. Don't trust the web UI to modify my keyboard by default
keychronctl() {
local action=$1
echo "🔍 Scanning Keychron devices (excluding 'Link' interfaces)..."
@hotpocket
hotpocket / Clean-OrphanedProfiles.ps1
Last active September 17, 2025 18:20
find orphaned windows users
# Notes. -- Some useful windows commands I used recently
# shutdown no hibernate: `shutdown /s /t 0`
# turn off hibernate: `powercfg /h off`
# User profile info: `Get-CimInstance Win32_UserProfile | Select-Object LocalPath, SID, Loaded, Special`
# Allow powershell script execution: `Set-ExecutionPolicy -Scope Process RemoteSigned`
# Get all local users (to match SIDs)
$localUsers = Get-LocalUser | Select-Object Name, SID
@hotpocket
hotpocket / init-letsencrypt.sh
Created June 8, 2024 06:00 — forked from mandiwise/init-letsencrypt.sh
Create dummy certificates to start up nginx so it can request real certificate from Let's Encrypt
#!/bin/bash
# Usage:
# $ chmod +x init-letsencrypt.sh
# $ init-letsencrypt.sh mydomain.com [email protected] 1
#
# Reference:
# https://medium.com/@pentacent/nginx-and-lets-encrypt-with-docker-in-less-than-5-minutes-b4b8a60d3a71
domain=${1}
@hotpocket
hotpocket / designer.html
Last active August 29, 2015 14:21
designer
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@hotpocket
hotpocket / style-example
Created July 1, 2014 23:41
style pref. reformat
<?php
function usersearchAction(){
$result = $this->_helperUser->searchAction(
$this->_getParam('query'),
Zend_Json::decode($this->_getParam('option', '[]')),
$this->getDbSearchQuery();
);
$this->setData($result)->setSuccess(true);
}