Skip to content

Instantly share code, notes, and snippets.

View techthoughts2's full-sized avatar
🕵️‍♂️
Investigating a better artifact workflow

Jake Morrison techthoughts2

🕵️‍♂️
Investigating a better artifact workflow
View GitHub Profile
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -Quiet"
$NumberOfLogicalProcessors = Get-CimInstance win32_processor | Select-Object -ExpandProperty NumberOfLogicalProcessors
ForEach ($core in 1..$NumberOfLogicalProcessors) {
start-job -ScriptBlock {
$result = 1;
foreach ($loopnumber in 1..2147483647) {
$result = 1;
foreach ($loopnumber1 in 1..2147483647) {
$result = 1;
@techthoughts2
techthoughts2 / linux_notes.sh
Last active March 2, 2021 07:06
some linux notes
ssh 10.0.4.3 -l jake
# read the manual pages - kind of like help
man
man cp # read the manual on the cp command
man 2 sync # gets you man page 2
manpath # where are man files located
<<'###ManPageSections'
1 User level commands and applications
<#
.SYNOPSIS
Helper function to set the monitor input.
.DESCRIPTION
Uses ControlMyMonitor.exe to adjust VPCCode 60 for your monitor input.
.EXAMPLE
Set-MonitorInputSource -InputSource HDMI
Switched to HDMI input
.EXAMPLE
@techthoughts2
techthoughts2 / python_notes.py
Last active March 6, 2024 06:05
python_learning
"""
Ctrl+K Ctrl+0 Fold (collapse) all regions editor.foldAll
Ctrl+K Ctrl+J Unfold (uncollapse) all regions
Ctrl+Shift+[ Fold (collapse) region editor.fold
Ctrl+Shift+] Unfold (uncollapse) region editor.unfold
Ctrl+K Ctrl+[ Fold (collapse) all subregions editor.foldRecursively
Ctrl+K Ctrl+] Unfold (uncollapse) all subregions editor.unfoldRecursively
"""
# region links
- dotnet tool install --global PowerShell --version 7.0.3
- powershell -command '.\configure_aws_credential.ps1'
# - aws s3 cp s3://ps-invoke-modules/PowerShell-7.0.3-win-x64.msi PowerShell-7.0.3-win-x64.msi --quiet
- powershell -command '[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;$url = """https://github.com/PowerShell/PowerShell/releases/download/v7.0.3/PowerShell-7.0.3-win-x64.msi""";$output = """$env:CODEBUILD_SRC_DIR\PowerShell-7.0.3-win-x64.msi""";Invoke-WebRequest -Uri $url -OutFile $output -ErrorAction Stop;if (-not(Test-Path $output)) {throw """PSCore failed to DL"""}'
- powershell -command "Start-Process $env:CODEBUILD_SRC_DIR\PowerShell-7.0.3-win-x64.msi -ArgumentList '/qn /norestart' -Wait"
- '& "C:\Program Files\PowerShell\7\pwsh.exe" -command ''.\install_modules.ps1'''
@techthoughts2
techthoughts2 / ps_reddit
Last active July 3, 2020 22:51
PowerShell based interactive reddit browser. Browse your favorite subreddits using PowerShell!
<#
.SYNOPSIS
Launches the default browser to display reddit pictures.
.DESCRIPTION
Long description
.EXAMPLE
Show-Pics -URL https://i.imgur.com/fcuRqwl.jpg
Launches default browser to provided link.
.EXAMPLE
function test-arg {
[cmdletbinding()]
param(
[ArgumentCompleter({'mouse','house','goat'})]
$GreenEggs
)
$greeneggs
}
function Get-Something {
param(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[ArgumentCompleter( {
@(
"keys"
"wallet"
"phone"
)
[net.httpstatuscode]404