Skip to content

Instantly share code, notes, and snippets.

@roachhd
roachhd / README.md
Last active May 14, 2022
Basics of BrainFuck
View README.md

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

BrainFuck Programming Tutorial by: Katie

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

INTRODUCTION

@andyrudoff
andyrudoff / .gitignore
Last active May 14, 2022
interpose on libc syscalls by code patching
View .gitignore
*.o
tester
elmo.so
@mwallner
mwallner / boxstarter-bootstrapper.md
Created Feb 3, 2020
using Boxstarter to overcome PowerShell v2 on Box deployments
View boxstarter-bootstrapper.md

using Boxstarter to overcome PowerShell v2 on Box deployments

Preparation (on a random host)

  • Install Chocolatey
  • choco install boxstarter -y
  • open "Boxstarter Shell"
  • create "Portable Boxstarter" see wiki
@mwallner
mwallner / cmdlettest.ps1
Created Jan 14, 2020
powershell cmdet vs basic function argument handling
View cmdlettest.ps1
function Get-EvilCmdLet {
[CmdletBinding()]
param(
[ValidateSet('A', 'B')]
$Category
)
Write-Output "= Get-EvilCmdLet ="
Write-Output "* PSBoundParameters"
$PSBoundParameters.Keys | % {
@mwallner
mwallner / Add-TrustedHostDownloadSite.ps1
Created Feb 11, 2020
when using a offline VisualStudio layout, you need to ensure the host you're downloading from is "trusted"
View Add-TrustedHostDownloadSite.ps1
function Add-TrustedHostDownloadSite {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string]$ServerName,
[Parameter(Mandatory = $false)]
[string]$Domain = "myorg.somedomain"
)
Push-Location
@mwallner
mwallner / Get-LatestProcesses.ps1
Created Mar 20, 2019
get 'youngest' process with some filter possibilites
View Get-LatestProcesses.ps1
param(
[Parameter(Mandatory = $False)]
[int]$NumberOfProcesses = 1,
[Parameter(Mandatory = $False)]
[switch]$IncludeMicrosoftProcesses,
[Parameter(Mandatory = $False)]
[switch]$RequirePath,
@mwallner
mwallner / Stop-ProcessWithTimeoutAndWarning.ps1
Created Nov 21, 2018
stops a process after some timeout and warning messages
View Stop-ProcessWithTimeoutAndWarning.ps1
function Stop-ProcessWithTimeoutAndWarning {
param(
# name of process to stop
[Parameter(Mandatory = $True)]
[string]$Name,
# timeout (in seconds) to wait before killing process
[Parameter(Mandatory = $False)]
[int]$Timeout = 30
)
@mwallner
mwallner / Get-UglyButShortUniqueDirname.ps1
Last active May 14, 2022
create a unique directory name based of system.guid
View Get-UglyButShortUniqueDirname.ps1
function Get-UglyButShortUniqueDirname {
[CmdletBinding()]
param (
)
$t = "$([System.Guid]::NewGuid())".Replace("-", "")
Write-Verbose "base guid: $t"
$t = "$(0..$t.Length | % { if (($_ -lt $t.Length) -and !($_%2)) { [char][byte]"0x$($t[$_])$($t[$_+1])" } })".replace(" ", "").Trim()
View MonitorJobs.ps1
function PrintJobWithData {
param(
[Parameter(Mandatory = $True, ValueFromPipeline = $True)]
$job
)
if ($job.HasMoreData -eq "True") {
Write-Output "--- BEGIN $($job.Name) BEGIN ---"
try {
$job | Receive-Job