Skip to content

Instantly share code, notes, and snippets.

View vladaman's full-sized avatar

Vladimir Vlach vladaman

View GitHub Profile
@vladaman
vladaman / get_lambda_metrics.sh
Last active August 2, 2025 19:35
Lambda Cost Metrics Script: Analyze AWS Lambda costs, invocations, and duration with a 3-month trend table. Optimize your serverless spending with clear, actionable insights. AWS Lambda CloudWatch CostOptimization Serverless
#!/bin/bash
# Usage: get_lambda_metrics.sh <lambda_function_name>
# Example output
# -------------------------------------------------------------------------------------
# | Jun 2025 | Jul 2025 | Aug | MoM Trend
# Total | $1.323 | $4.060 | $0.809 | ▲ 206%
# Invocations | 1036005 | 3246359 | 412227 | ▲ 213%
# Duration (s) | 326839.058 | 999280.838 | 212742.010 | ▲ 205%
@vladaman
vladaman / README.md
Created July 27, 2025 15:59
Remotely control iRMC S2/S3 Server

Manual how to connect to a Fujitsu server when the web interface no longer supports avr.jnlp

  1. Download avr_iRMC_S3.jar from a root e.g. http://192.168.1.11/avr_iRMC_S3.jar
  2. Run java -jar avr_iRMC_S3.jar
  3. While booting, hit F12 to select Boot Media
@vladaman
vladaman / essp.lua
Last active May 9, 2025 15:57
A Wireshark plugin for dissecting and analyzing encrypted eSSP communication with ITL SMART Hoppers and other eSSP devices.
-- Filter: _ws.col.info != "Command: Poll" && _ws.col.info != "Response: OK" && !(_ws.col.protocol == "USB")
-- Define the protocol
local my_protocol = Proto("mydevice", "eSSP Protocol")
-- Define protocol fields
local pf_seq_slave_id = ProtoField.uint8("mydevice.seq_slave_id", "Header (SEQ/Slave ID/Len)")
local pf_sequence_flag = ProtoField.bool("mydevice.sequence_flag", "Sequence Flag")
local pf_slave_id = ProtoField.uint8("mydevice.slave_id", "Slave ID")
local pf_data_length = ProtoField.uint8("mydevice.data_length", "Data Length")
local pf_data = ProtoField.bytes("mydevice.data", "Data")
@vladaman
vladaman / curl.sh
Created April 19, 2025 14:37
Requests PDF using mPohoda server
curl -d @pohoda-pdf-request.xml -X POST -H "STW-Authorization: Basic QDo=" \
-H "Content-Type: application/xml" http://10.0.11.12:3880/xml
@vladaman
vladaman / nomad.service
Last active August 17, 2023 08:25
Nomad Service Systemd
[Unit]
Description=Nomad
Documentation=https://www.nomadproject.io/docs/
Wants=network-online.target
After=network-online.target
# When using Nomad with Consul it is not necessary to start Consul first. These
# lines start Consul before Nomad as an optimization to avoid Nomad logging
# that Consul is unavailable at startup.
#Wants=consul.service
@vladaman
vladaman / AmazonEventbridge.php
Created October 14, 2022 07:24
Data to AWS Eventbridge without external AWS dependency
<?php
/*
POST / HTTP/1.1
Host: events.<region>.<domain>
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=content-type;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid, Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
@vladaman
vladaman / AmazonKinesis.php
Created October 14, 2022 07:20
Data to Amazon Kinesis from PHP without AWS library dependency
<?php
/*
POST / HTTP/1.1
Host: kinesis.<region>.<domain>
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=content-type;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid, Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
@vladaman
vladaman / activity_schema.sql
Last active June 16, 2023 13:57
Sample table structure for MySQL Activity Schema Data modeling - https://github.com/ActivitySchema
-- Table structure for table `activity_schema` for mySQL
--
CREATE TABLE `activity_schema` (
`activity_id` varchar(255) NOT NULL COMMENT 'Unique identifier for the activity record',
`ts` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'Timestamp in UTC for when the activity occurred',
`customer` varchar(255) DEFAULT NULL COMMENT 'Globally unique identifier for the customer',
`activity` varchar(255) NOT NULL COMMENT 'Name of the activity',
`anonymous_customer_id` varchar(255) DEFAULT NULL COMMENT 'Unique identifier for an anonymous customer (ex. ''segment_abfb8a'')',
`feature_1` varchar(255) DEFAULT NULL COMMENT 'Activity-specific feature 1',
@vladaman
vladaman / AmazonEventbridge.php
Created January 21, 2022 21:10
Simple PHP Class to send data to AWS Eventbridge
<?php
/*
POST / HTTP/1.1
Host: events.<region>.<domain>
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=content-type;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid, Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
@vladaman
vladaman / eftpos-test.js
Created April 8, 2020 13:18
EFTPOS - Protocol test connection V. 3.00 (revision:07) - https://en.wikipedia.org/wiki/EFTPOS - simple test to communicate with MyPAX S800 Terminal
var net = require('net');
var HOST = '192.168.9.111';
var PORT = 20008;
const STX = 0x02; // Start transaction
const ETX = 0x03; // End transaction
const SEP = 0x1C; // Field separator
var client = new net.Socket();