marcelpetrick
that blogs speed
quote: If you can’t quantify it, you’re just making it up with your mind”
– quote from someone I can’t currently determine
The subscription for that page expired. As you can check, it’s hosted by bplaced. Why? Because I used that provider for years for some other minor pages and blogs and I experienced never anything bad and their support was also really fast & helpful. Manus manum lavat.
So I wanted to know if there will be an experienceable difference in speed of delivery for the page. It’s dynamic content, so not just the size of the text+pictures matter. I picked randomly three webpage-speed-check-pages from the search results (does not matter which – in two weeks others will own the first ranks, no one cares) and did three runs each. The first was while all three check-pages ran simultaneously, then the following two runs with each separated.
What a worthless feature *facepalm*
Thank you for wasting 300 seconds life-time, M$-Devs*!
ps. I know this is a decision of design, so not to blame the devs but the designers ..
Procrasticoding: annotate animated GIFs (or even add a picture/watermark)
The sun rose, the cats were watching the birds on the windowsill and at first I just wanted to take a cute picture of them sitting soo close, but then I had another inspiration ..
0. Prepared the logo from some internetsearch; stripped of colors, converted to 3-color-GIF with transparency: all done by GIMP and some magic.
1. converted the video to GIF with greyscaling and resizing
2. merged the two pictures while optimizing the layers and applying some contrast
1 2 3 |
ffmpeg -i VID_20160420_061216.mp4 -vf scale=320:180 -strict -2 -vf format=gray video_gray.mp4 && \ ffmpeg -i video_gray.mp4 -t 3 -b:v 1024k -vf scale="320x180" gray320.gif && \ convert gray320.gif -contrast -coalesce -gravity SouthWest -draw 'image Over 0,0 0,0 "leben2.gif"' -layers Optimize combined320.gif |
BTW: sometimes empty phrase-error messages spark my fury … “convert.im6: non-conforming drawing primitive definition `image’ @ error/draw.c/DrawImage/3158.
” … and what does this tell me now?!?
But at least I am not the first one who understood nothing! Thank you.
doEis.sh: convert all negatives via negfix8
reason: too lazy to call the negfix8-script for each file itself. Because conversion is fast but even with an SSD writing the ~120 MiByte files takes some time. Precious time ..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#!/bin/bash # author: Marcel Petrick (mail@marcelpetrick.it) # date: 20160415 # license: GNU General Public License, version 2 ( http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html ) echo "############################ start of the script ############################" #handle the issue with filenames with spaces SAVEIFS=$IFS IFS=$(echo -en "\n\b") #needed for the call of negfix8 SKRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) ALLFILES=`ls *.tif` #get all files inside the current folder which fit by suffix WORKINGDIR="negfix8Output" #todo: maybe add a check if the directory already existed .. mkdir $WORKINGDIR for FILE in $ALLFILES do CLEANEDNAME="${FILE// /_}" #also alter the original-input-name by replacing all spaces echo "will work now on #$FILE# and save as #$CLEANEDNAME#" #print current file name FULLPATH=$WORKINGDIR"/"$CLEANEDNAME".png" #convert /bin/bash $SKRIPTDIR/negfix8.sh -cs $FILE $FULLPATH done printf "############################ end of the script ############################\n" |
ps. ‘do eis’ is latin, not some german-english mumble jumble.
expert-systems: a working example
Most of the time I just add more rants using this tag. But for now I have found a really decent and hugely uselful example of an expert-system: determine plant names.
The examples presented in school and university were most of the time really stilted. You got the idea behind, but you doubted someone would really implement it this way ..
Video to *good* GIF
You can use a crappy app or some webservice … or DIY!
1 |
$ ffmpeg -t 3 -ss 00:00:04 -i INPUTVIDEO.mp4 -b:v 2048k -vf scale="500x281" OUTPUT.gif |
read: start at second 4 with length 3, use high quality-conversion, downscale (because scaling with ‘convert’ will result in artifacts because of the color-indexing), out-filename
If some rotation is needed (-vf “transpose=2” is also an option, but the quality suffered), add it afterwards via convert.
1 |
$ convert -rotate 270 OUTPUT.gif OUTPUT_rot.gif |
Emojicode
What crazy times to live in. Finally possible to code with emojis. No, I don’t mean the “oh, my DSL supports unicode comprehensively”, I mean: “the whole grammar is based on emojis :3”.
My hello-world prints the first fibonacci numbers as a cat-paw-string. (Yes, I am aware, that NOW their frontpage offers also an fibonacci-example!)
code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
? date: 20160328 ? ⚽️ ? ?? ? ➡️ ? ? ? ?### goal: print the value of the first 13 fibonacci numbers as cat-paw-string ###? ? counter 0 ? limit 13 ? f0 0 ? f1 1 ? ◀️ counter limit ? ? newfib ➕ f0 f1 ? paws ? ??? f0 10 ?: ?? ? ▶️ f0 0 ? ? paws ? paws ??? ? ? f0 ? ? paws ? f0 f1 ? f1 newfib ? counter ? ? 0 ? ? |
compile & run:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
$ emojicodec fib_clean.emojic && emojicode fib_clean.emojib ### goal is to create a program which prints the value of the first 13 fibonacci numbers as cat-paw-string and then exits successfully ### 0: 1: ? 1: ? 2: ?? 3: ??? 5: ????? 8: ???????? 13: ????????????? 21: ????????????????????? 34: ?????????????????????????????????? 55: ??????????????????????????????????????????????????????? 89: ????????????????????????????????????????????????????????????????????????????????????????? 144: ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? |
Basics: from dummies for dummies
Create symbolic link 😀
Doing it for years, still tries first: “ln -s link actual”
1 |
ls -s actual link |
Update kernel
Call me dumb, but every few weeks I check my kernel, check the current one and then decide to update, but notice that I can’t remember the needed commands. First try is always “sudo kernelupdate”, which never succeeds 😉
Of course: Linux Mint is the target. For all other Ubuntu-based distros it should work as well.
Therefore: check http://kernel.ubuntu.com/~kernel-ppa/mainline/ and adapt ..
1 2 3 4 5 6 7 |
#!/bin/bash #grab the stuff: no lowlatency, just generic 64 bit; two times headers, once the image sudo cd /tmp; wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.2-wily/linux-headers-4.4.2-040402-generic_4.4.2-040402.201602171633_amd64.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.2-wily/linux-headers-4.4.2-040402_4.4.2-040402.201602171633_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.2-wily/linux-image-4.4.2-040402-generic_4.4.2-040402.201602171633_amd64.deb; sudo dpkg -i *.deb #update bootloader sudo update-grub #reboot sudo reboot |
1 2 |
$ uname -a Linux miniPC 4.4.2-040402-generic #201602171633 SMP Wed Feb 17 21:35:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux |
Synergy
I was using this tool already in 2005(!) and recently re-discovered it when I set up again a multi-monitor multi-system desktop at home. Synergy allows to share keyboard and mouse between different systems by defining virtual expansions at the edges of the ‘server’. Layout is configurable. It is even possible to share the input between different operating systems!
Use the nightly build-download-archive, because for the stable release they charge at least 10$ (since 2014 ).
- install at both systems
- define one as server
- enter the server-IP at the client
- configure a expansion-setup for the screens, done!
edit 20190319: url for the repo not working anymore, use https://sourceforge.net/projects/synergy-stable-builds/ (v1.8.8) instead. Worked on OSX <--> Win10.