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

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

An “obvious” improvement

It’s been a long time since I felt such satisfaction debuging something so I decided to write about it. Let’s assume that you need to store (cache) in memory a large object tree during some operations. In practice this happens because some regulatory constraints so you end up having to parse a very large file and store the resulting object tree. Actually you have a single entry cache. You parse your object, store it in memory for search and processing while the current object tree is used....

October 20, 2017 · len

Simple pomodoro script

This is a very basic pomodoro script I am using to avoid getting in a fixed position for hours at a time: <pre lang="shell"> #!/bin/bash UNIT=5 UNIT_CNT=5 PAUSE=6 notify-send -i clock "Starting interval..." for i in $(seq $UNIT_CNT); do sleep ${UNIT}m let c=$i*$UNIT notify-send -i clock "$c minutes" done (for i in $(seq $PAUSE); do let c=$PAUSE-$i+1; echo -n "Pause ${c}m"; echo -e '\f'; sleep 1m; done; echo -e '\f'; echo "Work";) | sm -

December 22, 2016 · len

The dark side of the force

I have been spending a lot of time lately working on a new javascript based interface. As with any js project we ended up with a lot of layers. For instance for a simple numeric input there are: the html input the kendo numerictextbox the aurelia-kendo-bridge wrapper our own wrapper to allow for some level of DRY The fun part is that we needed of course some functionality which did not existed in the kendo component (adding support for financial shortcuts: 10k => 10,000)....

December 22, 2016 · len

A few thoughts about http fetch

Fetch is the “de facto” standard now if building a new javascript code. Even if not yet supported by all browsers it is warmly recommended. There are numerous examples of usage but after reading a lot of them most of them seemed to miss the answer to my questions. These where: how to proper do error handling including having a default error handler which can be overriden how to do http POST?...

December 22, 2016 · len

Read fast or die

I have spend a lot of time today trying to find and fix an issue which ended up to be a fun discovery at the end. The following java error occurred when loading a pdf file from an url stream: <pre lang="java">java.io.IOException: missing CR at sun.net.www.http.ChunkedInputStream.processRaw(ChunkedInputStream.java:405) at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:572) at sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:609) at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:696) at java.io.FilterInputStream.read(FilterInputStream.java:133) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3066) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3060) This looked like a java lib error since java version was a bit old so the first idea was to replace the code with some apache httpClient based code to load the URL....

April 11, 2016 · len

Oracle: drop all schema contents

Purpose: drop all schema contents without dropping the user. <pre lang="sql"> DECLARE BEGIN FOR r1 IN ( SELECT 'DROP ' || object_type || ' ' || object_name || DECODE ( object_type, 'TABLE', ' CASCADE CONSTRAINTS PURGE' ) || DECODE ( object_type, 'TYPE', ' FORCE' ) AS v_sql FROM user_objects WHERE object_type IN ( 'TABLE', 'VIEW', 'PACKAGE', 'TYPE', 'PROCEDURE', 'FUNCTION', 'TRIGGER', 'SEQUENCE' ) ORDER BY object_type, object_name ) LOOP BEGIN EXECUTE IMMEDIATE r1....

February 19, 2016 · len

xubuntu 14.04 – Trusty Tahr

There is not much to say about the new xubuntu 14.04 trusty tahr and this is a very very good thing. I had quite some work to do when installing 12.04 on my Tuxedo Laptop but with 14.04 I managed to setup almost everything in 2h on a friday night. Here is a list of just a few small hick-ups: non blocking grub error while booting from my LVM root Error: diskfilter writes are not supported....

May 2, 2014 · len

Oracle 11g release 2 XE on Ubuntu 14.04

There are many, many links, threads, bugs and discussions related to this since oracle 11g installation is no longer breeze at it was the case with oracle 10g, at least on Ubuntu. This is my short, minimal list of things to do to have oracle running on Ubuntu 14.04 12.04. Last updated 2014-05-01, install on 14.04 Last updated 2013-12-25, install on 12.04.3. 0. backup. If you have a previous oracle install backup your databases with expdp....

May 2, 2014 · len