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:
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 |
[ | |
{ | |
"type": "A", | |
"name": "@", | |
"value": "SOMEIP" | |
}, | |
{ | |
"type": "A", | |
"name": "*", | |
"value": "SOMEIP" |
I hereby claim:
To claim this, I am signing this object:
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:
deepsleep.sh
to a folder, such as /usr/bin
(In Terminal, type cp /PATH/TO/deepsleep.sh /usr/bin
)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
ALL ALL=NOPASSWD:/LOCATION/TO/deepsleep.sh
(so, for example, ALL ALL=NOPASSWD:/usr/bin/deepsleep.sh
)sudo /path/to/deepsleep.sh
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
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" |
:: 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" |
## ## ### ######## ## ## #### ## ## ###### | |
## ## ## ## ## ## ## ### ## ## ### ## ## ## | |
## ## ## ## ## ## ## #### ## ## #### ## ## | |
## ## ## ## ## ######## ## ## ## ## ## ## ## ## #### | |
## ## ## ######### ## ## ## #### ## ## #### ## ## | |
## ## ## ## ## ## ## ## ### ## ## ### ## ## | |
### ### ## ## ## ## ## ## #### ## ## ###### | |
# 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. |
@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 |
: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" |