Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Hunt cdhunt

View GitHub Profile
@potatoqualitee
potatoqualitee / mentalhealth.txt
Last active Sep 26, 2020
Twitter mental health mute list
View mentalhealth.txt
# mute here: https://twitter.com/settings/muted_keywords
republicans
democrats
sanders
manafort
comey
koch
kkk
ku klux klan
TERF
View PSAutoMute.ps1
[cmdletbinding()]
Param()
#Adding definitions for accessing the Audio API
Add-Type -TypeDefinition @'
using System.Runtime.InteropServices;
[Guid("5CDF2C82-841E-4546-9722-0CF74078229A"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
interface IAudioEndpointVolume {
// f(), g(), ... are unused COM method slots. Define these if you care
int f(); int g(); int h(); int i();
@mattifestation
mattifestation / Example_WMI_Detection_EventLogAlert.ps1
Created Jan 14, 2016
An example of how to use permanent WMI event subscriptions to log a malicious action to the event log
View Example_WMI_Detection_EventLogAlert.ps1
# Define the signature - i.e. __EventFilter
$EventFilterArgs = @{
EventNamespace = 'root/cimv2'
Name = 'LateralMovementEvent'
Query = 'SELECT * FROM MSFT_WmiProvider_ExecMethodAsyncEvent_Pre WHERE ObjectPath="Win32_Process" AND MethodName="Create"'
QueryLanguage = 'WQL'
}
$InstanceArgs = @{
Namespace = 'root/subscription'
@mgreenegit
mgreenegit / WSManTrust.psm1
Last active Aug 29, 2015
Simple set of commands to maintain the WSMan trusted hosts list
View WSManTrust.psm1
function Get-WSManTrust {
(Get-Item -Path WSMan:\localhost\Client\TrustedHosts | % Value).split(',')
}
function New-WSManTrust {
param(
[string]$hostname
)
Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value $hostname -Concatenate -Force
}
@ohanhi
ohanhi / frp.md
Last active Sep 4, 2020
Learning FP the hard way: Experiences on the Elm language
View frp.md

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@altrive
altrive / PowerShellv5_UsingNamespace.ps1
Last active Nov 12, 2019
PowerShell v5 'using namespace' syntax test
View PowerShellv5_UsingNamespace.ps1
#Require -Version 5.0
# using statement must appear before any other statements in a script.
# other using types(Assembly/Command/Module/Type) is not supported yet?
# [Enum]::GetNames('System.Management.Automation.Language.UsingStatementKind')
using namespace System.Diagnostics
using namespace System.Linq
function Main
{
View Assert-Authentication.ps1
function Assert-Authentication {
[CmdletBinding()]
param(
[switch]$Force
)
if(!$script:AuthSession -Or $Force) {
$creds = Get-CLCAPICredentials -ActiveCredential
if(!$Creds){
@robinsmidsrod
robinsmidsrod / logstash.conf
Created Dec 5, 2012
Logging Windows event log information to Logstash using nxlog and JSON transport
View logstash.conf
input {
tcp {
type => "syslog"
host => "127.0.0.1"
port => 3514
}
tcp {
type => "eventlog"
host => "10.1.1.2"
port => 3515
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
You can’t perform that action at this time.