This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#define WITH_DEBUG_CONSOLE | |
#ifndef UNICODE | |
# define UNICODE | |
#endif | |
#define WIN32_LEAN_AND_MEAN | |
#include <Windows.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# List of users to keep | |
KEEP=$( cat <<EOL | |
/Users/admin | |
/Users/administrator | |
/Users/sccadmin | |
/Users/scclab | |
/Users/Shared | |
/Users/Search |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# These are bash functions. You can just source them on startup based on uname | |
# if you use the same dotfiles for all systems. | |
function listUsers() { | |
dscl . -list /Users UniqueID; | |
} | |
function listGroups() { | |
dscl . -list /Groups PrimaryGroupID; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -module ActiveDirectory | |
# Input computers. | |
$threshold = (Get-Date).AddDays(-180) | |
$computers = Get-ADComputer -Filter { OperatingSystem -notlike "*server*" -and OperatingSystem -like "*windows*" -and PasswordLastSet -gt $threshold } | | |
Select-Object -ExpandProperty Name | | |
Sort-Object -Property Name | |
# Make sure there are not existing jobs. | |
Get-Job | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Enables PowerShell remoting | |
# | |
function Enable-Remoting | |
{ | |
[CmdletBinding()] | |
param() | |
Write-Log 'Enabling PowerShell Remoting...' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Port = "8530" | |
$Name = "WSUS" | |
$LogFile = "C:\WSUS_server_cleanup_log.txt" | |
Get-Date | Tee-Object -file $LogFile | |
Get-WsusServer -PortNumber $Port -Name $Name | Invoke-WsusServerCleanup -CleanupObsoleteComputers | Tee-Object -file $LogFile -append | |
Get-WsusServer -PortNumber $Port -Name $Name | Invoke-WsusServerCleanup -CleanupUnneededContentFiles | Tee-Object -file $LogFile -append | |
Get-WsusServer -PortNumber $Port -Name $Name | Invoke-WsusServerCleanup -CleanupObsoleteUpdates | Tee-Object -file $LogFile -append | |
Get-WsusServer -PortNumber $Port -Name $Name | Invoke-WsusServerCleanup -DeclineExpiredUpdates | Tee-Object -file $LogFile -append |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minimal:~# cat /etc/sysctl.conf | |
# | |
# /etc/sysctl.conf - Configuration file for setting system variables | |
# See /etc/sysctl.d/ for additonal system variables | |
# See sysctl.conf (5) for information. | |
# | |
#kernel.domainname = example.com | |
# Uncomment the following to stop low-level messages on console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import glob | |
import csv | |
from libnmap.parser import NmapParser | |
dir_path = os.path.dirname(os.path.realpath(__file__)) | |
with open('nmap_results.csv', 'wb') as output_file: | |
writer = csv.writer(output_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BoxStarter script | |
#START http://boxstarter.org/package/nr/url?<raw url> | |
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions | |
Enable-RemoteDesktop | |
Move-LibraryDirectory "Personal" "$env:UserProfile\OneDrive\documents" | |
cinst 7zip | |
cinst chrome |
OlderNewer