46 Commits

Author SHA1 Message Date
PrincessPi 4e798818d1 CHECKSUM GREATLY IMPROVED 2026-09-25 17:02:59 -06:00
PrincessPi 56b08f32da waypoit debuguing 2026-09-25 16:52:30 -06:00
PrincessPi 251c9aa06c waypoit debuguing 2026-09-25 16:51:04 -06:00
PrincessPi 1dbd1ad79b waypoit debuguing 2026-09-25 16:50:16 -06:00
PrincessPi 7bd65e7d76 waypoit debuguing 2026-09-25 16:45:30 -06:00
PrincessPi 2fd8238a98 waypoit debuguing 2026-09-25 16:33:58 -06:00
PrincessPi 503e947eaf waypoit debuguing 2026-09-25 16:20:22 -06:00
PrincessPi 07a29167dd waypoit debuguing 2026-09-25 16:19:14 -06:00
PrincessPi 608e225833 WORKAN DEBUG 2026-09-25 16:10:17 -06:00
PrincessPi 4fea9dbccc waypoint debug 2026-09-25 16:01:49 -06:00
PrincessPi 4377cc6a45 waypoit debuguing 2026-09-25 15:56:47 -06:00
PrincessPi e5435d124e waypoit debuguing 2026-09-25 15:50:28 -06:00
PrincessPi 757f1775ff waypoit debuguing 2026-09-25 15:43:25 -06:00
PrincessPi dc17c77c87 waypoint debug 2026-09-25 15:30:52 -06:00
PrincessPi b504218205 waypoint debug 2026-09-25 15:27:37 -06:00
PrincessPi 776a52c3c3 waypoit debuguing 2026-09-25 15:25:19 -06:00
PrincessPi 3f03b2a0f3 waypoit debuguing 2026-09-25 15:23:52 -06:00
PrincessPi b32cae15b2 waypoint debugging 2026-09-25 15:20:47 -06:00
PrincessPi 784b60a4e7 waypoint debugging 2026-09-25 15:17:50 -06:00
PrincessPi 53fe4e9ed3 waypoint 2026-09-25 15:16:30 -06:00
PrincessPi b010b7ac71 added a kasm installer dev 2026-09-20 17:29:26 -06:00
PrincessPi 0994e78843 added a random word generator 2026-09-19 21:27:49 -06:00
PrincessPi 1a61eb2034 1789857176 2026-09-19 16:32:56 -06:00
PrincessPi 29ee569bfe fixed oniux shit proper and finished checksum for windowz 2026-08-10 21:12:56 -06:00
PrincessPi 3425139b1f fixed oniux shit proper and finished checksum for windowz 2026-08-10 21:06:05 -06:00
PrincessPi ee6a75de9a added match.ps1 to Windows-Scripts to make quick strcmps easier in powershell 2026-07-30 14:40:40 -06:00
PrincessPi b58c78a3fe checksum.ps1 added, removed the old hashing scripts for windows 2026-07-30 14:31:42 -06:00
PrincessPi 79ad72ff11 1784413672 2026-07-18 16:27:51 -06:00
PrincessPi e6cbe71c5b 1784413016 2026-07-18 16:16:56 -06:00
PrincessPi 9e86c1a1cf workan on checksumulator.sh and alert.ps1 because i ave lost all control of my life 2026-07-18 16:16:14 -06:00
PrincessPi 60a2343bc8 aDDEDD aleert.ps1 to be asnnoyiung 2026-07-17 21:31:53 -06:00
PrincessPi f67fbef18e silly :3 2026-07-17 18:30:42 -06:00
PrincessPi e909a9ba94 silly :3 2026-07-17 17:53:56 -06:00
PrincessPi b522288c96 made a fine first pass at my interactive simplified FT4232H usage, because gay 2026-07-17 17:45:09 -06:00
PrincessPi cde93f511a made a fine first pass at my interactive simplified FT4232H usage, because gay 2026-07-17 17:23:49 -06:00
PrincessPi 8aaef29ad4 workan on my helper for FT4232H 2026-07-17 15:30:54 -06:00
PrincessPi 9fec5e39b4 fuckin ffmpreg_gif_loopy.ps1 now proper 2026-07-13 13:51:39 -06:00
PrincessPi 657f515135 improved da fuck out of passggen 2026-07-13 02:07:37 -06:00
PrincessPi 036c985592 more vibecoded additions to string tools lol' 2026-07-13 01:22:41 -06:00
PrincessPi 8b28c70d15 addin web tooks 2026-07-13 01:17:54 -06:00
PrincessPi b7ee3498da 1781374089 2026-06-13 12:08:08 -06:00
PrincessPi 6e0d004880 1781373563 2026-06-13 11:59:23 -06:00
PrincessPi ed26939af4 1781371811 2026-06-13 11:30:11 -06:00
PrincessPi 58a15ff9d0 rc.347 2026-06-13 09:46:17 -06:00
PrincessPi 7d5b95fb18 added fookin pi ascii art shit 2026-06-13 07:47:49 -06:00
PrincessPi 0abfd658b7 balzac release 1.0 2026-06-13 04:57:41 -06:00
32 changed files with 2532 additions and 357 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
webhook.txt */webhook.txt
tag.txt */tag.txt
*.tmp *.tmp
*.csv *.csv
*.sha256
+2 -1
View File
@@ -39,6 +39,7 @@ script=/tmp/install_script.sh && curl -s https://git.thecoven.info/PrincessPi/ge
* `large_file_search_for_hash` * `large_file_search_for_hash`
* `randomtoken` * `randomtoken`
* `alfa_install_kali.sh` * `alfa_install_kali.sh`
* `torsilly.sh`
#### monitoring #### monitoring
* `mon-watch` * `mon-watch`
@@ -98,7 +99,7 @@ script=/tmp/install_script.sh && curl -s https://git.thecoven.info/PrincessPi/ge
### Clean up Windows! ### Clean up Windows!
```powershell ```powershell
iwr https://git.thecoven.info/PrincessPi/general-scripts-and-system-ssssssetup/raw/branch/main/Windows-Scripts/windows-repair.ps1?nocache=$(Get-Random) -OutFile $env:TEMP\windows-repair-temp.ps1; powershell -NoProfile -ep Bypass -File $env:TEMP\windows-repair-temp.ps1 iwr https://git.thecoven.info/PrincessPi/general-scripts-and-system-ssssssetup/raw/branch/main/Windows-Scripts/windows-repair.ps1?nocache=$(Get-Random) -OutFile $env:TEMP\windows-repair-temp.ps1; powershell -nop -ep Bypass -File $env:TEMP\windows-repair-temp.ps1
``` ```
todo: todo:
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
default_files_name="`printf '%s\n' \"${PWD##*/}\"`_checksums_`date +%Y-%m-%d-%H%M-%Z`.sha256" # add da timedate stamp to it
echo $default_files_name
exit 0
find $PWD -type f -exec sha256sum {} | tee -a files.sha256
+178
View File
@@ -0,0 +1,178 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>File to Base64 Converter</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
body {
background-color: #f4f6f8;
color: #333;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 20px;
}
.container {
background: #ffffff;
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
padding: 30px;
width: 100%;
max-width: 650px;
}
h2 {
margin-bottom: 20px;
font-size: 1.5rem;
text-align: center;
}
.drop-zone {
border: 2px dashed #0066ff;
border-radius: 8px;
padding: 30px;
text-align: center;
background-color: #f0f7ff;
cursor: pointer;
transition: background 0.2s ease, border-color 0.2s ease;
}
.drop-zone:hover, .drop-zone.dragover {
background-color: #e1effe;
border-color: #0052cc;
}
.drop-zone p {
color: #555;
font-size: 0.95rem;
}
.drop-zone input[type="file"] {
display: none;
}
.output-group {
margin-top: 25px;
display: none;
}
.output-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
label {
font-weight: 600;
font-size: 0.9rem;
}
button {
background-color: #0066ff;
color: white;
border: none;
padding: 6px 12px;
border-radius: 6px;
cursor: pointer;
font-size: 0.85rem;
transition: background 0.2s ease;
}
button:hover {
background-color: #0052cc;
}
textarea {
width: 100%;
height: 180px;
padding: 12px;
border: 1px solid #ccc;
border-radius: 6px;
font-family: monospace;
font-size: 0.85rem;
resize: vertical;
background-color: #fafafa;
word-break: break-all;
}
</style>
</head>
<body>
<div class="container">
<h2>File to Base64 Converter</h2>
<div class="drop-zone" id="dropZone">
<p><strong>Click to browse</strong> or drag & drop a file here</p>
<input type="file" id="fileInput">
</div>
<div class="output-group" id="outputGroup">
<div class="output-header">
<label for="base64Output">Base64 Data URL String:</label>
<button id="copyBtn">Copy String</button>
</div>
<textarea id="base64Output" readonly></textarea>
</div>
</div>
<script>
const dropZone = document.getElementById('dropZone');
const fileInput = document.getElementById('fileInput');
const outputGroup = document.getElementById('outputGroup');
const base64Output = document.getElementById('base64Output');
const copyBtn = document.getElementById('copyBtn');
// Trigger file dialog on click
dropZone.addEventListener('click', () => fileInput.click());
// File input change handler
fileInput.addEventListener('change', (e) => {
if (e.target.files.length > 0) {
processFile(e.target.files[0]);
}
});
// Drag & Drop event handlers
dropZone.addEventListener('dragover', (e) => {
e.preventDefault();
dropZone.classList.add('dragover');
});
['dragleave', 'dragend'].forEach(type => {
dropZone.addEventListener(type, () => dropZone.classList.remove('dragover'));
});
dropZone.addEventListener('drop', (e) => {
e.preventDefault();
dropZone.classList.remove('dragover');
if (e.dataTransfer.files.length > 0) {
processFile(e.dataTransfer.files[0]);
}
});
// Read file as Data URL
function processFile(file) {
const reader = new FileReader();
reader.onload = () => {
base64Output.value = reader.result;
outputGroup.style.display = 'block';
};
reader.onerror = (error) => {
alert('Error reading file: ' + error);
};
reader.readAsDataURL(file);
}
// Copy to clipboard
copyBtn.addEventListener('click', () => {
base64Output.select();
navigator.clipboard.writeText(base64Output.value)
.then(() => {
const originalText = copyBtn.innerText;
copyBtn.innerText = 'Copied!';
setTimeout(() => copyBtn.innerText = originalText, 2000);
})
.catch(err => alert('Failed to copy text: ' + err));
});
</script>
</body>
</html>
File diff suppressed because one or more lines are too long
+205
View File
@@ -0,0 +1,205 @@
<html>
<head>
<title>Passgen 0.2.9</title>
<script>
var alphau = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var alphal = "abcdefghijklmnopqrstuvwxyz";
var numbers = "0123456789";
var symbols = "`~!@#$%^&*()-=_+[]\{}|;':\",./<>?\\";
var space = " ";
var baseYear = 120000000000000000000000;
function $id(id) {
return document.getElementById(id);
}
async function copyInputToClipboard(inputId, buttonElement) {
const inputElement = document.getElementById(inputId);
if (!inputElement) return;
try {
await navigator.clipboard.writeText(inputElement.value);
} catch (err) {
inputElement.select();
document.execCommand('copy');
}
// Temporary button label change
if (buttonElement) {
const originalText = buttonElement.innerText;
buttonElement.innerText = 'Copied!';
setTimeout(() => {
buttonElement.innerText = originalText;
}, 2000);
}
}
function secureRand(min,max,len) {
var str = "";
var rand = [];
var pos = 0;
while(rand.length<len) {
var buf = new Uint8Array(512);
window.crypto.getRandomValues(buf);
for(i=0;i<buf.length;i++) {
if(buf[i] >= min && buf[i] <= max) {
rand[pos] = buf[i];
pos++;
}
}
}
return rand.slice(0,len);
}
function generatepass(len,keys){
rlist='';
var srand = secureRand(0,keys.length,len);
for (i=0;i<len;i++) {
rlist+=keys.charAt(srand[i]);
}
return rlist;
}
function entropy(chars,len) {
return Math.round((Math.log(Math.pow(chars,len))/Math.log(2))*100)/100;
}
// chars = length of charset
// len = length of password
// base = total md5 tries per year
// TODO: Assumes power doubles every 18 months (Moore's law)
function yearsToCrack(chars,len,base) {
possible = Math.pow(chars,len);
return Math.round(possible/baseYear);
}
function generate() {
var len = $id('length').value;
var keylist = "";
if($id('alphal').checked) { keylist += alphal; }
if($id('alphau').checked) { keylist += alphau; }
if($id('symbols').checked) { keylist += symbols; }
if($id('numbers').checked) { keylist += numbers; }
if($id('space').checked) { keylist += space; }
$id('out').value = generatepass(len,keylist);
$id('entropy').innerHTML = entropy(keylist.length,len);
$id('years').innerHTML = yearsToCrack(keylist.length,len,baseYear);
}
window.onload = function(){generate();}
</script>
<style>
* {
font-family: 'Courier New', Courier, monospace;
font-weight: bold;
}
body {
background-color: #FFFFFF;
}
h1 {
margin-bottom: 5px;
}
a:link {
color: #000000;
}
a:hover {
text-decoration:none;
}
/* Base link styling */
.has-tooltip {
position: relative; /* Crucial for positioning the tooltip relative to the link */
text-decoration: underline;
cursor: pointer;
}
/* Tooltip container (text box) */
.has-tooltip::before {
content: attr(data-tooltip); /* Pulls text from the data-tooltip attribute */
position: absolute;
bottom: 100%; /* Positions the box above the top of the link */
left: 50%;
transform: translateX(-50%) translateY(-8px); /* Centers horizontally & lifts up slightly */
/* Visual styling */
background-color: #1e293b;
color: #ffffff;
padding: 6px 12px;
border-radius: 6px;
font-size: 0.85rem;
white-space: nowrap; /* Prevents text from wrapping */
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
/* Hide by default */
opacity: 0;
visibility: hidden;
transition: opacity 0.2s ease, transform 0.2s ease;
pointer-events: none; /* Prevents cursor interference */
z-index: 100;
}
/* Tooltip arrow pointer */
.has-tooltip::after {
content: '';
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%) translateY(0);
/* Creates a small downward arrow using border tricks */
border-width: 6px 6px 0 6px;
border-style: solid;
border-color: #1e293b transparent transparent transparent;
/* Hide by default */
opacity: 0;
visibility: hidden;
transition: opacity 0.2s ease, transform 0.2s ease;
pointer-events: none;
z-index: 100;
}
/* Hover State - Reveal Tooltip & Arrow */
.has-tooltip:hover::before,
.has-tooltip:hover::after {
opacity: 1;
visibility: visible;
}
/* Subtle upward slide animation on hover */
.has-tooltip:hover::before {
transform: translateX(-20%) translateY(-12px);
}
.has-tooltip:hover::after {
transform: translateX(-20%) translateY(-6px);
}
</style>
</head>
<body>
<h1>Passgen<sup><a href="javascript:alert('Passgen 0.2.9\nCryptographically secure password generator\n\nHere is how passgen protects you:\n* Uses a cryptographically secure random number generator to\ngenerate a properly random secure password\n* Nothing is ever sent to anyone! It all runs through your browser\n* Even visiting a website and loading pages from it is not needed\npassgen can run through a bookmarklet without even being online\n* Nothing is ever, ever stored or logged\n* The web page you got this from keeps no logs including IP logs or even a hit counter\n* The website you got this from is secured with TLS to ensure this bookmarklet was not tampered with in transit\n* This bookmarklet code is singed with PGP to guarantee it has not been tampered with by a hacker\n\nPrincess Pi - https://git.thecoven.info/PrincessPi');">?</a></sup></h1>
<input type="checkbox" id="alphal" onchange="generate()" checked> <label for="alphal">Lowercase Letters</label><a href="#" class="has-tooltip" data-tooltip="abcdefghijklmnopqrstuvwxyz">?</a><br>
<input type="checkbox" id="alphau" onchange="generate()" checked> <label for="alphau">Uppercase Letters</label><a href="#" class="has-tooltip" data-tooltip="ABCDEFGHIJKLMNOPQRSTUVWXYZ">?</a><br>
<input type="checkbox" id="numbers" onchange="generate()" checked> <label for="numbers">Numbers</label><a href="#" class="has-tooltip" data-tooltip="0123456789">?</a><br>
<input type="checkbox" id="symbols" onchange="generate()" checked> <label for="symbols">Symbols</label><a href="#" class="has-tooltip" data-tooltip="`~!@#$%^&*()-=_+[]\{}|;':&quot;,.&lt;>?\">?</a><br>
<input type="checkbox" id="space" onchange="generate()" checked> <label for="space">Space</label><a href="#" class="has-tooltip" data-tooltip="Space AKA 0x20, \\s, %20, and &amp;nbsp;">?</a><br>
<label for="length">Length</label> <input type="text" id="length" size="4" value="23" onchange="generate()"><br><br>
<button value="Generate" onclick="generate()">Generate New</button> <!--<input type="button" value="Close" onclick="window.close()">-->
<p><b>Password</b> <input type="text" id="out" size="40" readonly> <button onclick="copyInputToClipboard('out', this)">Copy</button></p>
<p><b>Strength<sup><a href="#" class="has-tooltip" data-tooltip="Bits of entropy. log2(characters^length)">?</a></sup></b> <span id="entropy"></span> bits</p>
<p><b>Years to Crack<sup><a href="#" class="has-tooltip" data-tooltip="WORK IN PROGRESS&#x0A;&#x0D;Assumes all computing power on Earth being used collaboratively, doubling in power every 18 months.&#x0A;&#x0D;Also assumes a weak hash, MD5. (EXCLUDES collisions in MD5)">?</a></sup></b> <span id="years"></span></p>
</body>
</html>
File diff suppressed because one or more lines are too long
+280
View File
@@ -0,0 +1,280 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>String Tools</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
body {
background-color: #f4f6f8;
color: #333;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 20px;
}
.container {
background: #ffffff;
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
padding: 30px;
width: 100%;
max-width: 650px;
}
h2 {
margin-bottom: 20px;
font-size: 1.5rem;
text-align: center;
}
.input-group {
margin-bottom: 20px;
}
label {
display: block;
font-weight: 600;
font-size: 0.9rem;
margin-bottom: 6px;
}
textarea {
width: 100%;
height: 100px;
padding: 12px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 0.95rem;
resize: vertical;
background-color: #fafafa;
}
textarea:focus {
outline: none;
border-color: #0066ff;
background-color: #fff;
}
.section-header {
font-size: 0.85rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
color: #0066ff;
margin: 20px 0 10px 0;
padding-bottom: 4px;
border-bottom: 2px solid #e1effe;
}
.output-card {
background-color: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 6px;
padding: 12px;
margin-bottom: 12px;
}
.output-card.hidden {
display: none;
}
.output-card.error {
border-color: #ffc9c9;
background-color: #fff5f5;
}
.output-card .title {
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 0.5px;
color: #6c757d;
margin-bottom: 4px;
font-weight: 700;
}
.output-card .value {
font-family: monospace;
font-size: 0.95rem;
word-break: break-all;
white-space: pre-wrap;
color: #212529;
}
.value.error-text {
color: #d9534f;
font-style: italic;
}
</style>
</head>
<body>
<div class="container">
<h2>String Tools</h2>
<div class="input-group">
<label for="strInput">Enter your string below:</label>
<textarea id="strInput" placeholder="Type or paste something here..."></textarea>
</div>
<div class="section-header">String Transformations</div>
<div class="output-card">
<div class="title">Character Count (Length)</div>
<div class="value" id="outLength">0</div>
</div>
<div class="output-card">
<div class="title">Uppercase</div>
<div class="value" id="outUpper">---</div>
</div>
<div class="output-card">
<div class="title">Lowercase</div>
<div class="value" id="outLower">---</div>
</div>
<div class="output-card">
<div class="title">URL Encoded</div>
<div class="value" id="outEncoded">---</div>
</div>
<div class="output-card" id="urlDecodedCard">
<div class="title">URL Decoded</div>
<div class="value" id="outDecoded">---</div>
</div>
<div class="output-card">
<div class="title">Base64 Encoded</div>
<div class="value" id="outB64Enc">---</div>
</div>
<div class="output-card hidden" id="b64DecCard">
<div class="title">Base64 Decoded</div>
<div class="value" id="outB64Dec">---</div>
</div>
<div class="section-header">Hashes</div>
<div class="output-card">
<div class="title">SHA-1</div>
<div class="value" id="outSha1">---</div>
</div>
<div class="output-card">
<div class="title">SHA-256</div>
<div class="value" id="outSha256">---</div>
</div>
<div class="output-card">
<div class="title">SHA-512</div>
<div class="value" id="outSha512">---</div>
</div>
</div>
<script>
const strInput = document.getElementById('strInput');
const outLength = document.getElementById('outLength');
const outUpper = document.getElementById('outUpper');
const outLower = document.getElementById('outLower');
const outEncoded = document.getElementById('outEncoded');
const outDecoded = document.getElementById('outDecoded');
const urlDecodedCard = document.getElementById('urlDecodedCard');
const outB64Enc = document.getElementById('outB64Enc');
const outB64Dec = document.getElementById('outB64Dec');
const b64DecCard = document.getElementById('b64DecCard');
const outSha1 = document.getElementById('outSha1');
const outSha256 = document.getElementById('outSha256');
const outSha512 = document.getElementById('outSha512');
// Safe Unicode Base64 Helper
function utf8ToBase64(str) {
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) => {
return String.fromCharCode('0x' + p1);
}));
}
function base64ToUtf8(str) {
return decodeURIComponent(atob(str).split('').map((c) => {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
}
// Helper function to calculate Web Crypto hashes
async function computeHash(algo, text) {
if (!text) return '---';
const msgUint8 = new TextEncoder().encode(text);
const hashBuffer = await crypto.subtle.digest(algo, msgUint8);
const hashArray = Array.from(new Uint8Array(hashBuffer));
return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
}
strInput.addEventListener('input', async () => {
const val = strInput.value;
if (val.length === 0) {
outLength.textContent = '0';
outUpper.textContent = '---';
outLower.textContent = '---';
outEncoded.textContent = '---';
outDecoded.textContent = '---';
outB64Enc.textContent = '---';
outB64Dec.textContent = '---';
outSha1.textContent = '---';
outSha256.textContent = '---';
outSha512.textContent = '---';
urlDecodedCard.classList.remove('error');
b64DecCard.classList.add('hidden');
return;
}
// Basic Transformations
outLength.textContent = val.length;
outUpper.textContent = val.toUpperCase();
outLower.textContent = val.toLowerCase();
outEncoded.textContent = encodeURIComponent(val);
// URL Decoded
try {
outDecoded.textContent = decodeURIComponent(val);
outDecoded.classList.remove('error-text');
urlDecodedCard.classList.remove('error');
} catch (e) {
outDecoded.textContent = "Error: Invalid URL encoding sequence";
outDecoded.classList.add('error-text');
urlDecodedCard.classList.add('error');
}
// Base64 Encoded
outB64Enc.textContent = utf8ToBase64(val);
// Base64 Decoded (Hidden unless input is valid Base64)
const trimmedVal = val.trim();
// Regex validates Base64 formatting before attempting decoding
const isB64Format = /^[A-Za-z0-9+/=]+$/.test(trimmedVal) && (trimmedVal.length % 4 === 0);
if (isB64Format) {
try {
const decoded = base64ToUtf8(trimmedVal);
outB64Dec.textContent = decoded;
b64DecCard.classList.remove('hidden');
} catch (e) {
b64DecCard.classList.add('hidden');
}
} else {
b64DecCard.classList.add('hidden');
}
// Calculate Cryptographic Hashes asynchronously
try {
outSha1.textContent = await computeHash('SHA-1', val);
outSha256.textContent = await computeHash('SHA-256', val);
outSha512.textContent = await computeHash('SHA-512', val);
} catch (e) {
outSha1.textContent = "Error computing hash";
outSha256.textContent = "Error computing hash";
outSha512.textContent = "Error computing hash";
}
});
</script>
</body>
</html>
+1 -1
View File
@@ -58,4 +58,4 @@ Start-Sleep -Seconds $WaitSeconds
# x Force reboot with no warning # x Force reboot with no warning
# Disabled -Force to let apps close gracefully # Disabled -Force to let apps close gracefully
Restart-Computer # -Force Stop-Computer # -Force
+42
View File
@@ -0,0 +1,42 @@
# Usage: alert <message="Alert"> (<type=Information/None/Error/Question/Warning> (<Buttons=OK/OKCancel/YesNoCancel/YesNo>))
# HELP HANDLE
if($args[0] -eq 'h' -or $args[0] -eq '-h' -or $args[0] -eq 'H' -or $args[0] -eq '-H' -or $args[0] -eq 'help' -or $args[0] -eq 'Help' -or $args[0] -eq 'HELP') {
Write-Host "Usage: alert <message=Alert> (<type=Information/None/Error/Question/Warning> (<Buttons=OK/OKCancel/YesNoCancel/YesNo>))`nalert h/-h/help/etc: Display this help message"
exit
}
# MESSAGE HANDLE DEFAULT
if([string]::IsNullOrEmpty($args[0])) {
$Message = "Alert"
} else {
$Message = $args[0]
}
# TYPE HANDLE DEFAULT
if([string]::IsNullOrEmpty($args[1])) {
$Type = "Information"
} else {
$Type = $args[1]
}
# BUTTONS HANDLE DEFAULT
if([string]::IsNullOrEmpty($args[2])) {
$Buttons = "OK"
} else {
$Buttons = $args[2]
}
# doin inide start-job method so alert box doesnt block
Start-Job -ScriptBlock {
# get back my fuckin vars inside this script block
$Message = $using:Message
$Buttons = $using:Buttons
$Type = $using:Type
# Add the PresentationFramework
Add-Type -AssemblyName PresentationFramework
# Send the alert
[System.Windows.MessageBox]::Show($Message, $Message, $Buttons, $Type)
};
+2
View File
@@ -0,0 +1,2 @@
1. recursive verify error: `FAILED open or read`
2. recursive progress set to count total number of files recursively first for progress bar
+656
View File
@@ -0,0 +1,656 @@
<#
.SYNOPSIS
Princess Pi's Magical CHECKSUM! - Computes and verifies message digests / file checksums.
.DESCRIPTION
Computes or verifies checksums using cryptographic hash algorithms (SHA256, SHA512, SHA1, MD5, SHA384).
Supports parallel processing, recursive scanning, direct hash matching, and verification file parsing.
.NOTES
Requires PowerShell 7.0 or higher.
#>
[CmdletBinding(DefaultParameterSetName='Generate')]
param(
# File(s) or wildcard pattern to compute checksum for
[Parameter(Position = 0, ParameterSetName = 'Generate', ValueFromPipeline = $true)]
[Parameter(Position = 0, ParameterSetName = 'Match', ValueFromPipeline = $true)]
[Parameter(Position = 0, ParameterSetName = 'PrincessPi', ValueFromPipeline = $false)]
[Alias('i', 'input', 'if', 'InputFile')]
[string[]]$FilePath,
# Custom output file (-f / -OutFile / -of)
[Parameter(Mandatory = $false, ParameterSetName = 'Generate')]
[Alias('f', 'of')]
[string]$OutFile,
# Auto output file switch (-s / -Save / -o)
[Parameter(Mandatory = $false, ParameterSetName = 'Generate')]
[Alias('s', 'o')]
[switch]$Save,
# File containing checksums to verify (-c / -Check)
[Parameter(Mandatory = $false, ParameterSetName = 'Verify')]
[Alias('c')]
[string]$Check,
# Direct checksum hash string to match against (-m / -Match)
[Parameter(Mandatory = $true, ParameterSetName = 'Match')]
[Alias('m')]
[string]$Match,
# Hashing algorithm to use (Defaults to SHA256)
[Parameter(Mandatory = $false)]
[Alias('a', 'algo')]
[ValidateSet('SHA1', 'SHA256', 'SHA384', 'SHA512', 'MD5')]
[string]$Algorithm,
# Recursive flag (-r / -Recursive)
[Parameter(Mandatory = $false)]
[Alias('r')]
[switch]$Recursive,
# Princess Pi art flag (-pp / -PrincessPi)
[Parameter(Mandatory = $true, ParameterSetName = 'PrincessPi')]
[Alias('pp')]
[switch]$PrincessPi,
# Help flag (-h / -Help)
[Parameter(Mandatory = $false)]
[Alias('h')]
[switch]$Help
)
# --- ENVIRONMENT SANITY CHECK ---
if ($PSVersionTable.PSVersion.Major -lt 7) {
Write-Error "checksum: This script requires PowerShell 7 or higher for parallel execution (-Parallel support). Current version is $($PSVersionTable.PSVersion)."
exit 1
}
# --- HELPER FUNCTIONS ---
function Show-Help {
@'
Princess Pi's Magical CHECKSUM!
NAME
checksum - Compute and verify message digests / file checksums
SYNOPSIS
.\checksum.ps1 [-FilePath] <string[]> [-s] [-f <string>] [-Algorithm <string>] [-r]
.\checksum.ps1 [-FilePath] <string[]> -Match <string> [-Algorithm <string>] [-r]
.\checksum.ps1 -Check <string> [-Algorithm <string>] [-r]
.\checksum.ps1 -PrincessPi
.\checksum.ps1 -Help
DESCRIPTION
Computes or verifies checksums using cryptographic hash algorithms (SHA256, SHA512, SHA1, MD5, SHA384).
Outputs hash values in standard GNU coreutils format (<hash> <filename>).
Ignores checksum metadata files (.md5, .sha1, .sha256, .sha384, .sha512) during wildcards unless passed explicitly.
PARAMETERS
-FilePath, -i, -input, -if, -InputFile <string[]>
Specifies the target file(s) or wildcard pattern (*).
-s, -S, -Save, -o, -O <switch>
Auto-saves checksum results. (Takes no arguments).
- If input filename contains a wildcard (*), saves to 'checksums.<algo>'.
- If input filename does NOT contain a wildcard, saves to '<filename>.<algo>'.
When combined with -r and *, recursively auto-generates checksums per directory.
-f, -F, -of, -OF, -OutFile <string>
Saves checksum results to a specific custom filename.
Overrides the auto-naming behavior of -s if both are passed.
-c, -C, -Check <string>
Reads hashes from a specified checksum file and verifies target files on disk.
If -r is specified, recursively looks for and validates checksum files by name across subdirectories.
-m, -M, -Match <string>
Compares the computed hash of target file(s) directly against a given hash string.
-a, -A, -Algo, -Algorithm <string>
Specifies the hash algorithm to use.
Supported options: MD5, SHA1, SHA256 (default), SHA384, SHA512.
In -c or -m mode, auto-detects algorithm from hash length if omitted.
-r, -R, -Recursive <switch>
Processes target files or verification files recursively across directory structures.
-pp, -PP, -PrincessPi <switch>
Displays Princess Pi!
-h, -H, -Help <switch>
Displays this help documentation.
Also displays on any error.
EXAMPLES
1. Compute SHA256 for a single file and auto-save as 'myfile.iso.sha256':
.\checksum.ps1 myfile.iso -s
2. Compute SHA512 recursively and auto-save as 'checksums.sha512' in each folder:
.\checksum.ps1 * -r -s -a SHA512
3. Compute SHA256 checksums and save to a specific custom file:
.\checksum.ps1 * -f my_hashes.txt
4. Verify checksums against a verification file:
.\checksum.ps1 -c checksums.sha256
5. Compare file directly against an expected hash string:
.\checksum.ps1 myfile.bin -m 406653a68bd3538975656831f33f031b
Princess Pi LOVES YOU!~
https://linktr.ee/princesspi3
'@
}
function Write-ErrorWithHelp {
param([string]$ErrorMessage);
Show-Help;
Write-Host "";
Write-Error $ErrorMessage;
}
function Show-PrincessPiArt {
$art = @'
=#= -- ##*+++++ *+
-#=#- +# -*%%= ##++++++++++# ##*********#
#==#= *** %%++%% -++# #++++++++++++*+ *#***************#
#===#= %***+%++#*%%@+++++% #++++++++++++**+++#******++********#
====+#%@*******###%=%++##++% #+++++++++++*++++++++#***====+****++#
=#=*==**#*#########%++#*+++@ *++++++++#+++++++++++#****==+******#
*#=====%####***%%++++#*+++**% ++++++++*+++++++++++++#************#*******
@****#==%####**#*+++++++#+++#**# #+++++++++++++++++++#####+*****************#
@****#######%**@+*%**#%+++++%##*** #+++++++++++++++++#+++++#****+======*****+
#****##%####@**%+*******@@+++@###**% #+++++++++++++*++++++++++****========****#
****#####%%*%*%+***@@@%%@*+++@####** *+++++++++++++++++++++#****=======****#
%***####%%**+%%*++*@=##@@%@++++%###*** ++++*+++++++++++#+**************#
@%%%@@##%%#++++++++==**@@**+++%*###**% +++++++++++#*+++++#*********####
%###%++++++++====**#++++%**##**% @% ++++#+++++++++++++**************#
%###%++++++++++++++++++%**%##**%@###@ %++++++++++++++++***=====********
###%%++++++++%++++++*%%%%###***##%##@ +++++++++++++##**************#
###%%%%+++++##+++++++#*+%###***%%%##@ ++++++++++++++%********+############%@
@%%*@*%%%%###****+*%%****++%##***%##@@@ #+++++++++++++++*********###*****#########*
#%%###***#####%**++++##**%#@@#@ ##+++++++++*###%#+***+***##*************#######
@#%%####%%####%+++++++##*######%++++++++++++++#*+++++#%###%#######*********######%
##%########@%@+++@###%*%#####@+++++++++++%**++++++++++%%%%%%########***==**###%##%
%#%###%###########@@%#%#@@##++++++++****++++********+++ %########**===*###%*#
#**##%####@@####%@######%*++++++++++++++++#++**+*#++++# ########******###% %
@#***# ###%@@##%#######@+++++++++++++++++++++%*++**++++# *########******##% @
*******% %##% =@#########++++++++++++++++++#++++*%++*#%#++# ########******##%
#@%@# %% *@#@@###*+++++++++++++++++++%+++##+++###++* ##*#####******##@
**##%*++%++++++++++++++++++++++++++++++++% +#**#####******###
##%#######*@***+#+++++++++++++++#***#++++++++++++ %**#####*******#%
*+++++$****##****++++++++##% #******#+++++++++++ %**#####*******#@
#++++++++*******- ++++++++# *******#++++++++++# @**#####*******#
#@@+++++++******- *+++++++# #******#+++++++++* **####%**==+**@
@@@@@+++ %+++++++# ******# %+++++++ %*###%***===**@ %=
@@@@@@@@@ #+++++++# =****** #++++++% *###%#***=+**% %**
@@@@@@@@@@ ++++++++# ******# #++++++# *##@%********% @*@
@@+@@@++@@+ ++++++++# ******# #++++++# @## #*********@ #***#
@@+@@++@@@++ @@@++++++* @@@%**** #@@++++% +## %#****************%
@*@**@+++# @@@@+++++ @@@@@@**# @@@@@++++# @# %#****************
+#+++++# @@@@@@+++% @@@@@@@@# @@@@@@@++ @ %##************%
#+++** @@@@@@@@@@ @@@@@@@@@ @@@@@@@@@ %###********%*
@@@@@@@@@@+ @@@@@@@@@@ =@@@@@@@@@ %%#####%%
*@@@@@@@@@@ @+*@@@@@@@= @@++@@@@@@
@++@@@@@@@@ #**@**@@@@@ *@@*#@@@@@@ -=
@%#@@@@@@@@ *#***@@@@@@ @+#+@++#@@@
#+++@++@@@@@ **********# #+++++@+@@@@
##+#+++@@@@@@ ##****#### *+#+##+++@@%%
#+++++++++++# #++++++++++#
#########*
____ ____ ____ _ _ ___ ____ ___ ___ ____ ____
( _ \( _ \(_ _)( \( )/ __)( ___)/ __)/ __) ( _ \(_ _)/\/
)___/ ) / _)(_ ) (( (__ )__) \__ \\__ \ )___/ _)(_
(__) (_)\_)(____)(_)\_)\___)(____)(___/(___/ (__) (____)
Princess Pi
https://linktr.ee/princesspi3
'@
Write-Host $art -ForegroundColor Blue;
}
function Get-AlgorithmFromHashLength {
param([string]$HashString);
switch ($HashString.Trim().Length) {
32 { return 'MD5'; }
40 { return 'SHA1'; }
64 { return 'SHA256'; }
96 { return 'SHA384'; }
128 { return 'SHA512'; }
default {
Write-ErrorWithHelp "checksum: Could not auto-detect algorithm for hash length $($HashString.Length). Please specify -Algorithm.";
return $null;
}
}
}
# --- MAIN EXECUTION FLOW ---
$helpInPath = $false;
if ($FilePath) {
foreach ($p in ($FilePath)) {
if ($p -match '^(?i)[-/]{1,2}(h|help|\?)$') {
$helpInPath = $true;
break;
}
}
}
if ($Help.IsPresent -or $helpInPath) {
Show-Help;
return;
}
if ($PrincessPi.IsPresent) {
Show-PrincessPiArt;
return;
}
if (-not [string]::IsNullOrWhiteSpace($Algorithm)) {
$Algorithm = $Algorithm.ToUpper();
}
$isWildcardGlobal = $false;
if ($FilePath) {
foreach ($p in $FilePath) {
if ($p -match '\*') { $isWildcardGlobal = $true; }
}
}
$showProgress = $Recursive.IsPresent -or $isWildcardGlobal -or ($PSCmdlet.ParameterSetName -eq 'Verify');
# --- ITEM GATHERING (Generate & Match Modes) ---
if ($PSCmdlet.ParameterSetName -in @('Generate', 'Match')) {
if (-not $FilePath -or $FilePath.Count -eq 0) {
Write-ErrorWithHelp "checksum: Missing file path parameter. Use -Help for usage.";
return;
}
$allItems = @();
$skipExtensions = @('.md5', '.sha1', '.sha256', '.sha384', '.sha512');
foreach ($pathEntry in ($FilePath)) {
$isWildcard = ($pathEntry -match '\*');
$resolvedItems = @();
if ($Recursive) {
$resolvedItems = Get-ChildItem -Path ($pathEntry) -Recurse -File -ErrorAction 'SilentlyContinue';
} else {
if ($isWildcard -or ($pathEntry -match '\?')) {
$resolvedItems = Get-ChildItem -Path ($pathEntry) -File -ErrorAction 'SilentlyContinue';
} else {
$resolvedItems = Get-Item -Path ($pathEntry) -ErrorAction 'SilentlyContinue';
}
}
if (-not $resolvedItems) {
Write-ErrorWithHelp "checksum: $($pathEntry): No such file or directory";
continue;
}
$explicitFileFound = $false;
if ((-not $isWildcard) -and (Test-Path -Path ($pathEntry) -PathType 'Leaf')) {
$explicitFileFound = $true;
}
foreach ($item in ($resolvedItems)) {
if ($item.PSIsContainer) { continue; }
if (-not $explicitFileFound) {
if ($skipExtensions -contains $item.Extension.ToLower()) {
continue;
}
}
$allItems += $item;
}
}
}
# --- DIRECT MATCH MODE (-m / -Match) ---
if ($PSCmdlet.ParameterSetName -eq 'Match') {
if ([string]::IsNullOrWhiteSpace($Algorithm)) {
$Algorithm = Get-AlgorithmFromHashLength -HashString ($Match);
if (-not $Algorithm) { return; }
}
$expectedHash = $Match.Trim().ToLower();
$totalFiles = $allItems.Count;
$currentIndex = 0;
$allItems | ForEach-Object -Parallel {
$item = $_
$algo = $using:Algorithm
$exp = $using:expectedHash
$actualHash = (Get-FileHash -Path ($item.FullName) -Algorithm ($algo)).Hash.ToLower();
$targetFile = Resolve-Path -Path ($item.FullName) -Relative -ErrorAction 'SilentlyContinue';
if (-not $targetFile) { $targetFile = $item.Name; }
if ($targetFile.StartsWith(".\") -or $targetFile.StartsWith("./")) { $targetFile = $targetFile.Substring(2); }
[PSCustomObject]@{
TargetFile = $targetFile
IsMatch = ($actualHash -eq $exp)
}
} -ThrottleLimit 16 | ForEach-Object {
$currentIndex++
if ($showProgress -and $totalFiles -gt 0) {
Write-Progress -Activity "Matching Checksums ($Algorithm)" -Status "Processing file $currentIndex of $totalFiles" -PercentComplete (($currentIndex / $totalFiles) * 100);
}
if ($_.IsMatch) {
Write-Host "$($_.TargetFile): " -NoNewline;
Write-Host "OK" -ForegroundColor Green;
} else {
Write-Host "$($_.TargetFile): " -NoNewline;
Write-Host "FAILED" -ForegroundColor Red;
}
}
if ($showProgress) {
Write-Progress -Activity "Matching Checksums ($Algorithm)" -Completed;
}
}
# --- VERIFICATION MODE (-c / -Check) ---
elseif ($PSCmdlet.ParameterSetName -eq 'Verify') {
$checkFiles = @();
if ($Recursive) {
$checkFileName = Split-Path -Path ($Check) -Leaf;
$checkFiles = Get-ChildItem -Path '.\' -Filter ($checkFileName) -Recurse -File -ErrorAction 'SilentlyContinue';
} else {
if (Test-Path -Path ($Check) -PathType 'Leaf') {
$checkFiles = @(Get-Item -Path ($Check));
}
}
if (-not $checkFiles -or $checkFiles.Count -eq 0) {
Write-ErrorWithHelp "checksum: $($Check): No such file or directory";
return;
}
foreach ($cf in ($checkFiles)) {
$lines = Get-Content -Path ($cf.FullName);
$baseDir = $cf.DirectoryName;
$fileAlgo = $Algorithm;
if ([string]::IsNullOrWhiteSpace($fileAlgo)) {
foreach ($line in ($lines)) {
if ([string]::IsNullOrWhiteSpace($line) -or $line.StartsWith("#")) { continue; }
if ($line -match '^([a-fA-F0-9]+)\s+') {
$fileAlgo = Get-AlgorithmFromHashLength -HashString ($Matches[1]);
break;
}
elseif ($line -match '^([a-fA-F0-9]{128}|[a-fA-F0-9]{96}|[a-fA-F0-9]{64}|[a-fA-F0-9]{40}|[a-fA-F0-9]{32})') {
$fileAlgo = Get-AlgorithmFromHashLength -HashString ($Matches[1]);
break;
}
}
if ([string]::IsNullOrWhiteSpace($fileAlgo)) { $fileAlgo = 'SHA256'; }
}
$verifyItems = @();
foreach ($line in ($lines)) {
if ([string]::IsNullOrWhiteSpace($line) -or $line.StartsWith("#")) { continue; }
$expectedHash = $null;
$targetFile = $null;
if ($line -match '^([a-fA-F0-9]+)\s+[* ]?(.*)$') {
$expectedHash = $Matches[1].ToLower();
$targetFile = $Matches[2].Trim().TrimStart('*');
}
elseif ($line -match '^([a-fA-F0-9]{128}|[a-fA-F0-9]{96}|[a-fA-F0-9]{64}|[a-fA-F0-9]{40}|[a-fA-F0-9]{32})[* ]?(.*)$') {
$expectedHash = $Matches[1].ToLower();
$targetFile = $Matches[2].Trim().TrimStart('*');
}
if ($expectedHash -and $targetFile) {
$targetFullPath = Join-Path -Path ($baseDir) -ChildPath ($targetFile);
$verifyItems += [PSCustomObject]@{
ExpectedHash = $expectedHash
TargetFile = $targetFile
TargetFullPath = $targetFullPath
BaseDir = $baseDir
};
}
}
$totalFiles = $verifyItems.Count;
$currentIndex = 0;
$verifyItems | ForEach-Object -Parallel {
$item = $_
$algo = $using:fileAlgo
if (Test-Path -Path ($item.TargetFullPath) -PathType 'Leaf') {
$actualHash = (Get-FileHash -Path ($item.TargetFullPath) -Algorithm ($algo)).Hash.ToLower();
$displayPath = Resolve-Path -Path ($item.TargetFullPath) -Relative -ErrorAction 'SilentlyContinue';
if (-not $displayPath) { $displayPath = $item.TargetFile; }
if ($displayPath.StartsWith(".\") -or $displayPath.StartsWith("./")) { $displayPath = $displayPath.Substring(2); }
[PSCustomObject]@{
DisplayPath = $displayPath
Status = if ($actualHash -eq $item.ExpectedHash) { "OK" } else { "FAILED" }
IsError = $false
}
} else {
$displayPath = $item.TargetFile;
if ($item.BaseDir -ne (Get-Location).Path) {
$displayPath = Join-Path -Path (Resolve-Path -Path ($item.BaseDir) -Relative -ErrorAction 'SilentlyContinue') -ChildPath ($item.TargetFile);
if ($displayPath.StartsWith(".\") -or $displayPath.StartsWith("./")) { $displayPath = $displayPath.Substring(2); }
}
[PSCustomObject]@{
DisplayPath = $displayPath
Status = "FAILED open or read"
IsError = $true
}
}
} -ThrottleLimit 16 | ForEach-Object {
$currentIndex++
if ($totalFiles -gt 0) {
Write-Progress -Activity "Verifying Checksums ($fileAlgo)" -Status "Processing file $currentIndex of $totalFiles" -PercentComplete (($currentIndex / $totalFiles) * 100);
}
Write-Host "$($_.DisplayPath): " -NoNewline;
if ($_.IsError) {
Write-Host "$($_.Status)" -ForegroundColor Red;
} elseif ($_.Status -eq "OK") {
Write-Host "OK" -ForegroundColor Green;
} else {
Write-Host "FAILED" -ForegroundColor Red;
}
}
Write-Progress -Activity "Verifying Checksums ($fileAlgo)" -Completed;
}
}
# --- GENERATION MODE ---
else {
if ([string]::IsNullOrWhiteSpace($Algorithm)) {
$Algorithm = 'SHA256';
}
$wantCustomOut = $PSBoundParameters.ContainsKey('OutFile');
$wantAutoOut = $Save.IsPresent;
if ($wantCustomOut -or $wantAutoOut) {
if ($Recursive -and $isWildcardGlobal) {
$groupedItems = $allItems | Group-Object DirectoryName;
foreach ($group in ($groupedItems)) {
$dirPath = $group.Name;
$filesInDir = $group.Group;
if ($wantCustomOut) {
$currentOutFile = Join-Path -Path ($dirPath) -ChildPath ($OutFile);
} else {
$currentOutFile = Join-Path -Path ($dirPath) -ChildPath "checksums.$($Algorithm.ToLower())";
}
$totalFiles = $filesInDir.Count;
$currentIndex = 0;
$linesToWrite = @();
$filesInDir | ForEach-Object -Parallel {
$item = $_
$algo = $using:Algorithm
$hash = (Get-FileHash -Path ($item.FullName) -Algorithm ($algo)).Hash.ToLower();
$relativePath = Resolve-Path -Path ($item.FullName) -Relative -ErrorAction 'SilentlyContinue';
if (-not $relativePath) { $relativePath = $item.Name; }
if ($relativePath.StartsWith(".\") -or $relativePath.StartsWith("./")) {
$relativePath = $relativePath.Substring(2);
}
[PSCustomObject]@{
Item = $item
Hash = $hash
RelativePath = $relativePath
OutputLine = "${hash} ${relativePath}"
ItemOutFile = "$($item.FullName).$($algo.ToLower())"
}
} -ThrottleLimit 16 | ForEach-Object {
$currentIndex++;
if ($showProgress -and $totalFiles -gt 0) {
Write-Progress -Activity "Computing Checksums ($Algorithm)" -Status "Directory: $(Split-Path $dirPath -Leaf) [$currentIndex/$totalFiles]" -PercentComplete (($currentIndex / $totalFiles) * 100);
}
$linesToWrite += $_.OutputLine;
Write-Output $_.OutputLine;
}
if ($showProgress) {
Write-Progress -Activity "Computing Checksums ($Algorithm)" -Completed;
}
Set-Content -Path ($currentOutFile) -Value $linesToWrite -Encoding utf8;
}
}
else {
if ($wantCustomOut -or ($wantAutoOut -and $isWildcardGlobal)) {
if ($wantCustomOut) {
$singleOutFile = $OutFile;
} else {
$singleOutFile = "checksums.$($Algorithm.ToLower())";
}
$totalFiles = $allItems.Count;
$currentIndex = 0;
$linesToWrite = @();
$allItems | ForEach-Object -Parallel {
$item = $_
$algo = $using:Algorithm
$hash = (Get-FileHash -Path ($item.FullName) -Algorithm ($algo)).Hash.ToLower();
$relativePath = Resolve-Path -Path ($item.FullName) -Relative -ErrorAction 'SilentlyContinue';
if (-not $relativePath) { $relativePath = $item.Name; }
if ($relativePath.StartsWith(".\") -or $relativePath.StartsWith("./")) {
$relativePath = $relativePath.Substring(2);
}
[PSCustomObject]@{
Item = $item
Hash = $hash
RelativePath = $relativePath
OutputLine = "${hash} ${relativePath}"
ItemOutFile = "$($item.FullName).$($algo.ToLower())"
}
} -ThrottleLimit 16 | ForEach-Object {
$currentIndex++;
if ($showProgress -and $totalFiles -gt 0) {
Write-Progress -Activity "Computing Checksums ($Algorithm)" -Status "Processing file $currentIndex of $totalFiles" -PercentComplete (($currentIndex / $totalFiles) * 100);
}
$linesToWrite += $_.OutputLine;
Write-Output $_.OutputLine;
}
if ($showProgress) {
Write-Progress -Activity "Computing Checksums ($Algorithm)" -Completed;
}
Set-Content -Path ($singleOutFile) -Value $linesToWrite -Encoding utf8;
}
else {
$totalFiles = $allItems.Count;
$currentIndex = 0;
$allItems | ForEach-Object -Parallel {
$item = $_
$algo = $using:Algorithm
$hash = (Get-FileHash -Path ($item.FullName) -Algorithm ($algo)).Hash.ToLower();
$relativePath = Resolve-Path -Path ($item.FullName) -Relative -ErrorAction 'SilentlyContinue';
if (-not $relativePath) { $relativePath = $item.Name; }
if ($relativePath.StartsWith(".\") -or $relativePath.StartsWith("./")) {
$relativePath = $relativePath.Substring(2);
}
[PSCustomObject]@{
Item = $item
Hash = $hash
RelativePath = $relativePath
OutputLine = "${hash} ${relativePath}"
ItemOutFile = "$($item.FullName).$($algo.ToLower())"
}
} -ThrottleLimit 16 | ForEach-Object {
$currentIndex++;
if ($showProgress -and $totalFiles -gt 0) {
Write-Progress -Activity "Computing Checksums ($Algorithm)" -Status "Processing file $currentIndex of $totalFiles" -PercentComplete (($currentIndex / $totalFiles) * 100);
}
Write-Output $_.OutputLine;
Set-Content -Path ($_.ItemOutFile) -Value $_.OutputLine -Encoding utf8;
}
if ($showProgress) {
Write-Progress -Activity "Computing Checksums ($Algorithm)" -Completed;
}
}
}
}
else {
$totalFiles = $allItems.Count;
$currentIndex = 0;
$allItems | ForEach-Object -Parallel {
$item = $_
$algo = $using:Algorithm
$hash = (Get-FileHash -Path ($item.FullName) -Algorithm ($algo)).Hash.ToLower();
$relativePath = Resolve-Path -Path ($item.FullName) -Relative -ErrorAction 'SilentlyContinue';
if (-not $relativePath) { $relativePath = $item.Name; }
if ($relativePath.StartsWith(".\") -or $relativePath.StartsWith("./")) {
$relativePath = $relativePath.Substring(2);
}
[PSCustomObject]@{
Item = $item
Hash = $hash
RelativePath = $relativePath
OutputLine = "${hash} ${relativePath}"
ItemOutFile = "$($item.FullName).$($algo.ToLower())"
}
} -ThrottleLimit 16 | ForEach-Object {
$currentIndex++;
if ($showProgress -and $totalFiles -gt 0) {
Write-Progress -Activity "Computing Checksums ($Algorithm)" -Status "Processing file $currentIndex of $totalFiles" -PercentComplete (($currentIndex / $totalFiles) * 100);
}
Write-Output $_.OutputLine;
}
if ($showProgress) {
Write-Progress -Activity "Computing Checksums ($Algorithm)" -Completed;
}
}
}
-7
View File
@@ -1,7 +0,0 @@
param(
# powershell is factually gay idkl why its such a shit
[Parameter(Mandatory=$True, Position=0)]
[string]$Filename
)
# apng is far hjigher quality and also preserves transparancy :activated:
ffmpeg -i "$Filename" -plays 0 -f apng "$Filename.apng"
+18
View File
@@ -0,0 +1,18 @@
param(
# powershell is factually gay idkl why its such a shit
[Parameter(Mandatory=$True, Position=0)] # deband the param, its in position 0 so ya canb just ffmpreg_gif_loopy filename.mp4 OR ffmpreg_gif_loopy -Filename filename.mp4
[string]$Filename # var for filename string
)
# apng is far hjigher quality and also preserves transparancy :activated:
$noextpath = [System.IO.Path]::GetFileNameWithoutExtension($Filename) # get filename without extension
$gifpath = "$noextpath`_MAXLOOP.gif" # add da .gif extension and MAXLOOP tag
# ffmpeg
## -i input file (mp4)
## settings for -filter_complex purely vibe coded for max quality
### split [a][b]: Splitting clones the video stream into two identical, simultaneous feeds. This lets you process the color palette and render the GIF all in one
### palettegen=stats_mode=single: This generates the highest quality 256-color palette based strictly on the exact colors present in your video. Changing the mode to single tells FFmpeg to optimize colors for moving objects across frames.
### paletteuse=dither=bayer:bayer_scale=5: This dictates how colors are blended. Using a strict bayer dither with a scale of 5 keeps gradients incredibly clean and crisp, eliminating the ugly "cross-hatch" or "grainy" patterns typical of basic GIFs
## -loop 0 maek da gif loop
## outputfile (gif)
ffmpeg -i "$Filename" -filter_complex "[0:v] split [a][b];[a] palettegen=stats_mode=single [p];[b][p] paletteuse=dither=bayer:bayer_scale=5" -loop 0 "$gifpath"
+99
View File
@@ -0,0 +1,99 @@
[CmdletBinding()]
param(
# First string to compare
[Parameter(Position = 0)]
[string]$String1,
# Second string to compare
[Parameter(Position = 1)]
[string]$String2,
# Optional switch to enable case-sensitive comparison
[switch]$CaseSensitive,
# Help flag (-h, -Help)
[Alias('h')]
[switch]$Help
)
begin {
function Show-Help {
@'
NAME
match - Compare two strings and output visual match status
SYNOPSIS
match <String1> <String2> [-CaseSensitive]
match -Help
DESCRIPTION
Compares two string arguments.
Outputs "Match OK" in GREEN if they match.
Outputs "FAIL: NO MATCH" in RED if they differ.
PARAMETERS
String1
The first string to compare.
String2
The second string to compare.
-CaseSensitive
Perform a case-sensitive comparison (default is case-insensitive).
-h, -Help, h, help (case insensitive)
Display this help message.
EXAMPLES
1. Compare two strings (case-insensitive default):
match "hello" "Hello"
Output: Match OK (in green)
2. Compare two strings with case sensitivity:
match "hello" "Hello" -CaseSensitive
Output: FAIL: NO MATCH (in red)
3. Compare hashes or checksum outputs:
match "e3b0c442" "e3b0c442"
Output: Match OK (in green)
'@
}
}
process {
# Check if help was explicitly requested via flag or positional parameter
$isHelpRequested = $Help.IsPresent -or (
$PSBoundParameters.Count -gt 0 -and (
($String1 -and $String1 -match '^(?i)[-/]{0,2}(h|help)$') -or
($String2 -and $String2 -match '^(?i)[-/]{0,2}(h|help)$')
)
)
if ($isHelpRequested) {
Show-Help
return
}
# Trigger help usage if either string parameter is missing or whitespace
if ([string]::IsNullOrWhiteSpace($String1) -or [string]::IsNullOrWhiteSpace($String2)) {
Write-Host "Error: Missing required arguments." -ForegroundColor Yellow
Write-Host "Usage: match <String1> <String2> [-CaseSensitive]" -ForegroundColor Cyan
Write-Host "Run 'match -Help' for detailed documentation.`n"
return
}
# Compare strings based on case-sensitivity choice
$isMatch = if ($CaseSensitive) {
$String1 -ceq $String2
} else {
$String1 -eq $String2
}
if ($isMatch) {
Write-Host "`n`nSUCCESS: MATCH OK!`n`n" -ForegroundColor Green
} else {
Write-Host "`n`nFAIL: NO MATCH!`n`n" -ForegroundColor Red
}
}
end {}
-6
View File
@@ -1,6 +0,0 @@
param (
[Parameter(Mandatory=$true)]
[string]$infile
)
Invoke-Expression "$PSScriptRoot\winhash.ps1 $infile MD5"
+38
View File
@@ -0,0 +1,38 @@
# TEXT TO ASCII ART GENERATOR https://patorjk.com/software/taag/#p=display&f=Graceful&t=PRINCESS+PI&x=none&v=4&h=4&w=80&we=false
# IMAGE TO ASCII ART GENERATOR https://www.asciiart.eu/image-to-ascii
Clear-Host # cleanup
Write-Host -ForegroundColor Magenta @'
=--= =----=
=--= -------=
=--= --------=
=----= --- =---------=
----= =--- ---==++=----:-----=
=-----= - ---- ========----::----=
=------= ----=+===-::::::::=+**++===+#
==-----=----=+**+=:::-======++******+==+##
=------=-=+*:::-=============+*****+==+*##
=------=+=:-++==--+=++===+====+***+===***=
=--------+*===---+===+===+++==+**=+==+**+-
=------=+===--=+++==++++%%*==**====+**+.- -
#=---=+====-=+++=+++*+.%+-==**=-==+**+.. --
#**+--+========++++#%#**=--==**--==+**=..: =-
*****+======+-+++*%%@@%=---==**--+=+*--:..- =
#*****=====+=-=++***#%#-----=**=-+=+*=---:.. %%
%****+====+=--=+++.:+*=-------=*-===**=---:..- %%
#***+=====------=:.-=----------==+=+**+---...: %%%%#%
#**+====:---------=-------------+=+=***=-....: %%##%%##
%***====..:---------------------==+=-****:.....+%#%%#%%%%#
#**+==*=...---------------:.----+==--=***=....##%#######%%
#***+=+*=...--------------:..:--=+=----+***:...#%###%%##%
#**+==+*=..:-------------:...:--++------=***.:+##%#%%%#% =
#***+==+**...:----------:.....:--+=------==**++##%#%%%%% =-
#***#+==+**=.................+*---+=------=#+=##%%##%%%#%=---
%#**#%*===+***-.....---...=+.:*#=----------=##*#%####%%%%#=----
%#### +===****-...: -+##=#%%+---------+###%%%%%%#%%%%%*-----
*===+****-..- %###%%%+------=*######%%%%%%%##%#*------
+===+****-.- %##%%%*-----#########%####%#####*-------
____ ____ __ __ _ ___ ____ ____ ____ ____ __
( _ \( _ \( )( ( \ / __)( __)/ ___)/ ___) ( _ \( )
) __/ ) / )( / /( (__ ) _) \___ \\___ \ ) __/ )(
(__) (__\_)(__)\_)__) \___)(____)(____/(____/ (__) (__)
'@
-6
View File
@@ -1,6 +0,0 @@
param (
[Parameter(Mandatory=$true)]
[string]$infile
)
Invoke-Expression "$PSScriptRoot\winhash.ps1 $infile SHA1"
-6
View File
@@ -1,6 +0,0 @@
param (
[Parameter(Mandatory=$true)]
[string]$infile
)
Invoke-Expression "$PSScriptRoot\winhash.ps1 $infile SHA256"
-6
View File
@@ -1,6 +0,0 @@
param (
[Parameter(Mandatory=$true)]
[string]$infile
)
Invoke-Expression "$PSScriptRoot\winhash.ps1 $infile SHA384"
-6
View File
@@ -1,6 +0,0 @@
param (
[Parameter(Mandatory=$true)]
[string]$infile
)
Invoke-Expression "$PSScriptRoot\winhash.ps1 $infile SHA512"
@@ -1,143 +0,0 @@
# Usage:
# Open PowerShell as Administrator
# win+x
# alt+a
# alt+y
# Run:
# In admin powershell Terminal:
# iwr -UseBasicParsing -Uri "https://git.thecoven.info/PrincessPi/general-scripts-and-system-ssssssetup/raw/branch/main/Windows-Scripts/windows-repair.ps1?nocache=$(Get-Random)" -OutFile "$env:TEMP\windows-repair-temp.ps1"; powershell -ExecutionPolicy Bypass -File "$env:TEMP\windows-repair-temp.ps1"
# or maybe
# iwr https://git.thecoven.info/PrincessPi/general-scripts-and-system-ssssssetup/raw/branch/main/Windows-Scripts/windows-repair.ps1 | iex
# check if hasadmin rights, if notm run script in new terminal, clopsing old
## if not, carry on
if (-not ([Security.Principal.WindowsIdentity]::GetCurrent().Groups -contains 'S-1-5-32-544')) {
# launch tghis script int new window after promopting for admin
Start-Process -FilePath 'powershell' -Verb RunAs -ArgumentList "-ExecutionPolicy Bypass -File $PSCommandPath"
# CLOSE previous terminal
exit 0
} else {
clear # clear window
Write-Host -ForegroundColor Magenta @'
.. .....
....------..
..:--------.. .......
..----------.. ....---..
...---------=------::....:----:..
..-----=+**************=-----:...
.----+****************=-----...
.--=****************=-----=**+:::--:....
.-=#*********##**++=---====++**+-----:.
..:==********#=.+@%-==++===++===++*=----...
.:=::******%%+-::=++====+==++====+**=--...
.:+..+*****--@===-:-%--====-=+====+*#=:..
.-=.-****#=.#+===--=+===----======+*+..
.:=:+****#@#+=====-**-----*+====++**:.
.. .=****=--======-..%-----%+==++***+-..
..=++***+-.----======..*-----#+==+***#%#+..
.. .:-..---=====--------=-+==+**-@*. ............::::::....
..=:..--===+-:-------*%+==*+#%**=. .....:-------------------------:.
..............-:..--===+-..:-------+==+==.:... ...:----------------------------::.
......:----------::=:...--==+--:.:-------+==+=:.... ....--------------------------:.....
..:::----------------=-::.:--===---:.:------=--:.... ...:---------------------------...
..:------------------=--:..:--=+=--------::.:+-..... ...------------------------------..
...:-----------------:....----==-------:...=%*.......:::--------------------------------:..
...--------------:+......---------------:+%%#.----------------------------:.......-----:..
.:----===-------:-.. .:--------------*%%%%=--------------========------:.......-------:...
..-:.:------------....-.=---------=#%%%%##%------------=-----------------------------------..
.:--:....:--------:##*=:.-------=#%%%%%%#%+-----------=-------------------------------------:
..:-----------------::*%%#-------=###%%%%##=--------------------------------------:............
..:-------------------:.-#%%##+==+%%%%%%#%+------------------------...:::--------------::::::..
...:----------------------..-#%#%%%%%%%%*+#%=-------------------------=-:....:----------------:...
--------------------------:.-#%%%%%%%%+#@%%%--------------------------=++=-::---------------:...
---------------------------...+%%%%%%%#%%%%#---------------------------------------------:....
............------.....----:....-#%%%%%%%*=------------------------------::+=---------.......
..:-... ....-----.. ....-=-------------------------------------.=*+=.......
..---:....:-----:.......:--------------------------:-------------==+=-......
.:-------------..........:---------------------------..:-------------==..........
..-------------:... ...--------:...----------------....:-----------==-...........
..:----==------:..-.... ..--------:...:---------------.....:----------=+-.....
..------==+=++==-..+--:. .:--------.....-----------=*%=.. ..----------=+=......
....------------........:... ..:--------.....-------+#%%#@%.. ...----------=+=......
....---------===:............... .:----=+*#=. ..--+#**+%@@@#%+. ..:-:..=----=*=:.....
:............:=::+=:--:=.=-.::=... ..*@*-+%@@@:.....-@@#%@*#@@@#%:.. ..-:..---:-#**+-.........
.. ...::::....::-.:.::-.. ..*%:..*@@@*.. ..-%#%@@+%@@@@=.. ...::.=#=..-%*++=:... ...
...... .......... ..**...*#=*%:. .-*#@%+#%@@@@+... ..*%@%+...+%+=*+=-...
..*#:.-#+..+-. ..-*#**%%*%@@%=.. ..-%@@*:..+@%=:+**+=:..
..*@#*%%=..==. .-*%@#%@##@@@#-. ...#@@%*-=%@@#:..-=++=-
.:#@*-:++..==. .=#%@%*@@*%*=+*:....:.+@*::+%@@@%=......-*
.-%+...=%##%-. .+@*@%*%@##*-:*+..:-==*@=..:#@+:=*:.......
.:*#:..:*@@@%:. .-%@*%@#*%*#=..-%-....:+#=-.:#%-.:+-.......
.+@#=.-*@@@@*.. ....-%@@@@@@=..+%*.. .-%--=+#%-.:*-. ....
.-=++++++++=... .:***+++==::::... .-%#=-*#%#**#-.
..............
'@
Write-Host "`nFIXING WINDOWS FULL PRINCESS PI STYLE (THIS WILL TAKE MANY HOURS AND REBOOT MORE THAN ONCE, SLOWLY)`n" -ForegroundColor Magenta
Write-Host "ABORTING ANY SCHEDULED SHUTDOWN 1/17"
shutdown.exe /a > $null 2> $null # cmd abort scheduled shutdowns
Write-Host "GENERATING AND DISPLAYING COMPREHENSIVE STABILITY REPORT 2/17"
Start-Process "perfmon.exe" -ArgumentList "/report" -Wait
Write-Host "GENERATING AND DISPLAYING STABILITY HISTORY REPORT 3/17"
Start-Process "perfmon.exe" -ArgumentList "/rel" -Wait
Write-Host "CLEARING DNS 4/17"
ipconfig.exe /flushsdns > $null
Write-Host "CLEARING ARP CACHE 5/17"
Remove-NetNeighbor -Confirm:$false > $null 2> $null
Write-Host "CLEARING ALL SAMBA CREDENTIALS 6/17"
net.exe use * /delete /y > $null 2> $null # nuke all samba creds
Write-Host "RELEASING AND RENEWING DHCP 7/17"
# release and renew dhcp
ipconfig.exe /release > $null
ipconfig.exe /renew > $null
Write-Host "GETTING CONTROL OF WINDOWS UPDATE"
Install-Module -Name PSWindowsUpdate -Force > $null 2> $null
Import-Module PSWindowsUpdate
Write-Host "UPDATING MALWARE SIGNATURES 8/17"
Update-MpSignature # update windows defender malware siggs
Write-Host "RUNNING WINDOWS MALICIOUS SOFTWARE REMOVAL TOOL (MRT, MAY TAKE A LONG TIME, WONT SHOW STATUS) 9/17"
Start-Process -FilePath "MRT.exe" -ArgumentList "/F:Y /Q" -Wait # do full microsoft malicious software removal scan in background automatically removing anything found, wait to proceed
Write-Host "UPDATING MALWARE SIGNATURES (AGAIN) 10/17"
Update-MpSignature # update windows defender malware siggs
Write-Host "RUNNING FULL WINDOWS DEFENDER SCAN 11/17"
Start-MpScan -ScanType FullScan # full windows defender scan
Write-Host "RUNNING DISM ONLINE IMAGE CLEANUP 12/17"
DISM.exe /Online /Cleanup-Image /RestoreHealth # online check for bad files
Write-Host "RUNNING SYSTEM FILE CHECKER (SFC) 13/17"
SFC.exe /scannow # older check for bad files
Write-Host "SCHEDULING ESSENTIAL FILE CHECK ON NEXT BOOT 14/17"
SFC.exe /scanonce # check essential files on next boot
Write-Host "SCHEDULING OFFLINE CHECK DISK AND REPAIR OF C: (CHKDSK) 15/17"
echo y | chkdsk.exe /f /r C: # cmd checks C drive after reboot to waste time and fix errors (noninteractive via y ffuckery)
Write-Host "SCHEDULINMG OFFLINE MEMTEST 16/17"
mdsched.exe /s # schedule offline memtest (noninteractive)
Write-Host "SCHEDULING WINDOWS DEFENDER OFFLINE SCAN MAY REBOOT UNEXPECTEDLY 17/17"
Start-MpWDOScan # powershell starts Windows Defender Offline Scan after reboot
Write-Host "`nREBOOTING IN 5 MINUTES MAX PROVBABLY SOONER`n"
shutdown.exe /r /t (60*5) # shutdown in 5 minutes as failsafe
Write-Host "`nDONEsiez :3~`n"
}
-38
View File
@@ -1,38 +0,0 @@
# Usage:
## .\winhash.ps1 <FILE> <ALGO>
## Algos Supported:
### MD5
### SHA1
### SHA256
### SHA384
### SHA512
## Example:
### .\winhash.ps1 sillyfilly.bin SHA256
## Outputs to terminal and to a text file
### Text file name format <input filepath>.<unix epoch microseconds>.<hashing algorithm>.txt
param (
[Parameter(Mandatory=$true)] # prompt for input if not specified via cli
[string]$infile,
[Parameter(Mandatory=$true)] # this 1 2 :pope:
[string]$algo
)
function Get-UnixMicroseconds {
$unixEpoch = [DateTimeOffset]'1970-01-01T00:00:00Z' # unix epoch constant
$currentTime = [DateTimeOffset]::UtcNow # current utc time
$timeDifferenceTicks = $currentTime.Ticks - $unixEpoch.Ticks # subtract current time from unix epoch constant in ticks
$microseconds = [Int64]($timeDifferenceTicks / 10) # use 64bit int, divide ticks by 10 to give microseconds
# I am literally using Unix microseconds because they are more fun than Unix seconds :pinkie:
return $microseconds
}
# jesus fuckin analbeads the selection of hash algos in powershell is weird and limited
# probably because Bill Gates and Satya Nadella get together with the other C-suite executives
# and hypergoon to leagelese in clickwrap agreements that absolves them of liability and
# lets them sell our private data and other assorted dickpics or sumtin idk man lmao
$hash = $(Get-FileHash -Path $infile -Algorithm $algo | Format-List) # do da fookin hashin right dafucc here
echo $hash # show user
echo $hash > "$infile.$(Get-UnixMicroseconds).$algo.txt" # make the txt file
@@ -0,0 +1,58 @@
#!/bin/bash
domain=kasm.h.acker.is
local_port=8443
swap_size_gib=6
sudo apt update
sudo apt dist-upgrade -y
sudo fallocate -l ${swap_size_gib}g /mnt/${swap_size_gib}GiB.swap
sudo chmod 600 /mnt/${swap_size_gib}GiB.swap
sudo mkswap /mnt/${swap_size_gib}GiB.swap
sudo swapon /mnt/${swap_size_gib}GiB.swap
echo "/mnt/${swap_size_gib}GiB.swap swap swap defaults 0 0" | sudo tee -a /etc/fstab
cd /tmp
curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_1.19.0-latest.tar.gz
tar -xf kasm_release*.tar.gz
sudo bash kasm_release/install.sh -L $local_port
sudo apt update
sudo apt install nginx certbot python3-certbot-nginx -y
sudo certbot certonly --nginx -d $domain
sudo cat << 'EOF' > /etc/nginx/sites-available/$domain
server {
listen 443 ssl;
server_name $domain;
ssl_certificate /etc/letsencrypt/live/$domain/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/$domain/privkey.pem;
location / {
# WebSocket Support
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Host and X headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Should match the listening port of this proxy
proxy_set_header X-Forwarded-Port 443;
# Connectivity Options
proxy_http_version 1.1;
proxy_read_timeout 1800s;
proxy_send_timeout 1800s;
proxy_connect_timeout 1800s;
proxy_buffering off;
# Allow large requests to support file uploads to sessions
client_max_body_size 10M;
# Proxy to Kasm Workspaces running locally on $local_port using ssl
proxy_pass https://127.0.0.1:$local_port;
}
}
EOF
sudo ln -s /etc/nginx/sites-available/$domain /etc/nginx/sites-enabled/$domain
sudo nginx -t
sudo systemctl restart nginx
sudo docker restart kasm_api
sudo shutdown -r +7
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
# set -euo pipefail # we tolerate no failure :pensive: 😔
# nullglobyyyy so da FUCKIN wildcard STOPS BEING A FUCK
shopt -s nullglob
# add da current dir name, and timedate stamp to it plus sum middleshit idk
default_file_name="$(date +%Y-%m-%d-%H%M-%Z)_$(printf '%s\n' ${PWD##*/})_ChecksumsSHA256.sha256"
existing_sha256_files=(*.sha256)
# just for spooky :3
## sumtin spookie :3
# if sha256 files exist, handle
if [ ${#existing_sha256_files[@]} -gt 0 ]; then
# existing sha256 files fond
echo "Existing *.sha256 files found in $PWD, Checking the Latest $default_file_name"
for file in *.sha256; do
# on fnding sha256 files in pwd, generate shas56 checks of each one, notify OK! on success, delete the offending sha256 file if fail
[ -f "$file" ] && sha256sum -c $file && echo -e "$file Check: \033[0;32mOK!\033[0m\n" || (echo -e "\n$file NO MATCH! Deleting Bad File \033[31mFAIL\033[0m\n\n"; rm -f $file) # 2>/dev/null)
done
# validate the found checksums
sha256sum -c *.sha256 | tee -a "$default_file_name" && echo -e "\nAll Checksums: \033[0;32mOK!\033[0m\n" || echo -e "\nOne or More Checksums Failed to Match: \033[33mWARN ($?)\033[0m\n"
else
# no sha256 files, run generate
echo "NO Existing *.sha256 files found! Generating sha256 checksums recursively"
# recursive search in current working dir,
find "$PWD" -type f -exec bash -c "sha256sum {} | tee -a \"$PWD/$default_file_name\"" \; && echo -e "\nAll Checksums Created: \033[0;32mOK!\033[0m\n\tLog File: $default_file_name\n" || echo -e "\nOne or More Cecksums Failed to Run: \033[31mWARN ($?)\033[0m\n"
fi
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
set -e # we do noot tolerate failure here
# aint got no time for no bs
if [ -z "$1" ]; then
echo -e "ERROR\nUsage: hash_cred_check.sh <email or phone number>"
exit 1 # fail with error
fi
# 256 bits of random shit, encoded as base64
salt="$(openssl rand -base64 32)"
# set credential
credential="$1"
# output hex bytes after doi one hell of a argon2id fuckery
hash=$(echo -n "$credential" | argon2 "$(base64 -d <<< $salt)" -id -t 8 -m 19 -p 2 -r)
echo "Hash: $hash"
echo "Salt: $salt"
echo "Credential: $credential"
echo 'Protocol: echo -n "$credential" | argon2 "$(base64 -d <<< $salt)" -id -t 8 -m 19 -p 2 -r'
echo
echo "Verify with: hash_cred_verify.sh '$credential' '$salt' '$hash'"
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
set -e # mama didnt raise no bitch
# aint got no time for no bs
if [ -z "$1" -o -z "$2" -o -z "$3" ]; then
echo -e "ERROR\nUsage: hash_cred_check.sh '<email or phone number>' '<salt>' '<hash>'"
exit 1 # fail with error
fi
# set credential
credential="$1"
#set salt
salt="$2"
# set hash
hash="$3"
# debug
## echo -e "credential $credential"
## echo -e "salt $salt"
## echo -e "hash $hash"
# run da fuck
hash_check=$(echo -n "$credential" | argon2 "$(base64 -d <<< $salt)" -id -t 8 -m 19 -p 2 -r)
# debug
## echo -e "hash check $hash_check"
# compare demmm
if [[ $hash == $hash_check ]]; then
echo -e "\n\e[32mGOOD MATCH! \e[0m\n\t$credential \e[32mVERIFIED\e[0m\n"
else
echo -e "\n\e[31mBAD MATCH! \e[0m\n\t$credential \e[31mNOT VERIFIED\e[0m\n"
fi
+42 -48
View File
@@ -12,7 +12,6 @@ tmpDir='/tmp/generalssss'
tmp_customscripts_dir="$tmpDir/customscripts" tmp_customscripts_dir="$tmpDir/customscripts"
finalDir='/usr/share/customscripts' finalDir='/usr/share/customscripts'
packages="7zip apache2 argon2 avahi-daemon btop build-essential byobu cargo cifs-utils clamav cmake cowsay cracklib-runtime detox docker.io exiftool fdupes ffuf gcc-arm-none-eabi grc gzip iotop iptraf-ng jq kpartx libnss-mdns libnewlib-arm-none-eabi librust-git2+openssl-probe-dev libstdc++-arm-none-eabi-newlib locales lynx net-tools nginx openssl php polygen polygen-data procps python3 python3-scapy resolvconf restic ripgrep samba screen seclists snapd thefuck unzip wget xrdp xxd xz-utils zip kali-linux-default" packages="7zip apache2 argon2 avahi-daemon btop build-essential byobu cargo cifs-utils clamav cmake cowsay cracklib-runtime detox docker.io exiftool fdupes ffuf gcc-arm-none-eabi grc gzip iotop iptraf-ng jq kpartx libnss-mdns libnewlib-arm-none-eabi librust-git2+openssl-probe-dev libstdc++-arm-none-eabi-newlib locales lynx net-tools nginx openssl php polygen polygen-data procps python3 python3-scapy resolvconf restic ripgrep samba screen seclists snapd thefuck unzip wget xrdp xxd xz-utils zip kali-linux-default"
# packages="grc kpartx openssl cracklib-runtime argon2 jq polygen polygen-data apache2 seclists cmake locales python3 build-essential gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib librust-git2+openssl-probe-dev cargo nginx build-essential cowsay iotop iptraf-ng btop screen byobu thefuck wget lynx zip unzip 7zip xz-utils gzip net-tools clamav php restic cifs-utils detox fdupes ripgrep avahi-daemon libnss-mdns xxd xrdp libimage-exiftool-perl kali-tools-hardware kali-tools-crypto-stego kali-tools-fuzzing kali-tools-bluetooth kali-tools-rfid kali-tools-sdr kali-tools-voip kali-tools-802-11 kali-tools-forensics samba procps snapd"
echo -e "\nSTARTING!\n\tUsing Shell $SHELL\n" echo -e "\nSTARTING!\n\tUsing Shell $SHELL\n"
@@ -73,49 +72,48 @@ if [ ! -z "$1" ]; then
# echo -e "\nhaveibeenpwned-downloader installed, skipping install\n" # echo -e "\nhaveibeenpwned-downloader installed, skipping install\n"
# fi # fi
# homebrew # homebrew
# if [ ! $(which brew) ]; then if [ ! $(which brew) ]; then
# ## install homebrew ## install homebrew
# echo -e "\nlinuxbrew not found, installing\n" echo -e "\nlinuxbrew not found, installing\n"
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
# test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
# ### add to rcfile ### add to rcfile
# if ! grep -q 'linuxbrew' $rcfile; then if ! grep -q 'linuxbrew' $rcfile; then
# # echo "adding linuxbrew to $rcfile" echo "adding linuxbrew to $rcfile"
# # echo "# linuxbrew (homebrew/brew)" >> $rcfile echo "# linuxbrew (homebrew/brew)" >> $rcfile
# # echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> $rcfile echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> $rcfile
# else else
# echo "linuxbrew already in $rcfile skipping" echo "linuxbrew already in $rcfile skipping"
# fi fi
#
# # source $rcfile else
# else echo -e "\nlinuxbrew installed, skipping install\n"
# echo -e "\nlinuxbrew installed, skipping install\n" fi
# # source $rcfile ### install ponysay
# fi if [ ! $(which ponysay) ]; then
# ### install ponysay echo -e "\nponysay not fonud, installiing\n"
# if [ ! $(which ponysay) ]; then brew install ponysay
# echo -e "\nponysay not fonud, installiing\n" if ! grep 'ponysay fix' $rcfile; then
# brew install ponysay echo "adding ponysay fix to $rcfile"
# if ! grep 'ponysay fix' $rcfile; then echo -e "# ponysay fix\nexport PYTHONWARNINGS=ignore::SyntaxWarning" >> $rcfile
# # echo "adding ponysay fix to $rcfile" source $rcfile
# # echo -e "# ponysay fix\nexport PYTHONWARNINGS=ignore::SyntaxWarning" >> $rcfile else
# # source $rcfile echo "ponysay fix already in $rcfile skipping"
# else source $rcfile
# # echo "ponysay fix already in $rcfile skipping" fi
# # source $rcfile else
# fi echo -e "\nponysay already installed, skipping\n"
# else fi
# echo -e "\nponysay already installed, skipping\n"
# fi
# cargo # cargo
## oniux ## oniux
echo -e "\nINSTALLIN TOR ONIUX\n" echo -e "\nINSTALLIN TOR ONIUX\n"
if [ -f /usr/local/bin/oniux ]; then if [ -f /usr/local/bin/oniux ]; then
echo -e "\nexisting oniux found, skipping\n" echo -e "\nexisting oniux found, skipping\n"
else else
echo -e "\nexisting oniux not found, installing\n" echo -e "\nexisting oniux not found, installing\n"
cargo install --git https://gitlab.torproject.org/tpo/core/oniux --tag v0.6.1 oniux cd /tmp && cargo install --git https://gitlab.torproject.org/tpo/core/oniux && cd - && echo -e '## Oniux/Cargo Shit\nPATH=$PATH:$HOME/.cargo/bin' >> ~/.bashrc && source ~/.bashrc && oniux curl https://canhazip.com
fi fi
else else
@@ -160,7 +158,7 @@ git clone $gitRepo $tmpDir --single-branch --depth 1
# donut # donut
echo -e "\nCompiling donut\n" echo -e "\nCompiling donut\n"
gcc -o "$tmp_customscripts_dir/donut" "$tmp_customscripts_dir/donut.c" -lm # 2>/dev/null gcc -o "$tmp_customscripts_dir/donut" "$tmp_customscripts_dir/donut.c" -lm 2>/dev/null
# put the customscripts dir into place # put the customscripts dir into place
echo -e "\nPlacing in $finalDir\n" echo -e "\nPlacing in $finalDir\n"
@@ -181,10 +179,10 @@ pathgrep=$?
if [ $pathgrep -eq 0 ]; then if [ $pathgrep -eq 0 ]; then
echo -e "\n$finalDir Already in \$PATH Skipping Append\n" echo -e "\n$finalDir Already in \$PATH Skipping Append\n"
fi fi
# else else
# echo -e "\nAdding $finalDir to $username's \$PATH by Appending to $rcfile\n" # echo -e "\nAdding $finalDir to $username's \$PATH by Appending to $rcfile\n"
# echo -e "\n\n# automatically added by customscripts installer\nexport PATH=\"\$PATH:$finalDir\"" >> "$rcfile" # echo -e "\n\n# automatically added by customscripts installer\nexport PATH=\"\$PATH:$finalDir\"" >> "$rcfile"
# fi fi
# install pishrink if not there # install pishrink if not there
if [ ! -f /usr/local/bin/pishrink ]; then if [ ! -f /usr/local/bin/pishrink ]; then
@@ -204,15 +202,11 @@ if [ ! -d $userhome/.local/share/blesh ]; then
cd /tmp cd /tmp
git clone --recursive --depth 1 --shallow-submodules --single-branch -b master https://github.com/akinomyoga/ble.sh.git git clone --recursive --depth 1 --shallow-submodules --single-branch -b master https://github.com/akinomyoga/ble.sh.git
make -C ble.sh install PREFIX=~/.local make -C ble.sh install PREFIX=~/.local
# echo '# ble.sh' >> $rcfile echo '# ble.sh' >> $rcfile
# echo "source -- ~/.local/share/blesh/ble.sh" >> $rcfile echo "source -- ~/.local/share/blesh/ble.sh" >> $rcfile
# source $rcfile else
# exec "$SHELL" echo -e "\nble.sh already installed, skippping\n"
fi fi
# else
# echo -e "\nble.sh already installed, skippping\n"
# source $rcfile
# fi
$SHELL -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" $SHELL -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"' >> "$rcfile" echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"' >> "$rcfile"
+42
View File
@@ -0,0 +1,42 @@
#!/bin/bash
# TEXT TO ASCII ART GENERATOR https://patorjk.com/software/taag/#p=display&f=Graceful&t=PRINCESS+PI&x=none&v=4&h=4&w=80&we=false
# IMAGE TO ASCII ART GENERATOR https://www.asciiart.eu/image-to-ascii
clear
piascii=$(cat << 'EOF'
=--= =----=
=--= -------=
=--= --------=
=----= --- =---------=
----= =--- ---==++=----:-----=
=-----= - ---- ========----::----=
=------= ----=+===-::::::::=+**++===+#
==-----=----=+**+=:::-======++******+==+##
=------=-=+*:::-=============+*****+==+*##
=------=+=:-++==--+=++===+====+***+===***=
=--------+*===---+===+===+++==+**=+==+**+-
=------=+===--=+++==++++%%*==**====+**+.- -
#=---=+====-=+++=+++*+.%+-==**=-==+**+.. --
#**+--+========++++#%#**=--==**--==+**=..: =-
*****+======+-+++*%%@@%=---==**--+=+*--:..- =
#*****=====+=-=++***#%#-----=**=-+=+*=---:.. %%
%****+====+=--=+++.:+*=-------=*-===**=---:..- %%
#***+=====------=:.-=----------==+=+**+---...: %%%%#%
#**+====:---------=-------------+=+=***=-....: %%##%%##
%***====..:---------------------==+=-****:.....+%#%%#%%%%#
#**+==*=...---------------:.----+==--=***=....##%#######%%
#***+=+*=...--------------:..:--=+=----+***:...#%###%%##%
#**+==+*=..:-------------:...:--++------=***.:+##%#%%%#% =
#***+==+**...:----------:.....:--+=------==**++##%#%%%%% =-
#***#+==+**=.................+*---+=------=#+=##%%##%%%#%=---
%#**#%*===+***-.....---...=+.:*#=----------=##*#%####%%%%#=----
%#### +===****-...: -+##=#%%+---------+###%%%%%%#%%%%%*-----
*===+****-..- %###%%%+------=*######%%%%%%%##%#*------
+===+****-.- %##%%%*-----#########%####%#####*-------
____ ____ __ __ _ ___ ____ ____ ____ ____ __
( _ \( _ \( )( ( \ / __)( __)/ ___)/ ___) ( _ \( )
) __/ ) / )( / /( (__ ) _) \___ \\___ \ ) __/ )(
(__) (__\_)(__)\_)__) \___)(____)(____/(____/ (__) (__)
EOF
);
echo -e "\033[35m$piascii\033[0m"
-85
View File
@@ -1,85 +0,0 @@
#!/bin/bash
# usage
## curl -s https://raw.githubusercontent.com/PrincessPi3/general-scripts-and-system-ssssssetup/refs/heads/main/customscripts/python_pyenv_setup.sh | sudo "$SHELL" && source ~/.zshrc && exec "$SHELL" && pyenv install 3:latest && pyenv global 3:latest
# set -e
# set rcfile
rcfile="$HOME/.zshrc" # zsh
# rcfile="$USER/.bashrc" # bash
package_log="/home/princesspi/python_packages_removed.txt"
# check if a command exists, and if so, purge that package
# usage: check_purge_package <package_name>
check_purge_package () {
package_name=$1
# which -s $package_name 2>/dev/null 1>/dev/null # silently test for command
# package_check=$? # get return code. 0 for found, any other for not found
# if [ $package_check -eq 0 ]; then # if package is found, purge it
echo "purging $package_name"
sudo apt purge $package_name -y 2>>"$package_log" 1>>"$package_log"
echo "finished purging $package_name"
# else # otherwise skip
# echo "no $package_name installation found, skipping uninstall"
#fi
}
# cleanup previous python installs
# check_purge_package pyenv*
# check_purge_package python3*
# check_purge_package python2*
# check_purge_package python*
# check_purge_package pip*
# check_purge_package pip3*
# check_purge_package pip2*
# cleanup
# echo "Autoremoving packages"
# sudo apt autoremove -y 2>>"$package_log" 1>>"$package_log"
# echo -e "DONE CLEARING OLD PACKAGES!\n\tRemoved packages logged to $package_log"
if [ -d $HOME/.pyenv ]; then
echo "Removing existing pyenv installation"
rm -rf $HOME/.pyenv
else
echo "No existing pyenv installation found, skipping removal"
fi
# install pyenv
curl -fsSL https://pyenv.run | bash
## setup shell
### check for pyenv in rcfile
grep -q .pyenv $rcfile
rc_pyenv_check=$? # get retcode, 0 for found not 0 for not found
if [ $rc_pyenv_check -eq 0 ]; then # if pyenv found
echo "pyenv already set up in $rcfile, skipping add init"
else # if pyenv not found
echo "Setting up pyenv in $rcfile"
echo -e "\n# pyenv setup" >> $rcfile
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> $rcfile
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> $rcfile
echo 'eval "$(pyenv init - zsh)"' >> $rcfile
fi
## add aliases
### check for aliases in rcfile
grep -q '## python aliases' $rcfile
rc_pyalias_check=$? # get retcode, 0 for found not 0 for not found
if [ $rc_pyalias_check -eq 0 ]; then # if aliases found
echo "pyenv aliases already set up in $rcfile, skipping"
else # if aliases not found, add python shit
echo "Setting up pyenv aliases in $rcfile"
echo "## python aliases" >> $rcfile
echo 'alias py=python' >> $rcfile
echo 'alias py3=python' >> $rcfile
echo 'alias py2=python' >> $rcfile
echo 'alias python3=python' >> $rcfile
echo 'alias python2=python' >> $rcfile
echo 'alias pip3=pip' >> $rcfile
echo -e "alias pip2=pip\n" >> $rcfile
fi
echo -e "\n\ndone~ :3~\n\treset shell with exec \"\$SHELL\"\n"
+86
View File
@@ -0,0 +1,86 @@
#!/usr/bin/env bash
clear
# Define an array of standard 16-color ANSI foreground codes
colors=(
"\e[31m" # Red
"\e[33m" # Yellow
"\e[32m" # Green
"\e[36m" # Cyan
"\e[34m" # Blue
"\e[35m" # Magenta
)
color_count=${#colors[@]}
color_index=0
shuffle_colors() {
local i tmp rand
# Start from the last element and move backwards
for ((i=${#colors[@]}-1; i>0; i--)); do
# Generate a random index between 0 and i (inclusive)
rand=$(( RANDOM % (i + 1) ))
# Swap elements at index 'i' and 'rand'
tmp="${colors[i]}"
colors[i]="${colors[rand]}"
colors[rand]="$tmp"
done
}
# randomize dem color postions
shuffle_colors
# Reset code to clear colors at the end of output
reset="\e[0m"
read -r -d '' ascii_art << 'EOF'
--= =----=
=--= -------=
=--= --------=
=----= --- =---------=
----= =--- ---==++=----:-----=
=-----= - ---- ========----::----=
=------= ----=+===-::::::::=+**++===+#
==-----=----=+**+=:::-======++******+==+##
=------=-=+*:::-=============+*****+==+*##
=------=+=:-++==--+=++===+====+***+===***=
=--------+*===---+===+===+++==+**=+==+**+-
=------=+===--=+++==++++%%*==**====+**+.- -
#=---=+====-=+++=+++*+.%+-==**=-==+**+.. --
#**+--+========++++#%#**=--==**--==+**=..: =-
*****+======+-+++*%%@@%=---==**--+=+*--:..- =
#*****=====+=-=++***#%#-----=**=-+=+*=---:.. %%
%****+====+=--=+++.:+*=-------=*-===**=---:..- %%
#***+=====------=:.-=----------==+=+**+---...: %%%%#%
#**+====:---------=-------------+=+=***=-....: %%##%%##
%***====..:---------------------==+=-****:.....+%#%%#%%%%#
#**+==*=...---------------:.----+==--=***=....##%#######%%
#***+=+*=...--------------:..:--=+=----+***:...#%###%%##%
#**+==+*=..:-------------:...:--++------=***.:+##%#%%%#% =
#***+==+**...:----------:.....:--+=------==**++##%#%%%%% =-
#***#+==+**=.................+*---+=------=#+=##%%##%%%#%=---
%#**#%*===+***-.....---...=+.:*#=----------=##*#%####%%%%#=----
%#### +===****-...: -+##=#%%+---------+###%%%%%%#%%%%%*-----
*===+****-..- %###%%%+------=*######%%%%%%%##%#*------
+===+****-.- %##%%%*-----#########%####%#####*-------
____ ____ __ __ _ ___ ____ ____ ____ ____ __
( _ \( _ \( )( ( \ / __)( __)/ ___)/ ___) ( _ \( )
) __/ ) / )( / /( (__ ) _) \___ \\___ \ ) __/ )(
(__) (__\_)(__)\_)__) \___)(____)(____/(____/ (__) (__)
EOF
# Process the art character-by-character
for (( i=0; i<${#ascii_art}; i++ )); do
char="${ascii_art:$i:1}"
# If the character is a space or a newline, print it raw without wasting a color
if [[ "$char" == " " || "$char" == $'\n' ]]; then
printf "%s" "$char"
else
# Assign a color, print the letter, and rotate the index cycle
printf "%b%s" "${colors[$color_index]}" "$char"
color_index=$(( (color_index + 1) % color_count ))
fi
done
# Always clear the terminal color state back to default at the end
printf "%b\n" "$reset"
+40
View File
@@ -0,0 +1,40 @@
#!/bin/bash
# Usage:
## Install Tor
### sudo apt update; sudo apt install tor -y
## Edit /etc/tor/torrc
### sudo nano /etc/tor/torrc
#### Uncomment or add
##### ControlPort 9051
#### Ucomment and change to (default value is 1, change to 0)
##### CookieAuthentication 0
## Enable, Start, and Restart Tor
### sudo systemctl enable tor; sudo systemctl start tor; sleep 20; sudo systemctl restart tor
# Configuration
TARGET_URL="https://canhazip.com"
TOR_PROXY="socks5h://127.0.0.1:9050"
TOR_CONTROL_PORT=9051
DELAY=2 # Delay in seconds between requests
# Ensure you respect HIBP's API rate limits and terms of service
while true; do
echo "[+] Requesting new Tor identity..."
# Send NEWNYM signal to Tor Control Port to switch IP
echo -e 'AUTHENTICATE ""\r\nsignal NEWNYM\r\nQUIT' | nc 127.0.0.1 9051 > /dev/null
# Give Tor a brief moment to establish the new circuit
sleep "$DELAY"
echo "[+] Verifying current IP..."
CURRENT_IP=$(curl -s --proxy "$TOR_PROXY" https://canhazip.com)
echo "[+] Current Tor IP: $CURRENT_IP"
echo "[+] Sending request to Have I Been Pwned..."
# 'socks5h://' ensures DNS resolution happens through Tor, preventing leaks
curl -s --proxy "$TOR_PROXY" -H "hibp-api-key: YOUR_API_KEY" "$TARGET_URL"
echo -e "\n[+] Waiting for next iteration...\n"
sleep "$DELAY"
done