Skip to content

Instantly share code, notes, and snippets.

@paulrobu
paulrobu / DCIM-reorg-by-date.sh
Created July 6, 2023 20:50
Move photo files from current directory (e.g, Camera on Android phones) to newly created dated directories (e.g, 2023-07)
for f in *.jpg; do
#macos:
date=$(stat -f %Sm -t %Y-%m-%d "$f");
#unix:
#date=$(date +%F -r "$f");
y=${date:0:4};
m=${date:5:2};
new_dir="$y-$m";
mkdir -p "$new_dir";
mv "$f" "$new_dir";
@paulrobu
paulrobu / taggable_aws_resource_types.py
Last active March 14, 2023 00:38
[Pulumi]: AWS Resources that support Tags
""" list of known AWS resource types that are taggable """
# ref https://www.pulumi.com/blog/automatically-enforcing-aws-resource-tagging-policies/
# ref https://gist.github.com/stewartnoll/bc8aacff9e785be5c12db320e2852f5f
taggable_resource_types = [
'aws:licensemanager/licenseConfiguration:LicenseConfiguration',
'aws:acm/certificate:Certificate',
'aws:cloudwatch/metricAlarm:MetricAlarm',
'aws:cloudwatch/compositeAlarm:CompositeAlarm',
'aws:cloudwatch/eventBus:EventBus',
@paulrobu
paulrobu / gist:838273110c0721bb3d05622bcd1e3441
Last active November 9, 2021 00:11
How to Create a Bootable Windows 10 USB in Linux
@paulrobu
paulrobu / Kafka-SSL-Performance-Testing.md
Last active November 18, 2020 16:20
Apache Kafka Performance Testing for SSL Clients

Prerequisites:

  1. Config file with SSL settings for producers and consumers (ssl-perf-test.properties in these examples).
  2. A topic to produce and consume from (ssl-perf-test in these examples).

Test the Producer Performance

This examples produces 3 million messages of 1 KiB each.
The -1 value for --throughput means that messages are produced as quickly as possible, with no throttling limit.
Kafka producer related configuration properties like acks and bootstrap.servers are mentioned as part of --producer-props argument.
The SSL config file it’s being referred as value for the --producer-config argument:
`$ bin/kafka-producer-perf-test.sh