Skip to content

Instantly share code, notes, and snippets.

View Hrxn's full-sized avatar
👓
"Bundle of joy has some other stuff bundled in."

HRXN Hrxn

👓
"Bundle of joy has some other stuff bundled in."
  • Germany
  • 18:48 (UTC +01:00)
View GitHub Profile
@Hrxn
Hrxn / pwsh-EnvPaths.psm1
Last active August 2, 2024 02:29
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')]
[string] $Container = 'Session'
@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 / 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 / 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 / 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 / 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 / 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 / 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