Compare commits
22 Commits
v1.0
...
sillyfilly
| Author | SHA1 | Date | |
|---|---|---|---|
| 08dee660f5 | |||
| ee6a75de9a | |||
| b58c78a3fe | |||
| 79ad72ff11 | |||
| e6cbe71c5b | |||
| 9e86c1a1cf | |||
| 60a2343bc8 | |||
| f67fbef18e | |||
| e909a9ba94 | |||
| b522288c96 | |||
| cde93f511a | |||
| 8aaef29ad4 | |||
| 9fec5e39b4 | |||
| 657f515135 | |||
| 036c985592 | |||
| 8b28c70d15 | |||
| b7ee3498da | |||
| 6e0d004880 | |||
| ed26939af4 | |||
| 58a15ff9d0 | |||
| 7d5b95fb18 | |||
| 0abfd658b7 |
+3
-2
@@ -1,4 +1,5 @@
|
|||||||
webhook.txt
|
*/webhook.txt
|
||||||
tag.txt
|
*/tag.txt
|
||||||
*.tmp
|
*.tmp
|
||||||
*.csv
|
*.csv
|
||||||
|
*.sha256
|
||||||
@@ -98,7 +98,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:
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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>
|
||||||
@@ -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="`~!@#$%^&*()-=_+[]\{}|;':",.<>?\">?</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 &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

Assumes all computing power on Earth being used collaboratively, doubling in power every 18 months.

Also assumes a weak hash, MD5. (EXCLUDES collisions in MD5)">?</a></sup></b> <span id="years"></span></p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -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>
|
||||||
@@ -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
|
||||||
@@ -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)
|
||||||
|
};
|
||||||
@@ -0,0 +1,277 @@
|
|||||||
|
[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)]
|
||||||
|
[string[]]$FilePath,
|
||||||
|
|
||||||
|
# Output file to save generated checksums (-o mode)
|
||||||
|
[Parameter(Mandatory = $false, ParameterSetName = 'Generate')]
|
||||||
|
[Alias('o')]
|
||||||
|
[string]$OutFile,
|
||||||
|
|
||||||
|
# File containing checksums to verify (-c mode)
|
||||||
|
[Parameter(Mandatory = $false, ParameterSetName = 'Verify')]
|
||||||
|
[Alias('c')]
|
||||||
|
[string]$Check,
|
||||||
|
|
||||||
|
# Direct checksum hash string to match against (-m mode)
|
||||||
|
[Parameter(Mandatory = $true, ParameterSetName = 'Match')]
|
||||||
|
[Alias('m')]
|
||||||
|
[string]$Match,
|
||||||
|
|
||||||
|
# Hashing algorithm to use (Defaults to SHA256)
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[Alias('a')]
|
||||||
|
[ValidateSet('SHA1', 'SHA256', 'SHA384', 'SHA512', 'MD5')]
|
||||||
|
[string]$Algorithm,
|
||||||
|
|
||||||
|
# Help flag (-h, -Help)
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[Alias('h')]
|
||||||
|
[switch]$Help
|
||||||
|
)
|
||||||
|
|
||||||
|
begin {
|
||||||
|
function Show-Help {
|
||||||
|
@'
|
||||||
|
NAME
|
||||||
|
checksum - Compute and verify message digests / file checksums
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
.\checksum.ps1 [-FilePath] <string[]> [-OutFile <string>] [-Algorithm <string>]
|
||||||
|
.\checksum.ps1 [-FilePath] <string[]> -Match <string> [-Algorithm <string>]
|
||||||
|
.\checksum.ps1 -Check <string> [-Algorithm <string>]
|
||||||
|
.\checksum.ps1 -Help
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
Computes or verifies checksums using various cryptographic algorithms.
|
||||||
|
Outputs hash values in standard Linux utility format (<hash> <filename>).
|
||||||
|
|
||||||
|
PARAMETERS
|
||||||
|
-FilePath <string[]>
|
||||||
|
Specifies the path to one or more files to hash. Accepts wildcards (*).
|
||||||
|
|
||||||
|
-o, -OutFile <string>
|
||||||
|
Specifies an output file to save the checksum results to, while still
|
||||||
|
displaying the output on screen.
|
||||||
|
|
||||||
|
-c, -Check <string>
|
||||||
|
Read checksums from the specified file and verify them against files on disk.
|
||||||
|
|
||||||
|
-m, -Match <string>
|
||||||
|
Compare the computed hash of the target file(s) against a specific hash string.
|
||||||
|
|
||||||
|
-a, -Algorithm <string>
|
||||||
|
Specifies the cryptographic hash algorithm to use.
|
||||||
|
Supported values: SHA1, SHA256 (default), SHA384, SHA512, MD5.
|
||||||
|
If omitted in -c or -m mode, the algorithm is auto-detected by hash length.
|
||||||
|
|
||||||
|
-h, -Help
|
||||||
|
Display this help message.
|
||||||
|
|
||||||
|
EXAMPLES
|
||||||
|
1. Compute SHA256 checksum for a single file:
|
||||||
|
.\checksum.ps1 myfile.iso
|
||||||
|
|
||||||
|
2. Compute checksums for all files and write to a file while showing output:
|
||||||
|
.\checksum.ps1 * -o checksums.sha256
|
||||||
|
|
||||||
|
3. Verify a file against a explicit hash string:
|
||||||
|
.\checksum.ps1 myfile.iso -m "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||||
|
|
||||||
|
4. Verify checksums from a verification file (auto-detects algorithm):
|
||||||
|
.\checksum.ps1 -c checksums.sha256
|
||||||
|
'@
|
||||||
|
}
|
||||||
|
|
||||||
|
# Helper function to auto-detect hash algorithm based on string character length
|
||||||
|
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-Error "checksum: Could not auto-detect algorithm for hash length $($HashString.Length). Please specify -Algorithm."
|
||||||
|
return $null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
process {
|
||||||
|
# Match help arguments passed either as switch (-h, -Help) or positional string ('help', 'h', '--help', etc.)
|
||||||
|
$isHelpRequested = $Help.IsPresent -or (
|
||||||
|
$FilePath -and $FilePath.Count -eq 1 -and (
|
||||||
|
$FilePath[0] -match '^(?i)[-/]{0,2}(h|help)$'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if ($isHelpRequested) {
|
||||||
|
Show-Help
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
# Normalize explicit algorithm input if provided
|
||||||
|
if (-not [string]::IsNullOrWhiteSpace($Algorithm)) {
|
||||||
|
$Algorithm = $Algorithm.ToUpper()
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- DIRECT MATCH MODE (-m / -Match) ---
|
||||||
|
if ($PSCmdlet.ParameterSetName -eq 'Match') {
|
||||||
|
if (-not $FilePath -or $FilePath.Count -eq 0) {
|
||||||
|
Write-Error "checksum: Missing file path parameter for matching. Use -Help for usage."
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
# Auto-detect algorithm from provided -Match hash string if not explicitly given
|
||||||
|
if ([string]::IsNullOrWhiteSpace($Algorithm)) {
|
||||||
|
$Algorithm = Get-AlgorithmFromHashLength -HashString $Match
|
||||||
|
if (-not $Algorithm) { return }
|
||||||
|
Write-Verbose "Auto-detected algorithm: $Algorithm"
|
||||||
|
}
|
||||||
|
|
||||||
|
$expectedHash = $Match.Trim().ToLower()
|
||||||
|
|
||||||
|
foreach ($pathEntry in $FilePath) {
|
||||||
|
$resolvedItems = Get-Item -Path $pathEntry -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
if (-not $resolvedItems) {
|
||||||
|
Write-Error "checksum: $pathEntry`: No such file or directory"
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($item in $resolvedItems) {
|
||||||
|
if ($item.PSIsContainer) {
|
||||||
|
Write-Error "checksum: $($item.Name)`: Is a directory"
|
||||||
|
} else {
|
||||||
|
$actualHash = (Get-FileHash -Path $item.FullName -Algorithm $Algorithm).Hash.ToLower()
|
||||||
|
$targetFile = Resolve-Path -Path $item.FullName -Relative
|
||||||
|
if ($targetFile.StartsWith(".\")) { $targetFile = $targetFile.Substring(2) }
|
||||||
|
|
||||||
|
if ($actualHash -eq $expectedHash) {
|
||||||
|
Write-Host "${targetFile}: " -NoNewline
|
||||||
|
Write-Host "OK" -ForegroundColor Green
|
||||||
|
} else {
|
||||||
|
Write-Host "${targetFile}: " -NoNewline
|
||||||
|
Write-Host "FAILED" -ForegroundColor Red
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# --- VERIFICATION MODE (-c / -Check) ---
|
||||||
|
elseif ($PSCmdlet.ParameterSetName -eq 'Verify') {
|
||||||
|
if (-not (Test-Path -Path $Check -PathType Leaf)) {
|
||||||
|
Write-Error "checksum: $Check`: No such file or directory"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
$lines = Get-Content -Path $Check
|
||||||
|
|
||||||
|
# Auto-detect algorithm based on hash length if not explicitly provided
|
||||||
|
if ([string]::IsNullOrWhiteSpace($Algorithm)) {
|
||||||
|
foreach ($line in $lines) {
|
||||||
|
if ([string]::IsNullOrWhiteSpace($line) -or $line.StartsWith("#")) { continue }
|
||||||
|
if ($line -match '^([a-fA-F0-9]+)\s+') {
|
||||||
|
$Algorithm = Get-AlgorithmFromHashLength -HashString $Matches[1]
|
||||||
|
if (-not $Algorithm) { return }
|
||||||
|
Write-Verbose "Auto-detected algorithm: $Algorithm"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Fallback if file contained no parsable hashes
|
||||||
|
if ([string]::IsNullOrWhiteSpace($Algorithm)) {
|
||||||
|
$Algorithm = 'SHA256'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($line in $lines) {
|
||||||
|
# Skip empty lines or comments
|
||||||
|
if ([string]::IsNullOrWhiteSpace($line) -or $line.StartsWith("#")) { continue }
|
||||||
|
|
||||||
|
# Match standard checksum output format: "<hash> [* ]<filename>"
|
||||||
|
if ($line -match '^([a-fA-F0-9]+)\s+[* ]?(.*)$') {
|
||||||
|
$expectedHash = $Matches[1].ToLower()
|
||||||
|
# Strip leading whitespace and any leftover leading asterisk
|
||||||
|
$targetFile = $Matches[2].Trim().TrimStart('*')
|
||||||
|
|
||||||
|
if (Test-Path -Path $targetFile -PathType Leaf) {
|
||||||
|
$actualHash = (Get-FileHash -Path $targetFile -Algorithm $Algorithm).Hash.ToLower()
|
||||||
|
|
||||||
|
if ($actualHash -eq $expectedHash) {
|
||||||
|
Write-Host "${targetFile}: " -NoNewline
|
||||||
|
Write-Host "OK" -ForegroundColor Green
|
||||||
|
} else {
|
||||||
|
Write-Host "${targetFile}: " -NoNewline
|
||||||
|
Write-Host "FAILED" -ForegroundColor Red
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Write-Host "${targetFile}: " -NoNewline
|
||||||
|
Write-Host "FAILED open or read" -ForegroundColor Red
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Write-Warning "checksum: improperly formatted line: $line"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# --- GENERATION MODE ---
|
||||||
|
else {
|
||||||
|
# Default to SHA256 if no algorithm was specified in generation mode
|
||||||
|
if ([string]::IsNullOrWhiteSpace($Algorithm)) {
|
||||||
|
$Algorithm = 'SHA256'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-not $FilePath -or $FilePath.Count -eq 0) {
|
||||||
|
Write-Error "checksum: Missing file path parameter. Use -Help for usage."
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
# Clear/initialize output file if specified before writing hashes
|
||||||
|
if (-not [string]::IsNullOrWhiteSpace($OutFile)) {
|
||||||
|
$null = New-Item -Path $OutFile -ItemType File -Force
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($pathEntry in $FilePath) {
|
||||||
|
# Resolve wildcards and single file inputs
|
||||||
|
$resolvedItems = Get-Item -Path $pathEntry -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
if (-not $resolvedItems) {
|
||||||
|
Write-Error "checksum: $pathEntry`: No such file or directory"
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($item in $resolvedItems) {
|
||||||
|
# Handle directories like Linux sha256sum does
|
||||||
|
if ($item.PSIsContainer) {
|
||||||
|
Write-Error "checksum: $($item.Name)`: Is a directory"
|
||||||
|
} else {
|
||||||
|
$hash = (Get-FileHash -Path $item.FullName -Algorithm $Algorithm).Hash.ToLower()
|
||||||
|
|
||||||
|
# Format standard relative path (stripping leading '.\')
|
||||||
|
$relativePath = Resolve-Path -Path $item.FullName -Relative
|
||||||
|
if ($relativePath.StartsWith(".\")) {
|
||||||
|
$relativePath = $relativePath.Substring(2)
|
||||||
|
}
|
||||||
|
|
||||||
|
$outputLine = "$hash $relativePath"
|
||||||
|
|
||||||
|
# If -OutFile is provided, write line to file
|
||||||
|
if (-not [string]::IsNullOrWhiteSpace($OutFile)) {
|
||||||
|
Add-Content -Path $OutFile -Value $outputLine
|
||||||
|
}
|
||||||
|
|
||||||
|
# Output to stdout
|
||||||
|
Write-Output $outputLine
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
end {}
|
||||||
@@ -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"
|
|
||||||
@@ -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"
|
||||||
@@ -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 {}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
param (
|
|
||||||
[Parameter(Mandatory=$true)]
|
|
||||||
[string]$infile
|
|
||||||
)
|
|
||||||
|
|
||||||
Invoke-Expression "$PSScriptRoot\winhash.ps1 $infile MD5"
|
|
||||||
@@ -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 @'
|
||||||
|
=--= =----=
|
||||||
|
=--= -------=
|
||||||
|
=--= --------=
|
||||||
|
=----= --- =---------=
|
||||||
|
----= =--- ---==++=----:-----=
|
||||||
|
=-----= - ---- ========----::----=
|
||||||
|
=------= ----=+===-::::::::=+**++===+#
|
||||||
|
==-----=----=+**+=:::-======++******+==+##
|
||||||
|
=------=-=+*:::-=============+*****+==+*##
|
||||||
|
=------=+=:-++==--+=++===+====+***+===***=
|
||||||
|
=--------+*===---+===+===+++==+**=+==+**+-
|
||||||
|
=------=+===--=+++==++++%%*==**====+**+.- -
|
||||||
|
#=---=+====-=+++=+++*+.%+-==**=-==+**+.. --
|
||||||
|
#**+--+========++++#%#**=--==**--==+**=..: =-
|
||||||
|
*****+======+-+++*%%@@%=---==**--+=+*--:..- =
|
||||||
|
#*****=====+=-=++***#%#-----=**=-+=+*=---:.. %%
|
||||||
|
%****+====+=--=+++.:+*=-------=*-===**=---:..- %%
|
||||||
|
#***+=====------=:.-=----------==+=+**+---...: %%%%#%
|
||||||
|
#**+====:---------=-------------+=+=***=-....: %%##%%##
|
||||||
|
%***====..:---------------------==+=-****:.....+%#%%#%%%%#
|
||||||
|
#**+==*=...---------------:.----+==--=***=....##%#######%%
|
||||||
|
#***+=+*=...--------------:..:--=+=----+***:...#%###%%##%
|
||||||
|
#**+==+*=..:-------------:...:--++------=***.:+##%#%%%#% =
|
||||||
|
#***+==+**...:----------:.....:--+=------==**++##%#%%%%% =-
|
||||||
|
#***#+==+**=.................+*---+=------=#+=##%%##%%%#%=---
|
||||||
|
%#**#%*===+***-.....---...=+.:*#=----------=##*#%####%%%%#=----
|
||||||
|
%#### +===****-...: -+##=#%%+---------+###%%%%%%#%%%%%*-----
|
||||||
|
*===+****-..- %###%%%+------=*######%%%%%%%##%#*------
|
||||||
|
+===+****-.- %##%%%*-----#########%####%#####*-------
|
||||||
|
____ ____ __ __ _ ___ ____ ____ ____ ____ __
|
||||||
|
( _ \( _ \( )( ( \ / __)( __)/ ___)/ ___) ( _ \( )
|
||||||
|
) __/ ) / )( / /( (__ ) _) \___ \\___ \ ) __/ )(
|
||||||
|
(__) (__\_)(__)\_)__) \___)(____)(____/(____/ (__) (__)
|
||||||
|
'@
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
param (
|
|
||||||
[Parameter(Mandatory=$true)]
|
|
||||||
[string]$infile
|
|
||||||
)
|
|
||||||
|
|
||||||
Invoke-Expression "$PSScriptRoot\winhash.ps1 $infile SHA1"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
param (
|
|
||||||
[Parameter(Mandatory=$true)]
|
|
||||||
[string]$infile
|
|
||||||
)
|
|
||||||
|
|
||||||
Invoke-Expression "$PSScriptRoot\winhash.ps1 $infile SHA256"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
param (
|
|
||||||
[Parameter(Mandatory=$true)]
|
|
||||||
[string]$infile
|
|
||||||
)
|
|
||||||
|
|
||||||
Invoke-Expression "$PSScriptRoot\winhash.ps1 $infile SHA384"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
param (
|
|
||||||
[Parameter(Mandatory=$true)]
|
|
||||||
[string]$infile
|
|
||||||
)
|
|
||||||
|
|
||||||
Invoke-Expression "$PSScriptRoot\winhash.ps1 $infile SHA512"
|
|
||||||
@@ -1,9 +1,23 @@
|
|||||||
if ($args[0]) { $commit_message=($args -join " ") } # if arg0 exists, join all passed args with spaces
|
# waypoint.ps1
|
||||||
else { $commit_message="waypoint" } # or default to "waypoint"
|
|
||||||
|
|
||||||
Write-Host "WAYPOINT!`n`tCommit Message: $commit_message`n"
|
if (-not (Test-Path -Path ".\.git" -PathType Container)) {
|
||||||
# add and commit
|
Write-Host "No .git folder detected. Initializing new Git repository..." -ForegroundColor Yellow
|
||||||
|
git init
|
||||||
|
} else {
|
||||||
|
Write-Host "Git repository detected. Creating waypoint..." -ForegroundColor Cyan
|
||||||
|
}
|
||||||
|
|
||||||
|
# Stage all changes
|
||||||
git add .
|
git add .
|
||||||
git commit -m "$commit_message"
|
|
||||||
|
|
||||||
Write-Host "`nDone :`"3"
|
# Format the timestamp with timezone offset/ID string
|
||||||
|
$timestamp = (Get-Date).ToString("yyyy-MM-dd-HHmm") + "-" + ((Get-TimeZone).Id -creplace '[a-z\s]', '')
|
||||||
|
|
||||||
|
# Capture current git status output
|
||||||
|
$statusOutput = (git status | Out-String).Trim()
|
||||||
|
|
||||||
|
# Construct the commit message
|
||||||
|
$commitMessage = "WAYPOINT $timestamp`n`n$statusOutput"
|
||||||
|
|
||||||
|
# Execute commit
|
||||||
|
git commit -m "$commitMessage"
|
||||||
@@ -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"
|
|
||||||
}
|
|
||||||
@@ -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,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
|
||||||
|
|
||||||
@@ -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'"
|
||||||
@@ -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
|
||||||
@@ -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"
|
||||||
@@ -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"
|
||||||
Reference in New Issue
Block a user