Skip to content

Instantly share code, notes, and snippets.

View DonovanDiamond's full-sized avatar
💭
Working

Donovan Diamond DonovanDiamond

💭
Working
View GitHub Profile
#!/bin/bash
set -e
askrun() {
read -p "Run '$1' (y/n): " answer
answer=$(echo "$answer" | tr '[:upper:]' '[:lower:]')
if [ "$answer" = "y" ]; then
echo "Running..."
#!/bin/bash
# git clone https://gist.github.com/2caf44eafe6067be85e7a564f80da988.git && cd 2caf44eafe6067be85e7a564f80da988 && sudo chmod +x helix.sh && ./helix.sh && cd ..
set -e
wget https://github.com/helix-editor/helix/releases/download/25.07.1/helix-25.07.1-x86_64-linux.tar.xz
tar -Jxvf helix-*-x86_64-linux.tar.xz
cd helix-*-x86_64-linux
sudo cp hx /usr/local/bin/
sudo apt update
sudo apt install curl -y
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
#!/bin/bash
unifi_device_username="ubnt"
unifi_device_password="ubnt"
hosts_file="hosts.txt"
nmap_results_file="nmap-results.txt"
target_folder="logs"
if [ -f "$hosts_file" ]; then
$ErrorActionPreference = "Stop"
function Log {
param (
$m
)
Write-Output "$("[{0:yyyy/MM/dd} {0:HH:mm:ss}]" -f (Get-Date)) $m"
}
$exportFolder = "D:\VM Exports"
$FIELD_ALLOW_DENY = 0
$FIELD_PERM_1 = 1
$FIELD_PERM_2 = 2
$FIELD_UNK_1 = 3
$FEIDL_UNK_2 = 4
$FIELD_SID = 5
$PERM_ALLOW_PRINT = "A;;SWRC"
$PERM_DENY_PRINT = "D;;SWRC"
Function Start-Cleanup {
<#
.SYNOPSIS
Automate cleaning up a C:\ drive with low disk space
.DESCRIPTION
Cleans the C: drive's Window Temperary files,
the local users Temperary folder, IIS logs(if applicable) and empties the recycling bin.
All deleted files will go into a log transcript in $env:TEMP. By default this
@DonovanDiamond
DonovanDiamond / NTFS_File_Scan.ps1
Last active November 14, 2023 07:42
NTFS Compressed or Encrypted File Scan
# Scans all user profile directories recursively for Compressed or Encrypted files or folders
$Directory = "C:\Users\"
$users = Get-ChildItem -Directory -Path $Directory
$total = $users.Count
$i = 0
ForEach ($user in $users) {
$DOMAIN = ""
$USERS_PATH = "C:\Users"
$SUBINACL_PATH = "C:\Windows\system32\subinacl.exe"
function Remove-UserPermissions {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$FolderPath,
<#
.SYNOPSIS
Logs out inactive users.
.DESCRIPTION
Note: This script was forked and modified to also count "Active" but idle users as inactive.
Logs out inactive users, except for specific users that
have been manually approved and are allowed to stay logged
in for indefinite periods of time.