Skip to content

Instantly share code, notes, and snippets.

; Autohotkey hotstrings for HTML4 entities (plus extras)
; Autohotkey Script Copyright © Tet-Woo Lee 2020, released to public domain under CC0
; 2020-05-04 version 1.0.3
; save as UTF-8 with signature
; Changelog:
; v1.0.3:
; added ? flag so all can be part of a word
; v1.0.2:
; added nlt, ngt, Gt, Lt, numsp

Useful commands in Windows

Run a batch file everytime a command prompt starts:

reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_EXPAND_SZ /d x:\cmd_init.bat /f

To delete:

reg delete "HKCU\Software\Microsoft\Command Processor" /v AutoRun

Useful commands in Linux

For copying files keeping modtime, easiest to use rsync: rync -trv [source] [target] (times, recursive, verbose) Add -n for dry-run.

For queuing tasks:

  1. Install task spooler sudo apt-get install task-spooler
  2. Queue commands with tsp {command}
  3. To mail result, add TS_MAILTO: export TS_MAILTO=address@domain
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 2018-05-19
# Copyright (c) 2018 Tet Woo Lee
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
-*/_del */
-System Volume Information/
@echo Creates a scheduled task to run the ChangeActiveHours.bat file to prevent auto-restarts in Win10
@echo Usage: CreateTaskChangeActiveHours.bat /ru "ComputerName\Username" /rp
@schtasks /create /xml "ChangeActiveHours.xml" /tn ChangeActiveHours %1 %2 %3 %4
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="">
<Author>Tet Woo Lee</Author>
:: ChangeActiveHours
:: Setting Active Hours Start (AHS) and End (AHE) times to 1 hour before the current time through 9 hours after the current time, i.e. a total of 10 hours window
:: Source:
:: Tet Woo Lee Bugfix, GTR 23 instead of 24 for correct behaviour at 15:00 + 9hrs = 24:00 -> 0:00
@ECHO off
set /a AHS=%time:~0,2%-1
IF %AHS% LSS 0 set /a AHS=%AHS%+24
set /a AHE=%time:~0,2%+9
IF %AHE% GTR 23 set /a AHE=%AHE%-24