Skip to content

Instantly share code, notes, and snippets.

@renini
renini / ugreen_truenas_led.md
Created May 30, 2025 08:38 — forked from Kerryliu/ugreen_truenas_led.md
TrueNAS UGREEN DXP4800 Plus Status LED Guide

UGREEN DXP4800 Plus TrueNAS Status LED Guide

20240609_035951642_iOS

The following is a quick guide on getting basic status LED functionality working with TrueNAS running on the UGREEN DXP4800 Plus. Theoretically, it should work on all models (with some small revisions to the script), but I only have a DXP4800 Plus. :)

This guide is for cron job that runs a script to update the LEDs every couple minutes, but I'm sure the following can be modified for blinky LEDs as well.

Steps:

@renini
renini / winlogbeat_subscription_stats.py
Last active April 30, 2025 20:26
winlogbeat_subscription_stats.py
import xml.etree.ElementTree as ET
from elasticsearch import Elasticsearch
from elasticsearch.helpers import scan
import re
# Initialize Elasticsearch client
#es = Elasticsearch("http://localhost:9200")
def parse_event_query(xml_str):
"""
@renini
renini / create_erspan_type_i_frame_pcap.py
Created March 11, 2025 20:47
Create ERSPAN Type I Frame in PCAP to review bug in viewer
from scapy.all import *
from scapy.contrib.erspan import ERSPAN_I # Import ERSPAN Type I from Scapy
import time # To use the current time or custom timestamp
# Outer Ethernet and IP header (ERSPAN transport)
outer_eth = Ether(src="00:11:22:33:44:55", dst="66:77:88:99:AA:BB")
outer_ip = IP(src="192.168.1.100", dst="192.168.2.200", ttl=64)
# GRE header with ERSPAN (protocol 0x88BE)
gre_header = GRE(proto=0x88BE)
import json
# Sample JSON data
json_data = [
{
"summary": "this is the summary 1",
"title": "this is the title 1",
"year": "2024",
"video": "1.mp4",
"subtitle": "1.vtt"
@renini
renini / upload_mp4_files_to_s3_test2.py
Created January 26, 2024 14:12
upload_mp4_files_to_s3_test2
import os
import json
import boto3
import mysql.connector
from tqdm import tqdm
def upload_mp4_files_to_s3(bucket_name: str, local_directory: str, access_key_id: str, secret_access_key: str, db_host: str, db_user: str, db_password: str, db_database: str):
session = boto3.Session(
aws_access_key_id=access_key_id,
aws_secret_access_key=secret_access_key
@renini
renini / upload_mp4_files_to_s3_test.py
Created January 26, 2024 14:04
upload_mp4_files_to_s3_test
import os
import boto3
from tqdm import tqdm
def upload_mp4_files_to_s3(bucket_name: str, local_directory: str, access_key_id: str, secret_access_key: str):
session = boto3.Session(
aws_access_key_id=access_key,
aws_secret_access_key=secret_key
)
$counter = 0
$decodedctr = 0
Push-Location C:\ioncube_priv8_decoder_v1\php\IC6_5.2
foreach ($file in Get-Content zend-encrypted-files.txt) {
$targetfile = $file.Replace('C:\source\', 'C:\source-decoded\')
$targetdir = [System.IO.Path]::GetDirectoryName($targetfile)
Write-Host Decoding $file to $targetdir
@renini
renini / verify_otp_in_message.py
Created December 12, 2023 13:45
verify_otp_in_message.py
import hmac
import hashlib
import time
import base64
import struct
import sys
import re
# The totp shared secret
shared_secret = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
@renini
renini / getvmwaresessions.py
Last active December 6, 2023 16:47
Download VMware Explore Session Videos and Slides
import sys
import os
import json
import requests
import re
from tqdm import tqdm
url = 'https://www.vmware.com/bin/vmware/videolibrary/get/response' # videolibrary url
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
# https://twitter.com/brsn76945860/status/1171233054951501824
pip install mmh3
-----------------------------
# python 2
import mmh3
import requests
response = requests.get('https://cybersecurity.wtf/favicon.ico')
favicon = response.content.encode('base64')