Skip to content

Instantly share code, notes, and snippets.

View Chirishman's full-sized avatar
⚔️
I guess statuses are a thing now

Chirishman

⚔️
I guess statuses are a thing now
View GitHub Profile
@Chirishman
Chirishman / index.html
Last active October 14, 2016 21:24
Sankey D3 Visualization - attempting to colorize links
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<title>SANKEY Experiment</title>
<style>
.node rect {
cursor: move;
fill-opacity: .9;
shape-rendering: crispEdges;
http://www.powershellmagazine.com/2014/07/03/posh-ssh-open-source-ssh-powershell-module/
http://powershell.com/cs/media/p/203.aspx
https://blogs.technet.microsoft.com/heyscriptingguy/2011/11/11/use-powershell-to-easily-convert-decimal-to-binary-and-back/
http://stackoverflow.com/questions/34339258/fast-converting-decimal-to-binary-numbers-powershell
https://technet.microsoft.com/en-us/library/ee692684.aspx
http://mohundro.com/blog/2011/05/31/fun-with-binary/
http://haacked.com/archive/2012/01/30/hazards-of-converting-binary-data-to-a-string.aspx/
http://geekswithblogs.net/dbrown/archive/2009/04/05/convert-a-bitarray-to-byte-in-c.aspx
http://www.remkoweijnen.nl/blog/2012/05/10/bit-shifting-in-powershell/
https://www.experts-exchange.com/questions/23517251/How-to-save-a-C-BitArray-using-SQL-Server.html
$n="`n"
$l = @{
C=@({"I get knocked down,$((&$l.A)[0])ut I get up again$((&$l.A)[1])"},{"You are never gonna keep me down"})
V={"$(((("Whiskey","Vodka"),("Lager","Cider") | %{($_ | %{"He drinks a $_ drink"}) -join ", "}),(("good","best") | %{"He sings the songs that remind him of the $_ times"}) | %{$_}) -join $n)`n($(switch ($_) {2 {"Oh Danny Boy, Danny Boy, Danny Boy"}; 4 {"Don't cry for me, next door neighbor"}}))"}
A={if($lp -le 5){@(" b","")}else{@(" (we'll be singing)`nB","$(if($lp -gt 9){" (pissing the night away)"})")}}
}
$out = 1..20 | %{
$lp = $_
if ($_ -le 5){
@Chirishman
Chirishman / install-basic-software.ps1
Last active December 21, 2016 18:13
Basic Software Package
$packages = @(
    "notepadplusplus.install",
"7zip.install",
"GoogleChrome",
"Firefox",
"AdobeReader",
"Putty.install"
)
Install-Package -Name Chocolatey -Force -ProviderName chocolatey
$chocopath = (Get-Package chocolatey | ?{$_.Name -eq "chocolatey"} | Select @{N="Source";E={((($a=($_.Source -split "\\"))[0..($a.length - 2)]) -join "\"),"Tools\chocolateyInstall" -join "\"}} | Select -ExpandProperty Source)
@Chirishman
Chirishman / Invoke-ExampleSlackBot
Created April 14, 2017 18:24
Trying to respond to a Slack PM with a response including buttons
Function Invoke-ExampleSlackBot {
[cmdletbinding()]
Param(
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)]
[ValidateNotNullOrEmpty()]
[string]$BotName,
[Parameter(Mandatory=$false,ValueFromPipelineByPropertyName=$true)]
[ValidateNotNullOrEmpty()]
[securestring]$Token = $(Read-Host -Prompt "API Key" -AsSecureString)
)
@Chirishman
Chirishman / PollDiskspace.ps1
Created April 26, 2017 17:20
Get Diskspace for an AD Group and Call Out Nonresponsive
$Targets = Get-ADComputer -Filter '*' -SearchBase (Get-ADOrganizationalUnit -filter {Name -like "*GroupNameHere*"} |select -expand DistinguishedName) | Select -ExpandProperty Name
$Results = Get-WmiObject win32_logicaldisk -ComputerName $Targets
$UniqueResults = $Results | select -ExpandProperty __SERVER -Unique
$NonResponsive = $Targets |?{$_ -notin $UniqueResults}
@Chirishman
Chirishman / Out-Window.ps1
Created April 26, 2017 21:08
Arbitrary input as a text window
Function Out-Window {
Param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
$InputObject
)
$OutputSettings = @{
Multiline = $true
WordWrap = $false
ScrollBars = "Both"
@Chirishman
Chirishman / AntiEdgeHijack.psd1
Last active February 26, 2018 18:37
Install Registry Tweaks
@{
'HKLM:\SOFTWARE\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723'=@{
'NoOpenWith'=@{
Val=''
Type='String'
}
'NoStaticDefaultVerb'=@{
Val=''
Type='String'
}
@Chirishman
Chirishman / McCain Questions.txt
Created June 8, 2017 22:45
Comey Hearing McCain Testimony
[McCain]
In the case of uh... Hillary Clinton, you made the statement that there wasn't uh... sufficient evidence to bring a suit against her although it'd been very uh, careless in their behavior but you did reach a conclusion in that case that it was not necessary to further pursue her. Yet at the same time in the case of Mr. Comey you said that there was not…not enough evidence to make a conclusion. Tell me the difference between your conclusion as far as former Secretary Clinton is concerned and...and Mr. Trump.
[Comey]
The Clinton investigation was a completed investigation that the FBI had been deeply involved in so I had the opportunity to understand all the facts and apply those facts against the laws as I understood them. This investigation was underway [shrugs] still going when I was fired so it's nowhere near in the same place, least it wasn't when I was-
[McCain]
[interrupting] But it's still ongoing.
@Chirishman
Chirishman / Compress-Manga.psm1
Created August 24, 2017 21:11
Compress Manga Chapters Individually
function Compress-ListedFiles {
Param(
[Parameter(Mandatory=$True,Position=1)]
[array]$FileNames,
[Parameter(Mandatory=$True,Position=2)]
[string]$OutputPath
)
if($FileNames.Count -ne 0) {
#[string]$Zip = "$env:ProgramFiles\7-Zip\7z.exe"
[string]$Zip = "C:\Program Files\7-Zip\7z.exe"