Skip to content

Instantly share code, notes, and snippets.

View hertzg's full-sized avatar
🏠
Working from home

George Hertz hertzg

🏠
Working from home
View GitHub Profile
@hertzg
hertzg / etekcity.hexpat
Created September 22, 2024 05:46
Etekcity Nutrition Scale reverse engineered imhex pattern language file
#pragma endian big
#pragma magic 0xFEEFC0A2
enum Type : u8 {
SET_UNIT = 0xc0,
SET_TARE = 0xc1,
SET_NUTRITION = 0xc2,
SET_AUTO_OFF = 0xc4,
MEASUREMENT = 0xd0,
UNIT_STATE = 0xd1,
@hertzg
hertzg / .gitignore
Last active September 4, 2024 16:59
test
node_modules/
@hertzg
hertzg / cloud-init.yaml
Created May 11, 2024 13:45 — forked from syntaqx/cloud-init.yaml
cloud init / cloud config to install Docker on Ubuntu
#cloud-config
# Option 1 - Full installation using cURL
package_update: true
package_upgrade: true
groups:
- docker
system_info:
@hertzg
hertzg / 7seg2bcd.mjs
Last active December 2, 2023 02:21
7 Segment to BCD encoder
const seg7_bcd = ([a, b, c, d, e, f, g]) => {
const w = (a & b & f & g) | (!b & !c & e) | (!a & e);
const x = (!a & b & g) | (a & !f & !g) | (a & !b);
const y = (!b & e & g) | (!d & e) | (a & !f);
const z = (!c & !d & g) | (c & !f) | (a & !e) | (!a & e);
return [w, x, y, z];
};
const TRUTH_TABLE = [
["0000000", "0000", " "],
@hertzg
hertzg / build.yml
Created September 29, 2023 12:10 — forked from aslak01/build.yml
private tap github actions publish on tag
name: build
on:
push:
branches: master
jobs:
tap:
runs-on: macos-latest
steps:
@hertzg
hertzg / catalog.jsond
Last active May 8, 2023 15:21
საქკაბელის კატალოგი
{"page":1,"items":[{"id":"16274","name":"NA2XSEY კაბელი – 3*50 / 16 6/10KV","price":"₾30.000","url":"https://www.sakcable.ge/sk-product/na2xsey-sakcable-%e1%83%99%e1%83%90%e1%83%91%e1%83%94%e1%83%9a%e1%83%98/"},{"id":"6697","name":"H05VV-F 4*240","price":"₾393.8700","url":"https://www.sakcable.ge/sk-product/h05vv-f-4-240-%e1%83%a1%e1%83%90%e1%83%a5%e1%83%99%e1%83%90%e1%83%91%e1%83%94%e1%83%9a%e1%83%98-sakcable/"},{"id":"6698","name":"H05VV-F 4*120+1*35","price":"₾214.5900","url":"https://www.sakcable.ge/sk-product/h05vv-f-4120135/"},{"id":"6674","name":"ას 50/8.0","price":"₾2.67","url":"https://www.sakcable.ge/sk-product/%e1%83%90%e1%83%a1-50-8-sadeni-%e1%83%a1%e1%83%90%e1%83%93%e1%83%94%e1%83%9c%e1%83%98-%e1%83%94%e1%83%9a%e1%83%94%e1%83%a5%e1%83%a2%e1%83%a0%e1%83%9d/"},{"id":"6654","name":"ას 25/4/.2","price":"₾1.44","url":"https://www.sakcable.ge/sk-product/%e1%83%90%e1%83%a1-25-4-2-acsr-iec-61089-kabelebi-kabeli-araizolirebuli-kabelebi/"},{"id":"6638","name":"ას 16/2.7","price":"₾0.97","url":"https://www.
@hertzg
hertzg / mikrotik-ping-notification.txt
Created March 28, 2023 23:41 — forked from sitchi/mikrotik-ping-notification
MikroTik check ping status and send SMS
# RouterOS script for pinging a list of addresses (sending SMS from UBILL API https://ubill.ge)
# Example
# Insert script: System > Scheduler > + Name=ubill-ping; interval=00:01:00;
# insert IP for monitoring: IP > Firewall > Address Lists > + Name=ubill-ping; Address=1.1.1.1; Comment=Router-Tbilisi;
:local ip;
:local disabled;
:local com;
/ip firewall address-list
@hertzg
hertzg / createRsaPublicKeyFromComponents.mjs
Created September 16, 2022 22:03
Create RSA Public Key Object form modulus and exponent components using node Crypto
import { createPublicKey } from "node:crypto";
const length = (n) => {
if (n < 0x80) {
return [n];
} else if (n < 0x100) {
return [0x81, n];
} else if (n < 0x10000) {
return [0x82, n >>> 8, n & 255];
} else if (n < 0x1000000) {
name platform slug uname -m
x86/i686 linux/i386 i386 i386
Linux x86-64 linux/amd64 amd64 x86_64
ARMv5 32-bit linux/arm/v5 arm32v5 armv5l
ARMv6 32-bit linux/arm/v6 arm32v6 armv6l
ARMv7 32-bit linux/arm/v7 arm32v7 armv7l
ARMv8 64-bit linux/arm64/v8 arm64v8 aarch64
IBM POWER8 linux/ppc64le ppc64le ppc64le
IBM z Systems linux/s390x s390x s390x
@hertzg
hertzg / 00-cloud-config.yml
Created March 13, 2021 22:59 — forked from janeczku/00-cloud-config.yml
Annotated RancherOS Cloud-init configuration snippets
#cloud-config
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease).
hostname: myhost
# Authorize SSH keys for the `rancher` sudoer user
ssh_authorized_keys:
- ssh-rsa AAA...ZZZ example1@rancher