Skip to content

Instantly share code, notes, and snippets.

View Hrxn's full-sized avatar
☯️
"He who knows, does not speak. He who speaks, does not know."

HRXN Hrxn

☯️
"He who knows, does not speak. He who speaks, does not know."
  • Germany
  • 11:50 (UTC +02:00)
View GitHub Profile
@Hrxn
Hrxn / atom-shellext-create.cmd
Last active August 29, 2015 14:24
Create Atom Shell Integration (Windows)
@echo off
C:
cd %LocalAppData%\atom\bin\
for /f "delims=" %%g in (atom.cmd) do set _atom=%%g
set _atom=%_atom:~10,9%
cd ..
cd %_atom%*
atom.exe --squirrel-install
@Hrxn
Hrxn / atom-shellext-update.cmd
Last active August 29, 2015 14:24
Update Atom Shell Integration (Windows)
@echo off
C:
cd %LocalAppData%\atom\bin\
for /f "delims=" %%g in (atom.cmd) do set _atom=%%g
set _atom=%_atom:~10,9%
cd ..
cd %_atom%*
atom.exe --squirrel-updated
@Hrxn
Hrxn / context-fix.reg
Last active January 14, 2016 09:59
Windows Context Menu Rape Kit
Windows Registry Editor Version 5.00
; Restore your context menu from those
; evil programs that populate your menu
; without your consent.
; If the key has no name, you should
; find the right CLSID first.
; But it works the same way.
@Hrxn
Hrxn / example-1.cmd
Last active November 5, 2016 09:17
CMD: Examples for PUSHD and POPD
---------------------------------------------------------------------------------
:: 1
@echo off
PUSHD .
CD /D %AppData%\example
MD sub
CD /D E:\Test\files\xdir
COPY /Y file.ext %AppData%\example\sub\file.ext
POPD
@Hrxn
Hrxn / filesize.py
Created June 21, 2017 08:26 — forked from kingychiu/filesize.py
Python script finding all files with file size which is multiple of 4096.
# Bug report: https://bugs.chromium.org/p/chromium/issues/detail?id=720597&can=2&start=0&num=100&q=&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified&groupby=&sort=
# Description: https://tinyio.wordpress.com/2017/06/17/solving-this-extension-may-have-been-corrupted-in-chrome-version-59/
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
Hrxn / keybase.md
Created February 7, 2018 07:08
keybase.md

Keybase proof

I hereby claim:

  • I am hrxn on github.
  • I am hrxn (https://keybase.io/hrxn) on keybase.
  • I have a public key ASCbz3FnwAPQlEPZkxcPZX0ITbRz0Pt5MLjioH9OW3loqQo

To claim this, I am signing this object:

@Hrxn
Hrxn / instagram_profile_stats.py
Last active June 2, 2018 17:05
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'
@Hrxn
Hrxn / tumblr_info.py
Created June 4, 2018 05:26
Python: Tumblr Stats Info
import argparse, time, re
import pytumblr
ap = argparse.ArgumentParser(description='tumblr.py: 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
Hrxn / wmi-rebuild.md
Created May 22, 2019 15:38
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
Hrxn / pwsh-EnvPaths.psm1
Last active January 19, 2024 10:54
PowerShell: module for the PATH system environment variable
# PowerShell Module File
# Name: EnvPaths.psm1
# Desc: Module for handling of the 'Path' system environment variable
# Source: https://gist.github.com/Hrxn/57c83ab93d642bdd868f97355f3aab45; Based on: https://gist.github.com/mkropat/c1226e0cc2ca941b23a9
function Get-EnvPath {
param(
[Parameter()]
[ValidateSet('Machine', 'User', 'Session')]
[System.String] $Container = 'Session'