marcelpetrick
“un-optimize” a VisualStudio-solution
By default after generating the solution from mpc-files for each vcxproj the optimization-level is set to maximum (O2), which can lead to trouble while debugging. Variables not “visible”, content of containers not readable, .. and then you can stop debugging, reset manually the optimization, restart and go to the breakpoint/crash. Which is a total waste of time.
I’ve also found no way to convince the mpc-buildsystem of building un-optimized.
Ok, then we build us a sed-oneliner which replaces in all project-files the line about optimization and run it under cygwin:
1 2 3 4 5 6 |
mpetrick@PC180301 /cygdrive/d/Repo $ time find . -name "*.vcxproj" -exec sed -i 's/<Optimization>MaxSpeed<\/Optimization>/<Optimization>Disabled<\/Optimization>/g' {} + real 0m2,240s user 0m0,247s sys 0m0,982s |
backup your Raspberry Pi-sd card
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
tanteedith@miniPC ~/ $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 1 29G 0 disk ├─sdb2 8:18 1 1K 0 part ├─sdb7 8:23 1 27,3G 0 part /media/tanteedith/root ├─sdb5 8:21 1 32M 0 part /media/tanteedith/SETTINGS ├─sdb1 8:17 1 1,1G 0 part ├─sdb8 8:24 1 512M 0 part /media/tanteedith/data └─sdb6 8:22 1 66M 0 part /media/tanteedith/boot sda 8:0 0 119,2G 0 disk ├─sda2 8:2 0 7,7G 0 part [SWAP] ├─sda3 8:3 0 81,1G 0 part /home └─sda1 8:1 0 30,5G 0 part / tanteedith@miniPC ~/ $ sudo dd bs=4M if=/dev/sdb of=catcam.img 7416+0 records in 7416+0 records out 31104958464 bytes (31 GB) copied, 2794,33 s, 11,1 MB/s tanteedith@miniPC ~/ $ |
Newer versions (8.24+) of coreutils dd have also a progress-option, but not the one bundled with the current distribution ..
add param: “status=progress”
Learning how to solder – a hot iron
Bought myself a soldering iron and a small kit for practising purposes: 28 led, 9 resistors, 2 capacitors and 2 transistors waited to be soldered. And hey, the result is more than I had hoped for :’) It’s never too late to learn new skills! #growyourownhappiness
This is/was part of my 2018-campaign to acquire more experiences with discrete electronics. Software is nice, but we need something which moves and blinks (to impress people).
dumpDiver: analyze quickly Windows crash-dumps
I had the task to analyze a bigger collection of crashdumps. Loading the file everytime to VisualStudio, start debugging,
So, I thought if there are tools, which can extract the information (yes, the cdb for Windows) and put it to a file with the same name-prefix. Et voila: dumpDiver was born.
A small helper-batch-file which does the above-mentioned stuff. So that you can lean back and watch your computer grind at 100% workload 🙂
ps. Yes, I know, it is slightly wrong. dumpster-diver would be correct.
banner generator: figlet (online)
Ok, most of the times your classes and functions shall be commented.
So, let us decorate a bit: your wish shall be my command 😉
I had just remembered the good old toolkit to generate banners!
url: http://patorjk.com/software/taag/
1 2 3 4 5 6 7 8 9 10 11 |
// // 88888888ba 88 // 88 "8b ,d ,d 88 // 88 ,8P 88 88 88 // 88aaaaaa8P' ,adPPYba, ,adPPYba, MM88MMM ,adPPYba, ,adPPYba, 88,dPYba,,adPYba, 88,dPYba,,adPYba, ,adPPYba, 8b,dPPYba, MM88MMM ,adPPYba, 8b d8 ,adPPYba, 8b,dPPYba, 88 // 88""""""8b, a8P_____88 I8[ "" 88 a8" "" a8" "8a 88P' "88" "8a 88P' "88" "8a a8P_____88 88P' `"8a 88 a8P_____88 `8b d8' a8P_____88 88P' "Y8 88 // 88 `8b 8PP""""""" `"Y8ba, 88 8b 8b d8 88 88 88 88 88 88 8PP""""""" 88 88 88 8PP""""""" `8b d8' 8PP""""""" 88 "" // 88 a8P "8b, ,aa aa ]8I 88, "8a, ,aa "8a, ,a8" 88 88 88 88 88 88 "8b, ,aa 88 88 88, "8b, ,aa `8b,d8' "8b, ,aa 88 aa // 88888888P" `"Ybbd8"' `"YbbdP"' "Y888 `"Ybbd8"' `"YbbdP"' 88 88 88 88 88 88 `"Ybbd8"' 88 88 "Y888 `"Ybbd8"' "8" `"Ybbd8"' 88 88 // // |
20 min-project of today: creepy squirrel
Had in mind to play around with the “make LED shine directly via PIN”-feature of the Calliope Mini. Worked, nice 🙂
Actually for both “eyes” it is randomnly picked if they shall light up (and down) separately, but the GIF can can last just 3 seconds.
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 |
let ledpowerinverted = 0 let pin2 = false let pin1 = false basic.forever(() => { pin1 = Math.randomBoolean() pin2 = Math.randomBoolean() for (let ledpower = 0; ledpower <= 1023; ledpower++) { if (pin1) { pins.analogWritePin(AnalogPin.P1, ledpower) } if (pin2) { pins.analogWritePin(AnalogPin.P2, ledpower) } basic.pause(2) } for (let ledpower2 = 0; ledpower2 <= 1023; ledpower2++) { ledpowerinverted = 1023 - ledpower2 if (pin1) { pins.analogWritePin(AnalogPin.P1, ledpowerinverted) } if (pin2) { pins.analogWritePin(AnalogPin.P2, ledpowerinverted) } basic.pause(2) } basic.pause(500) }) |
I need a new mp3-player: why not buy again a (used) Sansa Clip+ and Rockbox it?
Guide is still valid.
Downloading the firmware-binary and running the Rockbox-installer (now at version 3.14) under Linux was not a problem.
Five minutes later I got a “new” working player. Still prefer it to the (smart-)phone while doing fitness.
applied science ;3
The surface-temperature of an average ~furry lazybutt~ housecat is 24°C 😀
For this important experiment you need: a Calliope Mini, a computer science-degree and too much free time ;’)
Just kidding, the code is quite simple:
1 2 3 4 |
input.onButtonPressed(Button.A, () => { music.playTone(262, music.beat(BeatFraction.Whole)) basic.showString("" + input.temperature() + "°C") }) |
proper rename-scheme for digiKam
The Olympus-cam has no nice way to set an immediate scheme for the filename, so I transfer the files to the PC and fire up digiKam:
1 |
[date:yyyyMMdd-hhmmss]{unique:3} |
Fun fact: since it is based on KDE –> Qt, it also uses the same formatting for DateTime like Qt. Horay 🙂
Addendum: to fix the annoying “no klauncher found”-message and the invisible thumbnails after some certain apt-get-upgrades, just run
1 |
sudo apt-fast install kde-runtime |
again.
Need to fake some incoming packets?
Try Packet Sender (available for all major OS: I used the portable version for Windows as well as the AppImage for Linux (I love that AppImage-idea. Already the third OSS which was packaged like this instead of a *.deb or as pure source ..)) to emulate the sending of some UDP-datagrams to test one of my programs. And it works really neatly.
You’ve got a tidy window with some textfields for receiver, type and content, a “fire away”-button, some repeat-ability. Nice!
On the receiving end we all know Wireshark. But the emulation was (at least to me) before some big black hole.
Yes, I know, there would be as well sendip. But at work I barely could make a Cygwin work. Not to speak about some dynamic “oh, I load more packages on the fly from the internet”-possibility, meh.
But for those interested: short tutorial for sendip.