Skip to content

Instantly share code, notes, and snippets.

@byt3bl33d3r
byt3bl33d3r / ws.ps1
Last active September 19, 2024 20:25
Async Websocket PowerShell client (producer/consumer pattern)
<#
References:
- https://docs.microsoft.com/en-us/dotnet/api/system.net.websockets.clientwebsocket?view=netframework-4.5
- https://github.com/poshbotio/PoshBot/blob/master/PoshBot/Implementations/Slack/SlackConnection.ps1
- https://www.leeholmes.com/blog/2018/09/05/producer-consumer-parallelism-in-powershell/
#>
$client_id = [System.GUID]::NewGuid()
$recv_queue = New-Object 'System.Collections.Concurrent.ConcurrentQueue[String]'
@infamousjoeg
infamousjoeg / CYBRAutomation.md
Last active June 25, 2024 09:37
CyberArk Automation - Greatest Hits!
@DavidMStraub
DavidMStraub / mvg-card.js
Created July 13, 2018 14:06
MVG Live custom card for Home Assistant Lovelace UI
class MvgCard extends HTMLElement {
set hass(hass) {
const entityId = this.config.entity;
const state = hass.states[entityId];
const name = state.attributes['friendly_name']
if (!this.content) {
const card = document.createElement('ha-card');
card.header = name;
@bender-the-greatest
bender-the-greatest / Configure-SecureWinRM.ps1
Created July 20, 2017 15:55
Configure WinRM to listen over SSL (port 5986) and use the web certificate generated by a certificate templated called 'WinRM'. Highly recommend reading Synopsis, Description, and Examples.
<#
.SYNOPSIS
Configures a secure WinRM listener over HTTPS to enable
SSL-based WinRM communications. This script has not been
tested on Windows Server 2003R2 or earier, and may not
work on these OSes for a variety of reasons.
If Windows Remote Management is disabled (e.g. service
stopped, GPO Policy, etc.), this script will likely fail.
.DESCRIPTION
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red_50">#fde0dc</color>
<color name="red_100">#f9bdbb</color>
<color name="red_200">#f69988</color>
<color name="red_300">#f36c60</color>
<color name="red_400">#e84e40</color>
<color name="red_500">#e51c23</color>
<color name="red_600">#dd191d</color>
<color name="red_700">#d01716</color>
@pascalpoitras
pascalpoitras / config.md
Last active October 7, 2024 01:35
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@kylef
kylef / sabnzbd.py
Created January 11, 2010 15:04
SABnzbd python api
import urllib, json
class SABnzbd(object):
"""
Usage:
>>> from sabnzbd import SABnzbd
>>> s = SABnzbd('sakar.local', 8080, '4488f2881b90d7753bef8fb9e1bc56b3')
>>> s.pause() # Pauses the downloads
>>> s.shutdown() # Shut's down SABnzbd+
"""