Skip to content

Instantly share code, notes, and snippets.

@jerblack
jerblack / ceottk.py
Created May 26, 2018 18:06
Close Encounters with win32api beep in python
from win32api import Beep as b
# Close Encounters with win32api beep in python
# d4 e4 c4 c3 g3
# b(frequency, duration)
# thanks to https://forums.parallax.com/discussion/65026/close-encounter-tones
b(293, 1000)
b(329, 1000)
b(261, 1000)
b(130, 1000)
b(196, 2000)
@jerblack
jerblack / resize.cmd
Created May 27, 2018 05:31
Resize current command window in one line
python -c "import os; os.system('mode con: cols=75 lines=25')"
@jerblack
jerblack / junk_remover.ps
Last active May 28, 2018 19:16
Removing built-in Windows 10 apps
Get-AppxPackage *3dbuilder* | Remove-AppxPackage
Get-AppxPackage *3DViewer* -AllUsers | Remove-AppxPackage
Get-AppxPackage *windowsalarms* | Remove-AppxPackage
Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage
Get-AppxPackage *windowscamera* | Remove-AppxPackage
Get-AppxPackage *officehub* | Remove-AppxPackage
Get-AppxPackage *skypeapp* | Remove-AppxPackage
Get-AppxPackage *getstarted* | Remove-AppxPackage
Get-AppxPackage *gethelp* | Remove-AppxPackage
Get-AppxPackage *zunemusic* | Remove-AppxPackage
@jerblack
jerblack / append.py
Last active June 25, 2018 23:26
Append and Prepend, a pair of simple scripts to append or prepend text to a set of filenames
#!/usr/bin/python3
help = """Simple script to append text to specified files before the extension
usage: append (-n)(-i) "text to append" files
-n: dry-run, will show before and after filenames without making changes
-i: ignore file extensions and just append to the end of the filename
append " (2017)" *.docx
'outline.docx' -> 'outline (2017).docx'
append -i ".(DRAFT)" *
@jerblack
jerblack / print_table.py
Last active July 3, 2018 07:46
Python table printing function which will print a structured table with headers, defined column widths, automatic text wrapping in columns, and automatic table sizing to fit the table within the terminal width.
"""
print_table will print a structured table with headers, defined column widths, and automatic text wrapping in columns.
It will also determine the terminal width and reduce the column widths automatically so they all fit without wrapping outside of the table
print_table requires 3 parameters
headers: A list or tuple of headers (strings)
rows: A list of lists or tuples with table row information as strings
each entry in inner list maps to a column.
For a 3 column table, provide a list of lists or tuples with a length of 3
sizes: A list or tuple of integers specifying maximum column width for each column. Must provide a value for each column.
@jerblack
jerblack / Remove Forced User Folders in Windows.reg
Last active April 13, 2019 11:39
Remove Forced User Folders in Windows.
Windows Registry Editor Version 5.00
; removing libraries requires additional work you need to take ownership of the key and give yourself permissions to it first
; HKEY_CLASSES_ROOT\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}\ShellFolder
; Attributes (dword) b080010d -> b090010d
;Camera Roll
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{3B193882-D3AD-4eab-965A-69829D1FB59F}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{3B193882-D3AD-4eab-965A-69829D1FB59F}]
@jerblack
jerblack / StreamURI.md
Created September 2, 2019 21:23 — forked from chrisjmendez/StreamURI.md
Triton Audio streams for Classical KUSC and Classical KDFC

Stream URL's for Classical KUSC and Classical KDFC

New URL Pattern:

http://[bit rate].[encoder format].[file format].[call letters].live

Old URL Pattern:

@jerblack
jerblack / Latex Math.md
Created April 9, 2014 06:28
Markdown and Latex Syntax

Requires MathJax, Renders in Stackedit.io

<script type="text/javascript" src="https://stackedit.io/libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>

Math Symbols in Latex

||||||||||||||| :--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:| $$\sqrt{abc}$$\sqrt{abc}|$$\sqrt[n]{abc}$$\sqrt[n]{abc}|$$f'$$f'|$$\frac{abc}{xyz}$$\frac{abc}{xyz}|$$a^n$$a^n|$$a_n$$a_n| $$\lim_{x\to\infty}f(x)=0$$\lim_{x\to\infty}f(x)=0| $$\times$$\times|$$\div$$\div|$$\bullet$$\bullet|$$\bigcirc$$\bigcirc|$$\ast$$\ast|$$\circ$$\circ|$$+$$+|

@jerblack
jerblack / PendingFileRenameOperations.go
Created December 1, 2019 18:10
GoLang: Using PendingFileRenameOperations in the Windows Registry to delete/rename files on reboot with Go.
package main
import (
"fmt"
"golang.org/x/sys/windows"
"golang.org/x/sys/windows/registry"
"log"
"os"
"strings"
"syscall"
@jerblack
jerblack / 1_Remap Mouse and Keyboard in Ubuntu.md
Last active February 6, 2022 10:09
Remap Mouse and Keyboard in Ubuntu