Skip to content

Instantly share code, notes, and snippets.

View Jackbennett's full-sized avatar

Jack Jackbennett

View GitHub Profile
@Jackbennett
Jackbennett / cli_ui_info_table.py
Created February 9, 2021 08:44
cli_ui info_table quick note to handle header = keys
def info_table(
data: Any, *, headers: Union[str, Sequence[str]] = (), fileobj: FileObj = sys.stdout
) -> None:
if headers == 'keys':
colored_data = dict()
plain_data = dict()
for row in data:
colored_row = list()
plain_row = list()
for item in data[row]:
@Jackbennett
Jackbennett / verbose.txt
Created January 31, 2019 12:08
code.exe --verbose from mapped network folder. No Directory junction
PS P:\VSCode\1.30.2-inside> .\Code.exe --verbose
PS P:\VSCode\1.30.2-inside>
[main 12:04:33 PM] Starting VS Code
[main 12:04:33 PM] from: p:\VSCode\1.30.2-inside\resources\app
[main 12:04:33 PM] args: { _: [],
help: false,
h: false,
version: false,
v: false,
wait: false,
function Clear-CCTV{
Param(
# Directory to clear
[parameter(mandatory=$true)]
[string]$Path
, # Archive Directory Path
[parameter(mandatory=$true)]
[string]$ArchivePath
[cmdletbinding(SupportsShouldProcess=$true,DefaultParameterSetName="User")]
Param(
[Parameter(Mandatory=$true,
Position=0,
ParameterSetName="User",
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[Microsoft.ActiveDirectory.Management.ADUser[]]
[Parameter(Mandatory=$true,
Position=0,
@Jackbennett
Jackbennett / debug osquery + fleet
Last active April 16, 2018 22:03
debugging TLS issue with osquery
osquery.flags ->
--enroll_secret_path=c:\programdata\osquery\heroku.secret
--tls_server_certs=c:\programdata\osquery\demoapponherokuapp.com.pem
--tls_hostname=demoapponherokuapp.com
--host_identifier=hostname
--enroll_tls_endpoint=/api/v1/osquery/enroll
--config_plugin=tls
--config_tls_endpoint=/api/v1/osquery/config
--config_tls_refresh=10
--disable_distributed=false
@Jackbennett
Jackbennett / Chrome Custom Searches.md
Created November 3, 2017 20:32
List of custom searches used in chrome
@Jackbennett
Jackbennett / scan AD computers.ps1
Created September 26, 2017 13:20 — forked from anonymous/scan AD computers.ps1
Improve the run performance of this script.
# Get All PCs in Domain, Export to ServerList.txt
# Call get-inventory.ps1 logic on created Serverlist.txt
# dk / 22.09.2017
import-module activedirectory
$domain = "carpentier.local"
$tempfile = "c:\temp\tmpfile.csv"
$outfile = "c:\temp\Serverlist.csv"
Get-ADComputer -Filter * |
select-object Name |
$ 1..1000 | %{ measure-command { ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")} }| sort -Descending -Property TotalMilliseconds | select -First 20 -Property TotalMilliseconds
TotalMilliseconds
-----------------
9.2754
0.9975
0.195
0.191
0.1877
0.1817
$EndTime = Get-WinEvent -ComputerName $ComputerName -FilterHashTable @{LogName = "Microsoft-Windows-AppLocker/EXE and DLL"; ID = 8001} -MaxEvents 1
Get-WinEvent -ComputerName $ComputerName -FilterHashTable @{LogName = "Microsoft-Windows-AppLocker/EXE and DLL"; EndTime = $EndTime.TimeCreated}
write-warning $EndTime.timecreated()
@Jackbennett
Jackbennett / start-layout.xml
Created June 5, 2017 14:05
Missing pinned link/icons but working task bar
<LayoutModificationTemplate
xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification"
xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout"
xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout"
xmlns:taskbar="http://schemas.microsoft.com/Start/2014/TaskbarLayout"
Version="1">
<LayoutOptions StartTileGroupCellWidth="6" />
<DefaultLayoutOverride LayoutCustomizationRestrictionType="OnlySpecifiedGroups">
<StartLayoutCollection>
<defaultlayout:StartLayout GroupCellWidth="6" xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout">