One week in JavaScript Hell

(or how one must lose all assumptions while starting to use JavaScript) For the past 8 years I’ve worked most of my time on a large ERP system. It was a lot of work and it’s a real system, a system used each day by thousands of people. Yet it is quickly becoming un-sell-able. One would think after almost 4k fixed bugs and years of improvements, the system works pretty well, it might be right, yet this argument fails in front of marketing arguments....

August 7, 2016 · len

Parsing network stream into http request/response

The need was to convert the network stream into clear text http request/responses while doing some decoding of the response body. For instance: request uri + queryString => response body Capture the stream – easy using tcpdump Filter the http stream – easy using wireshark with a tcp.port eq 80 filter Export http #1. using wireshark file -> export objects -> http. This works fine only for files. It does not work for POST requests....

June 22, 2016 · len

Ubuntu 16.04

I’we used ubuntu since edgy days and migrating from gentoo. Things got better each time, until they started getting worse or until I started to expect not to have to fix and patch each time. So now I don’t feel like giving any impression, just a list of bugs: sound is sometimes not working after reboot. This is due to the fact that the sound card order changes. One needs to add: options snd-hda-intel id=HDMI index=-2 in /etc/modprobe....

May 25, 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

Searching for signal

For the last few years, one of the tool I have greatly used is a Huawei E587 modem. It’s a great little device which gave me a lot of freedom. Even if it is quite old, it outperforms, even without an external antenna any smartphone I used for tethering and especially my new Samsung Galaxy S5 Neo which, as a parenthesis, has one of the poorest software I have ever seen, reminds me of a circa 2000 windows pre-installed on a laptop and filled with junkware....

February 29, 2016 · len

Running chrome in docker with audio

The goal is to run google-chrome in a docker container with audio support. I did this trying to get skype.apk to run in archron since skype for linux does not support conferencing anymore. Even if running skype in archron did not seemed to work chrome runs flawlessly with audio support via pulse: So here is the Dockerfile: <pre lang="bash"> FROM ubuntu:14.04 MAINTAINER len@len.ro RUN apt-get update && apt-get install -y wget pulseaudio && echo "deb http://dl....

February 28, 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

LUKS disk encryption with usb key on ubuntu 16.04

The goal is to create an encrypted device which gets automatically unlocked using an usb key. Updated on 20160521 for ubuntu 16.04 which creates a lot of problems. Create the key on the usb drive A good idea is to put the key on the usb drive in such a way it’s not obvious that is a key. Usually on the usb drive there is a 512 bytes MBR (1 sector) and then up to 32 other sectors until the first partition....

January 11, 2016 · len

Ensure rPi connectivity

The problem: make sure I can connect to my raspberry pi B+ even if no network is available or network change. The idea: set a static IP. First some information: running raspbian 8.0 (cat /etc/issue) there is no need for a crossover UTP cable if you connect directly to the device you can use a normal cable IP configuration is delegated from /etc/network/interfaces to the dhcpcd daemon. This is why the eth0 is set on manual....

January 8, 2016 · len

From monolithic single platform apps, to “write once, run everywhere”, (back) to … ?

‘A “line-of-business application” is one set of critical computer applications perceived as vital to running an enterprise’, as Wikipedia defines it. It might not always include cutting-edge technical innovation, but it involves a lot of functional knowledge on business processes thus becoming critical for the well-being of an enterprise and, as a result, has a very long life span. The first application of this type I have worked on was running on Sun machines (OMG, how old I am!...

October 27, 2015 · len