Skip to content

Instantly share code, notes, and snippets.

View DonovanDiamond's full-sized avatar
💭
Working

DonovanDiamond

💭
Working
View GitHub Profile
#!/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"
@DonovanDiamond
DonovanDiamond / install-docker-ubuntu.sh
Last active July 6, 2024 13:55
Installs docker on ubuntu
#!/bin/bash
# git clone https://gist.github.com/d56c81d925c9f4c61d78ca8de2439c19.git && cd d56c81d925c9f4c61d78ca8de2439c19 && sudo chmod +x install-docker-ubuntu.sh && ./install-docker-ubuntu.sh && cd .. && rm -rf d56c81d925c9f4c61d78ca8de2439c19
echo "Removing any existing docker packages..."
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt remove $pkg; done
echo "Adding Docker's offical GPG key..."
sudo apt update
sudo apt install ca-certificates curl gnupg
$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.
version: '3.1'
services:
web:
image: odoo:14.0
depends_on:
- db
ports:
- "8069:8069"
volumes:
- ./data:/var/lib/odoo
** Deploying Zabbix web-interface (Nginx) with PostgreSQL database
** Using POSTGRES_USER variable from ENV
** Using POSTGRES_PASSWORD variable from ENV
********************
* DB_SERVER_HOST: postgres-server
* DB_SERVER_PORT: 5432
* DB_SERVER_DBNAME: zabbix
* DB_SERVER_SCHEMA: public
********************
** Adding Zabbix virtual host (HTTP)