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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# exfat_bootsector_checksum.py | |
# 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 |
:: 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: https://www.tenforums.com/windows-updates-activation/59724-how-prevent-automatic-restart-windows-10-anniversary-update-6.html#post858630 | |
:: 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 |
<?xml version="1.0" encoding="UTF-16"?> | |
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> | |
<RegistrationInfo> | |
<Author>Tet Woo Lee</Author> | |
<URI>\ChangeActiveHours</URI> | |
</RegistrationInfo> | |
<Triggers> | |
<CalendarTrigger> | |
<Repetition> | |
<Interval>PT1H</Interval> |
@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 |
-*/~* | |
-*/del/ | |
-*/_del/ | |
-*/_del */ | |
-*/desktop.ini | |
-*/Thumbs.db | |
-*/*.lnk | |
-*/*.tmp* | |
-$RECYCLE.BIN/ | |
-System Volume Information/ |
For copying files keeping modtime, easiest to use rsync: rync -trv [source] [target]
(times, recursive, verbose)
Add -n
for dry-run.
For queuing tasks:
sudo apt-get install task-spooler
tsp {command}
TS_MAILTO
: export TS_MAILTO=address@domain
A generic set of commands for PyPi and conda packaging:
See: https://packaging.python.org/tutorials/packaging-projects/
Create conda environment with latest versions of setuptools, wheel and twine:
conda create -n pypi-packaging setuptools wheel twine
; 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 |