Len.ro v4

A 20 years repository of bits and pieces. Code, impressions. The 4th incarnation.

Photos pipeline

Remember the days when visiting Istanbul where each night you had to: copy all the photos to your laptop using a custom cable or in later times by removing the sd card and plugging it into the laptop or, worse, an external reader or, if you traveled light, sort them on the camera display so you have more space then after returning home spend at least one weekend to sort them, edit them in Gimp, Lightroom or Darktable?...

November 2, 2022

Len.ro v4

len.ro v4, hugo based I wanted for a while to revive and find a new location for len.ro but it took time to find the available resources (especially time). This would be the fourth (4th) iteration: was a static site in the 2000 a Plone based site in 2006 a Wordpress based site in 2008 the 4th version is this, hugo based. My choice was based on the following:...

October 30, 2022

Git jira hook

This is a git hook to update JIRA server with commit info. This is a simple set of bash scripts which can be used to update a jira server with git commit information. This work as following: When a user writes a commit message in git it used the name of a JIRA issue in the format CODE-XXXX (ie. JVIN-7893). Multiple issues separated by comma are supported. Each will be updated....

September 26, 2019 · len

Router reboot wrapper script

This is a memory sink article. I found this nice python script which reboots a B525 router and wanted to write a wrapper script around it. #!/bin/bash # refs: https://github.com/jinxo13/HuaweiB525Router, https://github.com/mkorz/b618reboot RUNDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" MAX_ATTEMPTS=10 ATTEMPT=0 TIMEOUT=60 LOCK_FILE=$RUNDIR/lock REMOTE=google.com LOCAL= if [ -f $LOCK_FILE ]; then echo "Already running, exiting" exit -1 fi function finish { rm $RUNDIR/lock } trap finish EXIT touch $RUNDIR/lock while (( $ATTEMPT < $MAX_ATTEMPTS )) do DATE=$(date +%Y%d%m-%H%M%S) echo -e "GET http://$REMOTE HTTP/1....

August 24, 2019 · len


August 10, 2019

sign(data, SHA256withRSA) != sign(hash, NONEwithRSA)

Quite funny that after a few months offline I find the fun in writing a small article about an investigation which is still about security. My task was to find how I could replicate the signature performed with an old applet and a proprietary library which used a hardware token in javascript using a new api provided by a different party. The old applet just signed a hash and I had to find the way to implement this with the new api....

April 19, 2019 · len

Gr20 Corse

September 29, 2018

Attach payload into detached pkcs#7 signature

If you are doing signature generation via a hardware token (for instance 3Skey) then, for large files it is impractical to send the file to the hardware token. Instead you send a hash (SHA256), get a detached PKCS#7 signature and you need to re-attach the payload in java code. For once this was easier to do with plain JCE code instead of my favorite BouncyCastle provider. However for really large files BC does provide the streaming mechanism required....

January 15, 2018 · len

openssl recipes

These last days I had to tinker with openssl a lot and this is a short memory reminder of the params. PKCS#7 manipulation Verify pkcs#7 signature #the -noverify means do not verify the certificate chain, this will only verify the signature not the originating certificate openssl smime -inform DER -verify -noverify -in signature.p7s Show the structure of the file (applies to all DER files) #for debuging openssl asn1parse -inform DER -i -in signature....

January 9, 2018 · len

piBot – bot for monitoring temperature

This is a long due project using a raspberry Pi to monitor the temperature of a cabin I’ve been building for a very long time. I’ve bought the hardware almost 4 years ago and only arrived to the point where I could use it. Motivation Beside the geek motivation the main practical motivation is to measure inside and outside temperature in order to estimate: degree of insulation and week points min temperature in order to calculate needed anti-freeze mix for heating pipes temperature monitoring for pump automation (TODO) min temperature in order to start some electric heating (TODO) accuracy of weather predictions for the location Architecture The architecture of the system is quite simple and has the following components:...

November 30, 2017 · len