Skip to content

Instantly share code, notes, and snippets.

(∪.∪ )...zzz


(∪.∪ )...zzz
View GitHub Profile
Hrxn / pwsh-EnvPaths.psm1
Last active Jun 23, 2022
PowerShell: module for the PATH system environment variable
View pwsh-EnvPaths.psm1
# PowerShell Module File
# Name: EnvPaths.psm1
# Desc: Module for handling of the 'Path' system environment variable
# Source:; Based on:
function Add-EnvPath {
[System.String] $Path,
Hrxn /
Created May 22, 2019
Windows: Rebuilding the WMI repository on Windows

Rebuild the WMI Repository

The WMI error can be due to a corrupted WMI repository folder. As such, rebuilding the WMI repository might also fix the Windows Management Instrumentation error. This is how you can rebuild the WMI repository.

  • Open the Command Prompt as administrator by selecting Command Prompt (Admin) on the Win + X menu.
  • Enter ‘net stop winmgmt’ in the Prompt, and press the Enter key.
  • Press the Windows key + R keyboard shortcut.
  • Input ‘System32’ in Run, and press the OK button.
  • Then open the wbem subfolder that’s in the System32 folder.
  • Right-click the Repository folder and select Rename.
Hrxn / EnvPaths.psm1
Created Dec 15, 2018 — forked from mkropat/EnvPaths.psm1
Pwsh: Module for Path Environment Variable
View EnvPaths.psm1
function Add-EnvPath {
[string] $Path,
[ValidateSet('Machine', 'User', 'Session')]
[string] $Container = 'Session'
if ($Container -ne 'Session') {
Hrxn /
Created Jun 4, 2018
Python: Tumblr Stats Info
import argparse, time, re
import pytumblr
ap = argparse.ArgumentParser(description=' Process a text file of Tumblr Blog URLs.')
ap.add_argument('input_file', metavar='FILE', type=str, help='specifies the text file to process')
ap.add_argument('-v', '--values', action='store_true', help='prints only the user-ids in FILE')
args = ap.parse_args()
# Use your account credentials here for API access (OAuth)
client = pytumblr.TumblrRestClient(
Hrxn /
Last active Jun 2, 2018
Python: Web Scraping
from requests_html import HTMLSession
import re
session = HTMLSession()
out_header = ('URL' + ';' + 'Account Name' + ';' + 'Displayed Full Name' + ';' + 'Submitted Posts'
+ ';' + 'Followers' + ';' + 'Postcount (Number)')
sel_handle = '#react-root > section > main > div > header > section > div:nth-of-type(1) > h1'
sel_iposts = '#react-root > section > main > div > header > section > ul > li:nth-child(1) > span'

Keybase proof

I hereby claim:

  • I am hrxn on github.
  • I am hrxn ( on keybase.
  • I have a public key ASCbz3FnwAPQlEPZkxcPZX0ITbRz0Pt5MLjioH9OW3loqQo

To claim this, I am signing this object:

Hrxn /
Created Jun 21, 2017 — forked from kingychiu/
Python script finding all files with file size which is multiple of 4096.
# Bug report:
# Description:
import os
import glob
size_dir = {}
for filename in glob.iglob('./**/*.*', recursive=True):
size =os.path.getsize(filename)
if size % 4096 == 0 and size != 0:
size_dir[filename] = os.path.getsize(filename)
Hrxn / example-1.cmd
Last active Nov 5, 2016
CMD: Examples for PUSHD and POPD
View example-1.cmd
:: 1
@echo off
CD /D %AppData%\example
MD sub
CD /D E:\Test\files\xdir
COPY /Y file.ext %AppData%\example\sub\file.ext
Hrxn / switch-tscale.lua
Last active Jun 19, 2019
mpv: lua script usage
View switch-tscale.lua
-- Loading lua scripts in mpv:
-- 1: Scripts passed to the --script option
-- --script /path/to/script
-- 2: scripts subdirectory of the mpv configuration directory
-- ~/.config/mpv/scripts/
local interp_changed = true
function toggle_interp()
if interp_changed then
Hrxn / show-cmd-context.reg
Last active Jul 7, 2021
Always show the 'Open Command Prompt' option in Windows context menu
View show-cmd-context.reg
Windows Registry Editor Version 5.00
; Always shows the CMD option (Open Command Prompt) in context menu
; No need for the Shift key anymore
; Removes the 'Extended' keyword from ../shell/cmd