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
$raw = dsregcmd /status | |
$result = New-Object -TypeName psobject | |
function Sanitise-For-Property-Name($str) { | |
return $str.Trim().Replace(" ", "_"); | |
} | |
$sectionName = "" | |
foreach($line in $($raw -split "`r`n")) { |
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
$ErrorActionPreference = "Stop" # This prevents the registry key from being removed if it couldn't be backed up. | |
$name = "Carbon Black Cloud Sensor" | |
$cbProducts = Get-ChildItem "Registry::HKEY_CLASSES_ROOT\Installer\Products" | Where { $_.GetValue('ProductName') -imatch $name } | |
$regBackups = New-Object System.Collections.ArrayList | |
function Base64-Encode($file) { | |
$fileContent = Get-Content -Path $file -Raw | |
[Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($fileContent)); | |
} |
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
# Find all user profiles | |
$users = Get-ChildItem C:\Users -Directory -Exclude '*Public*', '*Default*' | |
function Get-Extension-Name-For-Edge($extensionId) { | |
$url = "https://microsoftedge.microsoft.com/addons/detail/$($extensionId)" | |
$WebRequest = Invoke-WebRequest -Uri $url -ErrorAction Stop -UseBasicParsing | |
if ($WebRequest.StatusCode -ne 200) { | |
return "Unknown - $($extensionId)"; |
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
$action1supportedApps = @("1Password", | |
"7-Zip", | |
"Adobe Acrobat Reader DC", | |
"Adobe Acrobat Reader DC MUI", | |
"Adobe AIR", | |
"Adobe Animate 2023", | |
"Adobe Animate 2024", | |
"Adobe Audition 2023", | |
"Adobe Audition 2024", | |
"Adobe Bridge 2023", |
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
# Devices joined to a domain, which receive these via GPO | |
netsh advfirewall firewall show rule name="Outbound SMB: Allow to LAN" type=dynamic >nul || netsh advfirewall firewall add rule name="Outbound SMB: Allow to LAN" protocol=TCP remoteip="10.0.0.0/8,172.16.0.0/12,192.168.0.0/16" remoteport=445 action=allow dir=out | |
netsh advfirewall firewall show rule name="Outbound SMB: Block All" type=dynamic >nul || netsh advfirewall firewall add rule name="Outbound SMB: Block All" protocol=TCP remoteip=any remoteport=445 action=block dir=out | |
netsh advfirewall set allprofiles state on | |
netsh advfirewall set allprofiles firewallpolicy blockinbound,allowoutbound | |
# Devices NOT joined to a domain, or which don't receive these via GPO | |
netsh advfirewall firewall show rule name="Outbound SMB: Allow to LAN" >nul || netsh advfirewall firewall add rule name="Outbound SMB: Allow to LAN" protocol=TCP remoteip="10.0.0.0/8,172.16.0.0/12,192.168.0.0/16" remoteport=445 action=allow dir=out | |
netsh advfirewall firewall show rule name="Ou |
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 the groups to work with | |
$groups = @("My AD Group Name", "My other AD Group Name"); | |
foreach($groupName in $groups) { | |
$members = Get-ADGroupMember -Identity $groupName | Where { $_.objectClass -eq "user" } | |
foreach($member in $members) { | |
$user = Get-ADUser -Identity $member.SamAccountName -Properties Enabled | |
if ($user.Enabled -eq $false) { |
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
[ 5619.089195] evdi: [V] copy_primary_pixels:164 copy rect 0,0-2560,1440 | |
[ 5619.097472] [drm:drm_ioctl [drm]] pid=13097, dev=0xe202, auth=1, EVDI_REQUEST_UPDATE | |
[ 5619.097476] evdi: [V] evdi_painter_request_update_ioctl:883 Painter lock | |
[ 5619.097477] evdi: [V] evdi_painter_request_update_ioctl:896 Painter unlock | |
[ 5619.106633] [drm:evdi_map_dma_buf [evdi]] [DEV:0000:00:02.0] size:14745600 dir=0 | |
[ 5619.107606] evdi: [V] evdi_painter_set_scanout_buffer:943 Painter lock | |
[ 5619.107608] evdi: [V] evdi_painter_set_scanout_buffer:948 Painter unlock | |
[ 5619.107624] evdi: [V] evdi_painter_mark_dirty:494 Painter lock | |
[ 5619.107626] evdi: [V] evdi_painter_mark_dirty:504 (dev=1) 0,0-2560,1440 | |
[ 5619.107627] evdi: [V] evdi_painter_mark_dirty:519 Painter unlock |
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
FROM debian AS build | |
WORKDIR /tmp | |
RUN apt-get update && \ | |
apt-get install --no-install-recommends -y curl && \ | |
curl http://sphinxsearch.com/files/sphinx-3.2.1-f152e0b-linux-amd64.tar.gz -o sphinx.tar.gz && \ | |
mkdir sphinx && \ | |
tar xfz sphinx.tar.gz -C sphinx/ && \ | |
rm sphinx.tar.gz && \ | |
rm -rf /var/lib/apt/lists/* |
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
require 'openssl' | |
raw_fingerprint = [merchant_id, merchant_password, transaction_type, reference_id, amount, timestamp].join('|') | |
digest = OpenSSL::Digest.new('sha256') | |
fingerprint = OpenSSL::HMAC.hexdigest(digest, merchant_password, raw_fingerprint) |
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
#!/usr/bin/env ruby | |
require 'fileutils' | |
abort "You must run this command as root." unless Process.uid === 0 | |
PLIST_FILE = 'com.papercut.client.plist'.freeze # The path to your com.papercut.client.plist file | |
PLIST_DESTINATION_PATH = '/Library/LaunchAgents/'.freeze | |
puts "Deploying launch configuration..." | |
puts "---> Copying plist file to #{PLIST_DESTINATION_PATH}..." |
NewerOlder