fabic974 random (binary) wanderings in the philament empires…

Hi, just to let you know that this “web log” is essentially a place where I leave somewhat (im)personal notes to myself.
EDIT/2017: de retour sur l'île de la Réunion, je recherche actuellement un job ou quelque projet captivant auquel je pourrais contribuer, de préférence dans mes cordes: PHP/Symfony, Node.js/Meteor, voire du C/C++ ou du Rust (!) – cf à propos pour plus de détail.

“Instead of the programs I had hoped for, there came only a shuddering blackness and ineffable loneliness; and I saw at last a fearful truth which no one had ever dared to breathe before — the unwhisperable secret of secrets — The fact that this language of stone and stridor is not a sentient perpetuation of Rust as London is of Old London and Paris of Old Paris, but that it is in fact quite unsafe, its sprawling body imperfectly embalmed and infested with queer animate things which have nothing to do with it as it was in compilation. ”
The Rustonomicon ( doc.rust-lang.org/nomicon/ )

lol

12 Dec 2017 – Quote: The Rustonomicon – shuddering blackness & ineffable loneliness.
~#  mkfs.ext4 -L archlinux -m 1 -U time -v /dev/sda3
  • Note that default filesystem features (-O ...) are read from /etc/mke2fs.conf.
  • -L ... : filesystem label.
  • -m 1 : 1% reserved blocks pct.
  • -U time : generate UUID from date-time.
09 Dec 2017 – Write ISO image to USB stick (dd)

Fast blank the media (optional, possibly superfluous) :

$ time \
    wodim -v speed=1 -sao dev=/dev/sr0 blank=fast

Burn the ISO image file to disk :

$ time \
    wodim -v speed=1 -sao dev=/dev/sr0 \
      archlinux-2017.12.01-x86_64.iso

Verify data by computing a SHA-1 fingerprint. Arg. count=$(( ... )) evaluates the amount of 2048-bytes blocks that the source ISO file have. This is recommanded (as per Arch wiki) because the optical drive may (or may not) read some additional garbage.

$ time \
    dd if=/dev/sr0 \
    bs=2048        \
    count=$(( $(du -b archlinux-2017.12.01-x86_64.iso | awk '{print $1}') / 2048 )) \
      | sha1sum -b
  • -V (capital ‘V’) will display very verbose SCSI layer debugging details.
  • -scanbus or --devices is supposed to find out usable devices, but didn’t work -_- *
  • ArchLinux: Optical_disc_drive
09 Dec 2017 – Burn ISO image to CD / DVD

Yet another ultimate Rsync command line :

time \
  nice \
    rsync -aHAX -yy -z --inplace -vihP --stats        \
        /some/source/dir1 /some/other/source/dir2 ... \
        /target/dir       \
      --delete-delay -n ; \
          echo "RSYNC DONE, RETV=$? `date`"

But usually rsync -aviHAXP will do the job.

08 Dec 2017 – Rsync

Best option for obtaining I/O statistics is iotop :

$ sudo iotop -oP -d3

But Linux dist. does not have it (?), resort to iostats – This will output some I/O statistics (at most one terminal screen) :

$ iostat -cdkx 2 $(($LINES/6))

Output through watch yields slightly strange results :

$ S_COLORS=always watch -c -n1 iostat -cdkx 1 8

In a loop :

$ while true; do iostat -cdkx 2 $(($LINES/6)); clear; done

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          30.80    0.32    5.97    0.22    0.00   62.70

Device            r/s     w/s     rkB/s     wkB/s   rrqm/s   wrqm/s  %rrqm  %wrqm r_await w_await aqu-sz rareq-sz wareq-sz  svctm  %util
sda              2.59    1.80    137.88    114.07     0.40     3.09  13.32  63.21    0.82   12.31   0.02    53.30    63.37   0.52   0.23
sdb              0.00    0.08      0.00     33.35     0.00     0.16   4.77  67.12   65.94  370.49   0.03     5.77   428.41   4.80   0.04

TODO: Write down some notes about these numbers (e.g. average queue length).

08 Dec 2017 – iostats

Generate an image with my email address, from the command line :

$ convert -background 'rgba(0,0,0,0)' -fill black \
    -font Source-Code-Pro-for-Powerline -pointsize 12 \
    label:"noreply@examble.com" \
    cadet.fabien_at_gmail.black.png

Likewise for my mobile phone number :

$ convert -background 'rgba(0,0,0,0)' -fill black \
    font Source-Code-Pro-for-Powerline -pointsize 12 \
    label:"+33 (0) 123 11 22 33" \
    cadet_fabien_mobile_phone_number.black.png

List available fonts :

$ convert -list font | grep Font:

There seems to exist a possibly “better” alternative to ImageMagick, probably a fork of it : GraphicsMagick. But it behaves slightly differently.

$ sudo apt-get install graphicsmagick

$ gm convert -background 'rgba(0,0,0,0)' -fill white \
    -font Source-Code-Pro-for-Powerline -pointsize 12 \
    label:"+33 (0) 123 11 22 33" \
    cadet_fabien_mobile_phone_number.white.png
08 Dec 2017 – ImageMagick gen. text to image file

A data race is a particular type of race condition in which these three behaviors occur [Rust]:

  • Two or more pointers access the same data at the same time.
  • At least one of the pointers is being used to write to the data.
  • There’s no mechanism being used to synchronize access to the data.
06 Dec 2017 – Data race (definition)

Scalability is the ability of an application to serve the increasing number of requests with no compromise in performance.

23 Nov 2017 – Scalability

“Tzu-li and Tzu-ssu were boasting about the size of their latest programs. ‘Two-hundred thousand lines,’ said Tzu-li, ‘not counting comments!’ Tzu-ssu responded, ‘Pssh, mine is almost a million lines already.’ Master Yuan-Ma said, ‘My best program has five hundred lines.’ Hearing this, Tzu-li and Tzu-ssu were enlightened.”
Master Yuan-Ma, The Book of Programming

08 Nov 2017 – Quote: Master Yuan-Ma

“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies.”
C.A.R. Hoare, 1980 ACM Turing Award Lecture

08 Nov 2017 – Quote: C.A.R. Hoare on software design

“Just as we cannot think of spatial objects at all apart from space, or temporal objects apart from time, so we cannot think of any object apart from the possibility of its connection with other things.”
Ludwig Wittgenstein

30 Sep 2017 – Quote: Thinking in Time & Space

My dad passed away this morning, 11.40 AM; it was a sunny day; we knew this might happen, but didn’t expect this so soon; have a nice trip over there, see you soon.

11 Sep 2017 – My dad passed away...

« 90% des gens sont prêts à croire n’importe quoi, si on leur donne un pourcentage… »
inconnu

06 Aug 2017 – Citation: pourcentages

Livre: L’espace d’un an – Becky Chambers

book cover

Un bouquin de SF bien sympa., ambiance légère et beaucoup d'humour – bon ok, on voyage pas mal cloîtré sur le vaisseau, en compagnie des personnages et dans l’attente affairée de la prochaine escale – ça se lit bien, sans stress, et laisse de bons souvenirs !–

23 Apr 2017 – Livre: L'espace d'un an

« Beaucoup d’entre nous mourront ainsi sans jamais être nés à leur humanité, ayant confiné leurs systèmes associatifs à l’innovation marchande, en couvrant de mots la nudité simpliste de leur inconscient dominateur. »
Henri Laborit

24 Jan 2017 – Citation: Henri Laborit

“And now,
Where must we go…
We who wander this wasteland
In search of better selves ?”
The First History Man (Mad Max Fury Road).

Et à présent…
Où devons-nous aller pour être plus justes ?

Cité à la fin de Mad Max Fury Road – cf Quora pour une interprétation plausible.

27 Jun 2015 – Quote: Mad Max - Fury Road

« Les souvenirs sont plus fidèles que les amis et les amants : ils reviennent nous voir lorsque notre âme grelotte toute seule. »
Ferenc Mora

22 Jun 2012 – Citation: Ferenc Mora - les souvenirs

“It takes a long time to make something complicated simple, but if you do, it will work without problems for a long time.”
F. Andy Seidl

19 Nov 2011 – Quote: Andy Seidl, KISS

« Les hommes inventèrent l’aurevoir, parce qu’ils se savent en quelque manière immortels, tout en s’estimant contingents et éphémères. »
Borges

26 Oct 2011 – Citation: aurevoirs (Borges)

“All I know is that I know nothing.”
Socrates

(Whereas Jon Snow knows nothing, but doesn’t know it -_-).

20 Oct 2011 – Quote: Socrates knows nothing

“An expert is a person who has made all the mistakes that can be made in a very narrow field.”
Niels Bohr

18 Oct 2011 – Quote: experts (Niels Bohr)

“One thing life has taught me: if you are interested, you never have to look for new interests. They come to you. When you are genuinely interested in one thing, it will always lead to something else.”
Eleanor Roosevelt

14 Oct 2011 – Quote: E. Roosevelt - genuine interest

« La normalité n’est que le consensus social de la majorité exerçant une pression aliénante sur les éléments qu’elle n’englobe pas. »
Jay Abeganski

11 Oct 2011 – Citation: Normalité, un consensus social

Some old posts...

Youtube