Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# This is a script which will perform a full backup of an arcsight Express appliance
#
# The goal of this script is to provide a backup which can be restored to a completely new system
#
# Made according to directions at https://protect724.hp.com/docs/DOC-13608
# Above link moved to https://community.saas.hpe.com/t5/ESM-and-ESM-Express/ArcSight-Express-4-0-Backup-and-Recovery/ta-p/1588736
#
#
@mitchese
mitchese / aws-smtp-pw-gen.py
Created June 23, 2017 10:23
Convert AWS credentials to SMTP password
import base64
import hmac
import hashlib
import sys
def generate_smtp_password(key):
message = "SendRawEmail"
version = '\x02'
h = hmac.new(key, message, digestmod=hashlib.sha256)
print base64.b64encode("{0}{1}".format(version, h.digest()))
@mitchese
mitchese / gist:7a3373132f94fc946b1cbeb2b04e7818
Created June 23, 2017 21:00
Example ros resize before booting
[2017-06-23 22:54:57] 594 mitchese@cspi-sm
:( $ sudo dd if=rancheros-raspberry-pi64.img of=/dev/mmcblk0 bs=1M
500+0 records in
500+0 records out
524288000 bytes (524 MB, 500 MiB) copied, 118.057 s, 4.4 MB/s
[2017-06-23 22:57:14] 595 mitchese@cspi-sm
:) $ sudo fdisk /dev/mmcblk0
Welcome to fdisk (util-linux 2.29.1).
Changes will remain in memory only, until you decide to write them.
variables:
DOCKER_DRIVER: overlay
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
RANCHER_ACCESS_KEY: accesskey
RANCHER_SECRET_KEY: somelongkeygoeshere
RANCHER_URL: https://rancher.example.com/
stages:
- build
registers:
- name: L1 Voltage
unit_of_measurement: V
register: 0
data_type: float
precision: 2
count: 2
- name: L2 Voltage
unit_of_measurement: V
register: 2
@mitchese
mitchese / speedwire.py
Last active November 17, 2023 21:00
SMA Speedwire python interpreter
# SMA Speedwire interpreter
#
# This little script interprets SMA's speedwire as multicasted from the Sunny Home Manager 2
# and will print out the energy flow total, and for each phase
import socket
import struct
MULTICAST_IP = "239.12.255.254"
MULTICAST_PORT = 9522