Skip to content

Instantly share code, notes, and snippets.

View hallowslab's full-sized avatar

Hallowf hallowslab

View GitHub Profile
@echo off
set "SCRIPT_DIR=%~dp0"
cd /d "%SCRIPT_DIR%"
mkdir "converted" 2>nul
echo A converter
for %%f in (*.heic *.HEIC) do magick "%%f" -quality 100 "converted/%%~nf.jpg"
@hallowslab
hallowslab / Microsoft.PowerShell_profile.ps1
Created May 9, 2025 10:57
updated powershell profile
function sha256sum {
if($args.Count -eq 0) {
Write-Host "Usage: .\$($MyInvocation.MyCommand.Name) string to be hashed";
return
}
$stringAsStream = [System.IO.MemoryStream]::new()
$writer = [System.IO.StreamWriter]::new($stringAsStream)
$writer.write("$args")
$writer.Flush()
@hallowslab
hallowslab / .bashrc
Last active May 6, 2025 19:18
some bash utils
ssl_issuer() {
echo | openssl s_client -servername .com -connect $1:443 2>/dev/null | openssl x509 -noout -subject
}
dall() {
while IFS= read -r line
do
echo "$line -> $(dig +short a $line)"
done < $1
}
#!/bin/bash
# Assumes ssh key is loaded in environment
# === CONFIGURATION ===
USER="cpaneluser"
REMOTE_HOST="source.server.com"
REMOTE_SSH_PORT=22
REMOTE_SSH_USER="root"
REMOTE_HOME="/home/$USER/"
@hallowslab
hallowslab / main.rs
Created January 24, 2025 18:41
Rust fibonacci speed test
use std::collections::HashMap;
use std::env;
use std::time::Instant;
fn main() {
let value = get_value();
let now = Instant::now();
let answer = fib_loop(value.into());
let elapsed = now.elapsed();
@hallowslab
hallowslab / fib.zig
Last active January 21, 2025 20:35
Zig fibonnaci speed test
const std = @import("std");
const time = std.time;
const Instant = time.Instant;
const Timer = time.Timer;
const testing = std.testing;
const expect = std.testing.expect;
pub fn main() !void {
var x: u32 = 100;
// Get a page allocator?
@hallowslab
hallowslab / spf_modder.py
Last active December 12, 2023 17:44
Modifies SPF records trough the creation of a new zone file that can be replaced with the original, for environments that use named DNS server
#!/usr/bin/env python3
import re
from argparse import Namespace, ArgumentParser, Action
from typing import Dict, List
ADDOP = ["A", "ADD"]
REMOP = ["R", "REM", "REMOVE"]
class StoreUpper(Action):
@hallowslab
hallowslab / powershell_split_by_extension.ps1
Created November 14, 2023 21:48
Powershell script that takes source and destination and splits files according to their extensions
#Declare our named parameters here
param(
[Parameter(mandatory=$true)]
[string] $Source,
[Parameter(mandatory=$true)]
[string] $Destination
)
if ((Get-ChildItem -Path $Destination -Recurse | Measure-Object -Property Length -Sum).Count -gt 0) {
@hallowslab
hallowslab / pysplit_sql.py
Last active June 2, 2023 21:04
Python script to split mysql dumps
#!/usr/bin/env python
import os
# Get input file
input_file = input("Enter the path to the input SQL file: ")
output_dir = 'split_files'
# Create the output directory if it doesn't exist
if not os.path.exists(output_dir):
@hallowslab
hallowslab / windows_hardening.cmd
Created March 5, 2023 00:17 — forked from mackwage/windows_hardening.cmd
Script to perform some hardening of Windows OS
:: Windows 10 Hardening Script
:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering.
:: Obligatory 'views are my own'. :)
:: Thank you @jaredhaight for the Win Firewall config recommendations!
:: Thank you @ricardojba for the DLL Safe Order Search reg key!
:: Thank you @jessicaknotts for the help on testing Exploit Guard configs and checking privacy settings!
:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater
: