Skip to content

Instantly share code, notes, and snippets.

View seriald's full-sized avatar

Robert Fleming seriald

View GitHub Profile
@seriald
seriald / docker-compose.yaml
Created January 4, 2023 21:26
Pihole / Docker-compose
version: '2'
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
hostname: xxxxx
network_mode: "host"
environment:
- TZ:America/Toronto
- ServerIP:xxxxx
@seriald
seriald / AD_DisabledUserCount_OU
Created August 17, 2018 12:19
Count the number of Disabled AD users given an OU
$OU = Read-Host -Prompt 'Enter the OU' #Example: OU=IMB,OU=HQ,DC=intra,DC=pri
(Get-ADUser -Filter 'Enabled -eq $false' -searchbase "$OU").count
@seriald
seriald / AD_UserCount_OU.ps1
Created August 17, 2018 12:18
Count the number of AD users given an OU
$OU = Read-Host -Prompt 'Enter the OU' #Example: OU=IMB,OU=HQ,DC=intra,DC=pri
(Get-ADUser -filter * -searchbase "$OU").count
@seriald
seriald / AD_ExportGroup.ps1
Created August 17, 2018 12:14
Export a list of users within an AD Group
$ad = Read-Host -Prompt 'Enter the AD Group'
$path = pwd
Clear-Content -Path "$path\Export\*"
$file = "$path\export\$ad.txt"
Get-ADGroupMember -Identity $ad | Out-File -FilePath $file
@seriald
seriald / AD_ExportGroup_OU.ps1
Created August 17, 2018 12:13
Export a list of users within an AD Group given an OU
$OU = Read-Host -Prompt 'Enter the OU' #Example: OU=IMB,OU=HQ,DC=intra,DC=pri
$Group = Read-Host -Prompt 'Enter the AD Group' #Example: XA_Restricted_Visio
$Users = Get-ADUser -filter * -SearchBase $OU | Select samaccountname
$Members = Get-ADGroupMember -Identity $Group | Select samaccountname
Clear-Content -Path "F:\Data\Scripts\Export\*"
ForEach ($User in $Users)
{
$Name = $User.samaccountname
If ($Members -Match $User.samaccountname)
{
@seriald
seriald / Audit_ACL.ps1
Created August 17, 2018 12:09
Audit Access Control List given a file path or UNC
$Share = Read-Host -Prompt 'Enter Full Path to Share' #Example: \\servername\share\subfolder
Get-childitem $Share -recurse | where{$_.psiscontainer} |
Get-Acl | % {
$path = $_.Path
$_.Access | % {
New-Object PSObject -Property @{
Folder = $path.Replace("Microsoft.PowerShell.Core\FileSystem::","")
Access = $_.FileSystemRights
Control = $_.AccessControlType
User = $_.IdentityReference
@seriald
seriald / renew.sh
Created August 13, 2017 22:00
Renew LetsEncrypt Certificates
#Stop NGINX service
echo Stopping Web Services
cd /etc/init.d
./nginx stop
#Renew CERTS
echo Renewing Certificates
cd ~/letsencrypt
sudo apt-get update
sudo apt-get install build-essential
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
close terminal
nvm install 4.2.2
nvm install v5.0.0 --reinstall-packages-from=4.2
nvm install iojs-v3.2.0
sudo apt-get install build-essential pkg-config libc6-dev libssl-dev libexpat1-dev libavcodec-dev libgl1-mesa-dev libqt4-dev git
Create a folder to download and compile the source files
mkdir makemkv.source
cd makemkv.source
Now, we will compile and install the required dependencies: ffmpeg and fdk-aac.
First up: fdk-aac. Download, untar, compile, and install:
@seriald
seriald / wordpress_on_apache
Created May 28, 2016 05:08 — forked from kdjomeda/wordpress_on_apache
Intro to ansible tutorial playbook
---
- hosts: webservers
tasks:
- name: Install Apache
apt: pkg=apache2 update_cache=true state=installed
- name: Install bunch of php packages
apt: pkg={{ item }} update_cache=true state=installed
with_items:
- php5
- php5-cli