Skip to content

Instantly share code, notes, and snippets.

🔧
Hacking all the things...

Eddie James Carswell II AfroThundr3007730

🔧
Hacking all the things...
Block or report user

Report or block AfroThundr3007730

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@AfroThundr3007730
AfroThundr3007730 / ComputerHygiene.ps1
Created Jan 24, 2020
Script to disable inactive computer accounts after a set period and delete disabled accounts after another set period.
View ComputerHygiene.ps1
Start-Transcript C:\ProgramData\computer-hygiene.log -Append
function accountFilter($accountList) {
# Filter out system principals and exempt accounts
$accountList | ?{
# Don't process these accounts
$_.DistinguishedName -notmatch "Domain Controllers" -and
$_.DistinguishedName -notmatch "VMWare" -and
$_.DistinguishedName -notmatch "Linux" -and
# Other special boxes
@AfroThundr3007730
AfroThundr3007730 / AccountHygiene.ps1
Created Jan 17, 2020
Script to disable inactive user accounts after a set period and delete disabled accounts after another set period.
View AccountHygiene.ps1
Start-Transcript C:\ProgramData\account-hygiene.log -Append
function userFilter($userList) {
# Filter out system principals and exempt accounts
$userList | ?{
# Don't process these accounts
$_.DistinguishedName -notmatch "Service Accounts" -and
$_.DistinguishedName -notmatch "Admin Accounts" -and
$_.DistinguishedName -notmatch "DA Accounts" -and
# Builtin and system principals
@AfroThundr3007730
AfroThundr3007730 / logrotate-auditd.conf
Created Jan 14, 2020
Config for audit.log rotation using logrotate
View logrotate-auditd.conf
/var/log/audit/audit.log {
weekly
missingok
notifempty
sharedscripts
rotate 5
maxsize 50M
compress
copytruncate
nodateext
@AfroThundr3007730
AfroThundr3007730 / dev-shm-noexec.service
Last active Jan 9, 2020
Remounts /dev/shm with noexec to satisfy STIG requirements
View dev-shm-noexec.service
#/etc/systemd/system/dev-shm-noexec.service
[Unit]
Description=Remounts /dev/shm with noexec to satisfy STIG requirements
DefaultDependencies=false
[Service]
ExecStart=/bin/mount -o remount,nosuid /dev/shm
Type=oneshot
@AfroThundr3007730
AfroThundr3007730 / EnforceSmartcard.ps1
Created Dec 17, 2019
Script to enforce Smart Card logon for accounts not in an exemption group
View EnforceSmartcard.ps1
Start-Transcript C:\ProgramData\smartcard-enforcement.log -Append
# Get the users exempted from Smart Card logon
$ExemptUsers=(Get-ADGroup CLO-Exempt -Properties Members).Members
Write-Host "Users currently exempted from Smart Card logon:"
foreach($user in $ExemptUsers){Write-Host " -" $user}
# Refresh NTLM hash for current Smart Card users
$LastReset = 'C:\Windows\SYSVOL\domain\scripts\.last-reset'
if((Get-ChildItem $LastReset).LastWriteTime -lt (Get-Date).AddDays(-60)) {
@AfroThundr3007730
AfroThundr3007730 / wanikani-breeze-dark-fix.user.css
Last active Sep 10, 2019
Fixes for the Wanikani Breeze Dark theme
View wanikani-breeze-dark-fix.user.css
/* ==UserStyle==
@name Wanikani Breeze Dark (Fixes)
@namespace github.com/AfroThundr3007730
@version 1.0.3
@description Fixes for the Wanikani Breeze Dark theme
@author ZeroSinner & Kumirei & AfroThundr
@homepageURL https://gitlab.com/valeth/wanikani-breeze-dark/
@updateURL https://gist.githubusercontent.com/AfroThundr3007730/6d591a5d2594d7951de92306858a60a7/raw/master/wanikani-breeze-dark-fix.user.css
@supportURL https://community.wanikani.com/t/16973/
@license CC-BY-SA-4.0
@AfroThundr3007730
AfroThundr3007730 / proc_parse.py
Created Jun 23, 2019
Parses process statistics from /proc into JSON for a given PID
View proc_parse.py
#!/usr/bin/python3
import os
import sys
import json
def parse_proc():
values = {}
@AfroThundr3007730
AfroThundr3007730 / socks-create.sh
Created Jun 23, 2019
Create an on-demand SSH-based SOCKS5 proxy via systemd socket activation
View socks-create.sh
#!/bin/bash
# These steps will allow the setup of an on-demand SSH proxy
# Three unit files will be created to serve this purpose:
# ssh-socks-helper.socket - The listening socket providing activation
# ssh-socks-helper.service - A systemd proxy to pass the socket fd
# ssh-socks.service - The actual SSH service providing the tunnel
cat <<'EOF' > ~/.config/systemd/user/ssh-socks-helper.socket
[Unit]
Description=Proxy Helper Socket for Bastion SOCKS5 Proxy
@AfroThundr3007730
AfroThundr3007730 / no-wsj-paywall.user.js
Created Jun 7, 2019
Attempts to show the non-paywalled version of Wall Street Journal articles
View no-wsj-paywall.user.js
// ==UserScript==
// @name Remove WSJ Paywall
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Attempts to show the non-paywalled version of Wall Street Journal articles
// @author AfroThundr
// @include https://www.wsj.com/articles/*
// @grant none
// @run-at document-start
// ==/UserScript==
@AfroThundr3007730
AfroThundr3007730 / stylish_dump.py
Last active Jun 5, 2019
Recover Stylish styles after webextension migration
View stylish_dump.py
#!/usr/bin/python
# Dumps pre-webextension Stylish styles to CSS files
import os
import json
def dump_styles():
dump_dir = os.path.join(os.getcwd(), 'style_dump')
style_file = os.path.join(os.getcwd(), 'stylish-storage.js')
stylish = json.load(open(style_file, 'r'))
You can’t perform that action at this time.