Skip to content

Instantly share code, notes, and snippets.

View cubapp's full-sized avatar

Jakub Urbanec cubapp

View GitHub Profile
@cubapp
cubapp / rename-files-in-subdirs.sh
Last active October 14, 2020 20:10
Rename files in subdirectories according to the directory name. Dirty - files with spaces does not work (grrrr)
for i in $(ls -1); { echo $i; (cd $i; for ff in * ; { aa=$((aa+1)) ; mv "$ff" ${i}-${aa}.jpg } ) }
@cubapp
cubapp / REST API to sunnymap.net via Home Assistant
Created May 4, 2023 07:12
Home Assistant REST to sunnymap.net using GoodWe
# How to add your FVE (PhotoVoltaicPlant) to the sunnymap.net with:
# * HomeAssistant
# * REST API
# * GoodWe integration
#
# First: register your FVE and get API key via: https://sunnymap.net/token_request
# Second: edit the files: configuration.yaml, automations.yaml
# Third: in Developers Tools (/developer-tools/yaml):
# - check the configuration
# - restart configuration
@cubapp
cubapp / benchmark-hash.py
Created June 6, 2024 17:24
Benchmarking python script, taken from PHP version via https://3v4l.org/rMd8D
import time
import random
import string
import bcrypt
import hashlib
# Function to generate random string
def get_random_string(chars, length):
return ''.join(random.choice(chars) for _ in range(length))
@cubapp
cubapp / HomeAssistant-ESP-Home-ePaper.yaml
Created July 9, 2024 13:49
ESP32 with small eInk to display data from HomeAssistant
esphome:
name: esphome-eink-01
on_boot:
priority: 700
then:
- delay: 3sec
- component.update: my_display
- delay: 200ms
- component.update: my_display
- delay: 200ms
@cubapp
cubapp / tools.txt
Created September 30, 2024 16:16
My tools with links
tmux, vim, rg (ripGrep/Silver Searcher/grep)
Honeypot Glutton (for samples) see https://github.com/mushorg/glutton
Shell aliases (tm,lt,mkcd) see https://github.com/cubapp/dotfiles
UPX (source!) see https://github.com/upx
CyberChef see https://github.com/gchq/CyberChef
binary refinery see https://github.com/binref/refinery
tlsh, vbindiff see https://github.com/trendmicro/tlsh
see https://github.com/madsen/vbindiff
hexedit
@cubapp
cubapp / gist:10b810800c8f45edeb941de4f0dc18ef
Created August 4, 2025 13:23
Mac OS X Automator for showing SHA sums in the Finder Menu Quick Actions
# in Automator go for New - Quick Action
# Run Shell Script, Workflow receives current: "files or folders" in "Finder.app"
# shell Pass Input: As Arguments
# then the automation will be present in Finder right click Quick Actions
for f in "$@"
do
hash=$(shasum -a 256 "$f" | awk '{print $1}' | fold -w32)
button=$(osascript -e "display dialog \"File: $f\n\nSHA256:\n$hash\n\n\" with title \"SHA256 Hash\" buttons {\"Copy to clipboard\", \"OK\"} default button 2")
if [[ $button == *"Copy"* ]]; then