Skip to content

Instantly share code, notes, and snippets.

@tonsmets
tonsmets / generate_openleadr_certificates.sh
Created March 12, 2025 12:39
generate_openleadr_certificates.sh
set -e
echo "Please make sure the line RANDFILE = ... is commented out in your /etc/ssl/openssl.conf."
echo "Generating the CA key"
openssl genrsa -out dummy_ca.key 4096
echo "Generating the CA cert"
openssl req -x509 -new -subj "/C=NL/ST=Other/O=OpenLEADR Dummy CA/CN=dummy-ca.openleadr.org" -nodes -key dummy_ca.key -sha256 -days 3650 -out dummy_ca.crt
@tonsmets
tonsmets / download_to_mp4.sh
Created February 7, 2025 07:28
Download m3u8 streams to mp4 with ffmpeg
ffmpeg -i 'https://urlwhereitis.com/file.m3u8?' -bsf:a aac_adtstoasc \
-vcodec copy -c copy -crf 50 ~/Downloads/outfile.mp4
@tonsmets
tonsmets / make_transaction.js
Last active June 22, 2018 08:42
Basic IOTA transaction
// Import the IOTA library.
// Install with this command: 'npm install iota.lib.js'
var IOTA = require('iota.lib.js');
// Create IOTA instance directly with Node (provider)
// This is node is your entry point to the Tangle
var iota = new IOTA({
'provider': 'https://balancer.iotatoken.nl:4433/'
});
#!/usr/bin/env python
import os
import argparse
import logging
import datetime
import urlparse
import subprocess
logging.basicConfig(level=logging.INFO)
import datetime
counter = 0;
for y in range(1900,2000):
for m in range(1, 13):
d = datetime.date(y,m,1)
if d.strftime("%A") == "Sunday":
counter = counter + 1
print "Sunday 1/" + str(m) + "/" + str(y)
s="\nHappy birthday to you"
print(s*3)[:60]+"dear Python"+s