Friday, April 17, 2020

LinuxCNC on an old Dell D430 with a dock

sudo apt-get install git-core
sudo apt-get install libpci-dev
git clone git:// && cd smictrl
git clone git:// debian
fakeroot dpkg-buildpackage -uc -us
sudo dpkg -i ../smictrl_*.deb
sudo sed -i '/exit 0/ismictrl -s 0' /etc/rc.local
sudo reboot

Adding bCNC to the laptop:
git clone

Profile c++ code

To profile an executable and get a nice visual of it (you need the expected flags when compiled of course):

First you need to compile with argument ''-pg'', so that gcc inserts its code all everywhere to time your function calls.

Once you run the project, it will generate a big file named ''gmon.out''. This is mostly unreadable per se. And ''gprof'' hardly makes it more readable.

Here comes '''' and ''dot'', which generate very readable graphs:
gprof exe/router.exe | -s | dot -Tpng -o profiler.png && gwenview profiler.png

Note that ''gprof'' must be given the executable name. It will not run it in anyway, but it needs the symbol table to give you proper names.

How to submit a patch to the linux kernel

How to submit a patch to the linux kernel

On Ubuntu/Debian you probably need ''sudo apt-get install git-email'' first, unless you want to do it entirely manually (uuh).

git log
git format-patch HEAD~
scripts/ 0001-scripts-config-allow-colons-in-option-strings-for-se.patch
git send-email 0001-scripts-config-allow-colons-in-option-strings-for-se.patch

You could use ''git format-patch --cover-letter HEAD~'' to generate a blank "introductory" email in order to describe your post further than with the sole summary of the patch itself.

Here is a ''~/.gitconfig'' example for git to send emails:
  ; setup for using git send-email; prompts for password
  smtpuser =
  smtpserver =
  smtpencryption = tls
  smtpserverport = 587

Note: you might have to create a specific Google "application password" for the provided pseudo "login" prompt that ''git'' will print.

The tool ''./scripts/'' in linux will help you identify the recipients. It does this very nicely, instead of having to guess from the ''MAINTAINERS'' file.

Finally, to submit the real thing to the linux list
git send-email --cc-cmd='./scripts/ --norolestats 0001-scripts-config-allow-colons-in-option-strings-for-se.patch' 0001-scripts-config-allow-colons-in-option-strings-for-se.patch

It will end up, e.g. as 

Sunday, April 14, 2019

Hack to prevent (solder) wire tangles

I just bought at Farnell some really good and really thin solder wire for small jobs.

The issue is the roll does not hold the wire coils enough si it keeps on creating knots.

I finally came down to this simple idea, which makes use of an elastic band that was offered by a random Chinese reseller, but a regular wide elastic band is probably as efficient. Just pull the last unwound wire under the band and it will hold the coils in place.

Tuesday, March 19, 2019

Pogo-pin harness to stress-test an electronic module before it gets soldered

Here I am using retractable pogo pins again (see a previous use here), within a little 3D printed harness.

This electronic tool holds modules both quickly and efficiently without any soldering. This way I can test or program them individually before they are eventually soldered on the final board.

Obviously then, things get much harder to debug, and sometimes you do not even have room for ICSP pins to test in-situ, or to re-program a microcontroller.

Wednesday, October 24, 2018

Warning/issue with micro-USB ZNTER 1250mAh AA rechargeable batteries


These rechargeable AA batteries sold under the ZNTER brand are cool... until they are damn too hot.

Actually, one of mine started to smoke heavily. Too bad, I like the idea for technophilic trekkers like me, as they require no bulky AA charger. I did not use them a lot though, and I bought 4 more lately so one was perhaps only defective on arrival (DOA).

Anyhow, the charging circuit is probably wrong if it can get to this point without shutting down. It even killed the plug from the 4-way micro USB cable.

In the end: do not buy, or at least do not charge without an eye on them!

ZNTER 1250mAh "AA" rechargeable batteries, which have an embedded circuitry powered by a micro-usb plug!

Friday, May 18, 2018

Script to add a Let’s Encrypt free certificate to an existing Lighttpd web server

Add Let’s Encrypt Certificates to Lighttpd

I wrote a bash script to help add a let's encrypt SSL certificate to a lighttpd web server via the console. Weirdly, they only provide fully automated support for Apache and Nginx as of now (but anyhow, I like to do it my way).

I highly recommend doing so not only because their certificates are free, but also because they help a lot reducing the usual manual burden to install an SSL certificate on an existing web site.