Skip to content

Instantly share code, notes, and snippets.

View AfroThundr3007730's full-sized avatar
🔧
Hacking all the things...

Eddie Carswell AfroThundr3007730

🔧
Hacking all the things...
View GitHub Profile
@alx9r
alx9r / invokeUsingObject.ps1
Last active September 19, 2022 21:12
Proof-of-concept of an error- and stop-safe cleanup pattern.
# Proof-of-concept of an error- and stop-safe cleanup pattern.
<#
Note that accepting pipeline input for these functions is not supported
because per https://gist.github.com/alx9r/f81cf64f50a016edda4e92968bdb9c3b
* there is no way to ensure cleanup when an upstream command breaks, throws,
continues, or throws a statement-terminating error, and
* there is no way to determine from a mid-pipeline command whether an exception
thrown downstream will cause the end of the invokation or will be swallowed by
an upstream command.
@vMarkusK
vMarkusK / ESXi-Depot-Install-ESXCLI.ps1
Created February 22, 2018 08:55
This PowerCLI Script Uploads and Installs a ESXi Depot Package via ESXCLI -v2
[String]$ClusterName = "Compute01"
[String]$LocalPath = "D:\Image\HPE-20180220.zip"
[String]$DepotName = "HPE-20180220.zip"
[String]$TempDatastoreName = "LOCAL*"
$VMhosts = Get-Cluster -Name $ClusterName | Get-VMHost | Where-Object {$_.ConnectionState -eq "Maintenance"}
foreach ($VMhost in $VMhosts) {
#region: Upload Patch
$Datastore = $VMhost | Get-Datastore -Name $TempDatastoreName
@mrienstra
mrienstra / unregisterServiceWorkers.js
Created February 4, 2018 22:10
Unregister service workers, verbose
navigator.serviceWorker.getRegistrations().then(function (registrations) {
if (!registrations.length) {
console.log('No serviceWorker registrations found.')
return
}
for(let registration of registrations) {
registration.unregister().then(function (boolean) {
console.log(
(boolean ? 'Successfully unregistered' : 'Failed to unregister'), 'ServiceWorkerRegistration\n' +
(registration.installing ? ' .installing.scriptURL = ' + registration.installing.scriptURL + '\n' : '') +
#!/usr/bin/env python2
"""s3_apt_wrapper
Manage an S3-backed APT repository and its packages.
This script requires the 'deb-s3' tool to be installed and executable via $PATH
https://github.com/krobertson/deb-s3
Usage:
s3_apt_wrapper --help
@Neo23x0
Neo23x0 / audit.rules
Last active January 13, 2024 14:12
Linux Auditd Best Practice Configuration
# IMPORTANT!
# This gist has been transformed into a github repo
# You can find the most recent version there:
# https://github.com/Neo23x0/auditd
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 19, 2024 13:30
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@trietptm
trietptm / Blockchain security research.md
Created October 22, 2017 17:57 — forked from TheHackerDev/Blockchain security research.md
Open-source blockchain security research (contributions welcome!)

What is a blockchain?

  • Distributed ledger system; for tracking the transfer of tokens (currency, data of any type).
  • A cross between economics, cryptography, and the internet.
    • Side note- if you ever wanted a financial incentive to get involved in cryptography, this is it.
  • A blockchain is literally a chain of blocks, where each block contains a list of transactions that everyone agrees have occurred.
    • Each block builds upon all the ones before it.

A blockchain is literally a chain of blocks

@JacobJohansen
JacobJohansen / AuthyToOtherAuthenticator.md
Created October 20, 2017 15:12 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes (beware, through Google) for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My gues

@trietptm
trietptm / Sdclt.ps1
Created October 9, 2017 04:10 — forked from netbiosX/Sdclt.ps1
Bypass UAC via sdclt in Windows 10 systems
<#
.SYNOPSIS
This script can bypass User Access Control (UAC) via sdclt.exe for Windows 10.
Author: @netbiosX
License: BSD 3-Clause
Required Dependencies: None
Optional Dependencies: None
 
It creates a registry key in: "HKCU:\Software\Microsoft\Windows\CurrentVersion\App Paths\control.exe" to perform UAC bypass
@trietptm
trietptm / FodhelperUACBypass.ps1
Created October 9, 2017 04:10 — forked from netbiosX/FodhelperUACBypass.ps1
Bypass UAC via Fodhelper binary in Windows 10 systems
<#
.SYNOPSIS
This script can bypass User Access Control (UAC) via fodhelper.exe
 
It creates a new registry structure in: "HKCU:\Software\Classes\ms-settings\" to perform UAC bypass and starts
an elevated command prompt.
 
.NOTES
Function : FodhelperUACBypass
File Name : FodhelperUACBypass.ps1