Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
description = "Fetches the QuickStatus data from the HPE MSL Tape Library to report on the real health status"
__version__ = "0.1.0"
__version_date__ = "2020-06-06"
__author__ = "Rune Darrud <theflyingcorpse@gmail.com>"
__description__ = "Check HPE MSL QuickStatus Plugin"
__license__ = "MIT"
@TheFlyingCorpse
TheFlyingCorpse / neopixel-flicker.py
Created August 2, 2018 12:51
Fire / flicker neopixel ledstrip WS2812B
#!/usr/bin/env python3
# Based off of http://www.walltech.cc/neopixel-fire-effect/ for Arduino
# Works with Raspbian Stretch on the RPi3
import time
from neopixel import *
import argparse
# LED strip configuration:
LED_COUNT = 220 # Number of LED pixels.
@TheFlyingCorpse
TheFlyingCorpse / verisure.py
Created July 30, 2018 10:14
Get Verisure installation ID
# Manual for Verisure module in Home Assistant doesnt work, it refers to python verisure.py email password installations
# Neither does the "real" way of "vsure email password installations" depending on your locale.
# This works for Nordic's at least, likely the rest as well.
# Prepare the environment by sourcing in your home-assistant's python setup.
source homeassistant/bin/activate
# install verisure incase it isnt there
pip3 install verisure
# Load a python shell
python3
@TheFlyingCorpse
TheFlyingCorpse / ht2.py
Last active April 6, 2019 22:47
HumiTemp Sensor Tag
#!/usr/bin/env python3
# Script is based on https://www.silabs.com/community/wireless/bluetooth/forum.topic.html/python_code_to_useb-RswG
import time
import struct
from meteocalc import Temp, dew_point, heat_index
from influxdb import InfluxDBClient
from bluepy.btle import *
# Product ID (Google / Amazon): B06XQWWPNT
# The decimal reading is only valid to the 10th, it doesnt do 100th, so 34.7c vs 34.75c and 30.5% vs 30.55%
SENSORTAG_NAME = "HT-2"
-- Schema
CREATE TABLE [dbo].[objectStore](
[id] [int] IDENTITY(1,1) NOT NULL,
[source] [varchar](50) NULL,
[source_key] [varchar](255) NULL,
[jsonblob] [varchar](max) NULL,
[metablob] [nvarchar](max) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
-- Data
@TheFlyingCorpse
TheFlyingCorpse / gist:c7486531ea74ef897220e0eef4edcc0f
Last active August 18, 2020 05:57
Avoid highlights in WeeChat in a specific channel

Install and add a filter to mute any highlights to the word "rune" in #r/leagueoflegends on quakenet.

Autoset is used to make it persistent.

/script install unhighlight.py
/script install buffer_autoset.py
/autosetbuffer add irc.quakenet.#r/leagueoflegends localvar_set_unhighlight_regex rune
....
#region Method
/// <summary>
/// gets or sets the Method property
/// </summary>
[Parameter(parametersetname="StandardMethod")]
[Parameter(parametersetname="StandardMethodNoProxy")]
public virtual WebRequestMethod Method
{
@TheFlyingCorpse
TheFlyingCorpse / gist:51c48813f9d0e552fd8c7aa4477ca139
Last active January 16, 2020 10:48
Revoke, delete and clean Puppet and PuppetDB of expired hosts/nodes via API
# On PuppetServer (master/ca), restart puppetserver after modifying.
# vi /etc/puppetlabs/puppetserver/conf.d/auth.conf
{
# Allow RUNE to remove shit
match-request: {
path: "/puppet-ca/v1/certificate_status"
type: regex
}
allow: "magicscript"
sort-order: 200
Verifying that +theflyingcorpse is my blockchain ID. https://onename.com/theflyingcorpse
This file contains examples that can be used together with Telegraf's win_perfcounter plugin to obtain performance data from various performance counter objects. Feel free to comment with suggestions to update this list.
# AD DS (see also SMB and DFS)
[[inputs.win_perfcounters.object]]
Object = "Security System-Wide Statistics"
Counters = ["NTLM Authentications","Kerberos Authentications","Digest Authentications"]
Measurement = "win_ad"
[[inputs.win_perfcounters.object]]
Object = "DirectoryServices"