Skip to content

Instantly share code, notes, and snippets.

@samm-git
samm-git / psu.json
Created June 19, 2023 10:36
grafana PSU dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
@samm-git
samm-git / psu.conf
Created June 19, 2023 10:28
Telegraf PSU configuration for the EP-54V-150W
[[inputs.snmp]]
## Agent addresses to retrieve values from.
agents = ["udp://psu.local:161"]
version = 1
path = ["/usr/local/share/snmp/mibs"]
name_override = "psu"
[[inputs.snmp.field]]
oid = "RFC1213-MIB::sysUpTime.0"
name = "uptime"
@samm-git
samm-git / aws-workshops.txt
Last active November 30, 2022 13:34
AWS workshops list, collected using crt.sh/curl, some links are broken
360-degree-customer-view.workshop.aws
accelerated-data-lake.workshop.aws
acew.workshop.aws
acoaw.workshop.aws
acsso.workshop.aws
activate-next.workshop.aws
activate.workshop.aws
actw.workshop.aws
ad-immersionday.workshop.aws
aeim.workshop.aws
@samm-git
samm-git / am2320.c
Last active February 20, 2022 19:16
Reading AM2320 sensor value under FreeBSD
#include <stdio.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdint.h>
#include <dev/iicbus/iic.h>
#define I2C_DEVICE "/dev/iic0"
#define AM2320_ADDR 0x5C
// marantz wired remote control demo
// inspired by https://github.com/Arduino-IRremote/Arduino-IRremote
// see https://smallhacks.wordpress.com/2021/07/07/controlling-marantz-amplifier-using-arduino-via-remote-socket/
/* some definitions from the IRremote Arduino Library */
#define RC5_ADDRESS_BITS 5
#define RC5_COMMAND_BITS 6
#define RC5_EXT_BITS 6
#define RC5_COMMAND_FIELD_BIT 1
#define RC5_TOGGLE_BIT 1
--- bcm2711-rpi-4-b.dtb.txt 2021-02-21 11:37:45.000000000 +0100
+++ bcm2711-rpi-4-b.dtb.1.txt 2021-02-21 11:37:51.000000000 +0100
@@ -14,6 +14,7 @@
emmc2bus = "/emmc2bus";
ethernet0 = "/scb/ethernet@7d580000";
pcie0 = "/scb/pcie@7d500000";
+ blconfig = "/reserved-memory/nvram@0";
audio = "/soc/mailbox@7e00b840/bcm2835_audio";
aux = "/soc/aux@7e215000";
sound = "/soc/sound";
@samm-git
samm-git / cloudfront-kinesis-splunk-transform.py
Last active November 21, 2020 09:22
Transformer of cloudfront format to splunk
import base64
import json
print('Loading function')
def lambda_handler(event, context):
output = []
# Based on the fields chosen during the creation of the
# Real-time log configuration.
/*
* Copyright (c) 1998-2020 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
@samm-git
samm-git / getaccount.php
Created April 19, 2020 16:02
Check account status from the T-mobile CZ prepaid
<?php
$creds = array(
'username'=>'account@example.com',
'password'=>'MyPassWord123'
);
$postvars = '';
foreach($creds as $key=>$value) {
$postvars .= $key . "=" . $value . "&";
@samm-git
samm-git / gui.c.patch
Last active January 9, 2020 23:53
gui.c.patch
--- app/gui/gui.c 2020-01-10 00:49:12.000000000 +0100
+++ app/gui/gui.c 2020-01-10 00:49:56.000000000 +0100
@@ -628,63 +628,6 @@
gimp_action_history_init (gimp);
-#ifdef GDK_WINDOWING_QUARTZ
- {
- GtkosxApplication *osx_app;
- GtkWidget *menu;