Skip to content

Instantly share code, notes, and snippets.

br b-

Block or report user

Report or block b-

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bloop.ahk
; br's personal ahk keyboard remappings
; https://github.com/b-/keyboard-customizer
; Released into the Public Domain via CC0 https://creativecommons.org/share-your-work/public-domain/cc0/
;;;;;
; Run as administrator (the scheduled task included will do so on startup) for this to work on applications also running as administrator.
; Otherwise, the keyboard mappings will simply not work.
#SingleInstance Force
#InstallKeybdHook
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
View onactivate.ahk
if WinActive("ahk_class SynergyDesk")
{
; We want to reload ONCE
EnvGet, IsReloading, IsReloading
if ( IsReloading = "true" ) ; we're already reloading
{
EnvSet, IsReloading, "false"
WinWaitNotActive, ahk_class SynergyDesk
} ; so don't reload again
else
View json.json
[
{
"type": "A",
"name": "@",
"value": "SOMEIP"
},
{
"type": "A",
"name": "*",
"value": "SOMEIP"
View keybase.md

Keybase proof

I hereby claim:

  • I am b- on github.
  • I am bri_ (https://keybase.io/bri_) on keybase.
  • I have a public key ASBsq_j5i0cOXxjgON7NuwkNg9RmTt333Pl5FGLOqXhwNgo

To claim this, I am signing this object:

@b-
b- / decrement mouse speed.applescript
Created Oct 30, 2017
Increment/Decrement Mouse speed
View decrement mouse speed.applescript
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
set trackingDelta to -1 --decrease
--Open and activate System Preferences
tell application "System Preferences" to activate
--Attempt to change settings using System Events
tell application "System Events"
tell process "System Preferences"
@b-
b- / Name-of-ps1.bat
Created Aug 21, 2017
PowerShell batch glue
View Name-of-ps1.bat
:: I didn't do any testing on this. In fact, I typed it on my iPhone. There is probably something wrong with it. But I've typed this so many times I have muscle memory, hence my putting it up here.
:: Name this file (ps1-file-without-extension).bat, so if you have a script "myscript.ps1" you'd name this file "myscript.bat"
:: Flags and shit are optional. Read the PowerShell manual for more info. I think there's one called "windowstyle" or something which can be pretty useful.
:: n.b. this is a Windows batch file. Maybe I'm crazy, but I actually like PowerShell on *nix. However, this will not work on *nix.
:: I *think* that since PowerShell uses # to denote comments you could stick a shebang (e.g., `#!/usr/bin/powershell`) but I'm not sure if there really is a standardized install path, nor do I know if `#!/usr/bin/env powershell` would work, either. (Maybe I should give up powershell on *nix and just learn Python...)
::@echo off
set "flags=-executionPolicy bypass"
@b-
b- / wipeharddriveswithoutasking.ps1
Created Dec 2, 2016
Wipe "USB 3.0*" disks in PowerShell
View wipeharddriveswithoutasking.ps1
## ## ### ######## ## ## #### ## ## ######
## ## ## ## ## ## ## ### ## ## ### ## ## ##
## ## ## ## ## ## ## #### ## ## #### ## ##
## ## ## ## ## ######## ## ## ## ## ## ## ## ## ####
## ## ## ######### ## ## ## #### ## ## #### ## ##
## ## ## ## ## ## ## ## ### ## ## ### ## ##
### ### ## ## ## ## ## ## #### ## ## ######
# This script WILL unrecoverably erase any drives that meet the criteria directly below.
# It will not ask for permission.
# It's probably a bad idea.
@b-
b- / _deepsleep.sh.md
Last active Sep 4, 2018
Hibernate macOS computer
View _deepsleep.sh.md

deepsleep.sh: hibernate macOS computer

There is no easy way to hibernate a macOS computer on demand. This utility fixes that problem. This command must be run as root, but there's an easy way to fix that:

  • Copy deepsleep.sh to a folder, such as /usr/bin (In Terminal, type cp /PATH/TO/deepsleep.sh /usr/bin)
  • In Terminal, type: sudo visudo to edit the /etc/sudoers file. DO NOT edit this file with another command. If you do not like vi you can type export VISUAL=nano first to tell visudo to use nano
  • Add a line anywhere in the file (I recommend either the very beginning or very end) that says ALL ALL=NOPASSWD:/LOCATION/TO/deepsleep.sh (so, for example, ALL ALL=NOPASSWD:/usr/bin/deepsleep.sh)
  • Run the command using sudo /path/to/deepsleep.sh

WARNING:

If you wake the computer before it's finished hibernating, this script will leave it in a bad spot where it will hibernate every time you tell it to go to sleep. To fix this, type sudo pmset -a hibernatemode 3 or `sudo path/to/deeps

@b-
b- / makertf.bat
Last active Sep 6, 2016
make RTF from input ASCII text file
View makertf.bat
@echo off
set input="%~1"
set output="%~1.rtf"
::RTF header and font table (Courier New)
echo {\rtf1\ansi\deff0\nouicompat{\fonttbl{\f0\fnil\fcharset0 Courier New;}} > %output%
::page setup settings (landscape, legal, 0.5" margins)
echo \landscape >> %output%
::Paper width and height and margins in "twips", or 20ths of a point, or 1/1440ths of an inch
::So legal paper (oriented in landscape) would be (14 inches * 1440 twips in an inch)=20160 twips long
@b-
b- / exec.bat
Last active Aug 29, 2015
deluge execute script
View exec.bat
:addtorrents %torrentid% %torrentname% %torrentpath%
::Copies any MP3 files, any M4A files, and any PDF files
::::(ONLY copies PDFs if MP3 and/or M4A files are found)
::::to the folder D:\autoadd, and adds a line to
::::%userprofile%\Music\deluge-script.log with the date/time of script run
setlocal
set torrentid=%1
set torrentname=%2
set torrentpath=%3
set "log=%userprofile%\Music\deluge-script.log"
You can’t perform that action at this time.