marcelpetrick
export a git-repo as a bundle
Archiving the whole directory is also an idea, but why not use the integrated functionality?
More hints: https://stackoverflow.com/a/5578292/1694302
export to a single file (bunlde):
git bundle create ../SAP_autoIt_bundle --all
recreate:
git clone SAP_autoIt_bundle myClonedFolder
Prepare an SD-card for Raspberry Pi (3)
Download latest Raspbian-image:
* https://downloads.raspberrypi.org/raspbian_latest
Install etcher:
* add “deb https://dl.bintray.com/resin-io/debian stable etcher” to /etc/apt/sources.list
* “sudo apt-key adv –keyserver hkp://pgp.mit.edu:80 –recv-keys 379CE192D401AB61”
* “sudo apt update && sudo apt install etcher-electron”
Use etcher .. (I think this step is self-explanatory).
20190807: etcher for Win (10): https://github.com/balena-io/etcher/releases/ – also as portable version
Jubilate deo!
Ok, today arrived the Calliope mini and after doing all my chores I spent one hour tinkering with the tiny star 🙂
An improved version of one of the suggested projects: the first part of “Ode to joy” from Beethoven together with a blasting animation. Start by pressing “A”.
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
input.onButtonPressed(Button.A, () => { basic.showLeds(` . . . . . . # . # . . . . . . # . . . # . # # # . `) music.playTone(330, music.beat(BeatFraction.Quarter)) music.rest(music.beat(BeatFraction.Half)) music.playTone(330, music.beat(BeatFraction.Quarter)) music.rest(music.beat(BeatFraction.Half)) music.playTone(349, music.beat(BeatFraction.Quarter)) music.rest(music.beat(BeatFraction.Half)) music.playTone(392, music.beat(BeatFraction.Quarter)) music.rest(music.beat(BeatFraction.Half)) music.playTone(392, music.beat(BeatFraction.Quarter)) music.rest(music.beat(BeatFraction.Half)) music.playTone(349, music.beat(BeatFraction.Quarter)) music.rest(music.beat(BeatFraction.Half)) music.playTone(330, music.beat(BeatFraction.Quarter)) music.rest(music.beat(BeatFraction.Half)) music.playTone(294, music.beat(BeatFraction.Quarter)) music.rest(music.beat(BeatFraction.Half)) music.playTone(262, music.beat(BeatFraction.Quarter)) music.rest(music.beat(BeatFraction.Half)) music.playTone(262, music.beat(BeatFraction.Quarter)) music.rest(music.beat(BeatFraction.Half)) music.playTone(294, music.beat(BeatFraction.Quarter)) music.rest(music.beat(BeatFraction.Half)) music.playTone(330, music.beat(BeatFraction.Quarter)) music.rest(music.beat(BeatFraction.Half)) music.playTone(330, music.beat(BeatFraction.Quarter)) music.rest(music.beat(BeatFraction.Half)) music.playTone(294, music.beat(BeatFraction.Eighth)) music.rest(music.beat(BeatFraction.Half)) music.playTone(294, music.beat(BeatFraction.Half)) for (let i = 0; i < 4; i++) { basic.showLeds(` . . . . . . . . . . . . . . . . . . . . . . . . . `) basic.showLeds(` . . . . . . . . . . . . # . . . . . . . . . . . . `) basic.showLeds(` . . . . . . . # . . . # . # . . . # . . . . . . . `) basic.showLeds(` . . # . . . # . # . # . . . # . # . # . . . # . . `) basic.showLeds(` . # . # . # . . . # . . . . . # . . . # . # . # . `) basic.showLeds(` # . . . # . . . . . . . . . . . . . . . # . . . # `) } basic.showLeds(` . . . . . . . . . . . . . . . . . . . . . . . . . `) }) |
clean my code: reloaded!
As always: some projects need a first (working) implementation and then over time you can improve them.
During lunch I was talking with a colleague about this tool. Then the idea to just use those actually changed files from the current implementation (means: the current branch in Git) shall be used as input. Et voila: consider it done!
Also added some fine-tuning to the call-parameter of the script itself, so it can be run as well with some custom string beside “todoM” (which is my marker).
Cleaning an implementation of properly tagged lines takes now a second – not minutes (like before!
Enjoy and have fun 🙂
Code can be found as always at https://github.com/marcelpetrick/cleanMyCode/blob/master/remove_todoM.sh
windows shell: some sleep-replacement
Ok, “wait” does not exist and “sleep” as well too.
Then there is the infamous ping-trick:
1 |
ping 127.0.0.1 -n 1 -w 1000 > NUL |
But the solution is:
1 |
timeout /nobreak /t 3 |
collection of hints for the easier use of cygwin
some better package-manager than via that set-up.exe: apt-cyg!
url: https://github.com/transcode-open/apt-cyg
=================================================
make shell-scripts runnable under Win (7):
add to the first line after “#!/bin/bash”
1 |
(set -o igncr) 2>/dev/null && set -o igncr; |
else you get the error message that “\r” is not a command … ha
=================================================
how to use proxy for firewalled use:
1 |
export http_proxy=http://username:password@host:port/ |
Maybe more will be added. All just small, but fixing tricky
shell-script to clean a project
I like to decorate the code with some debugging-messages, explicit variables, etc. while developing a feature or fixing a bug. Problem is that other team-members will not like that (or the amount ;)).
So, I commit the current state with Git and then remove all lines marked with the comment “// todoM”. Since this some non-creative work, why not automate it?
Code for the bash-script now on github: https://github.com/marcelpetrick/cleanMyCode 🙂
Further improvements like massive parallelization planned!
edith 20170619:
The fourth version relies now on some exported bash-function, so that GNU parallel can be used to speed up the process by parallelizing the search&replace inside the file- (-list given by find).
This helps, just I/O is now the bottleneck. CPU-speed not.
But I’ve always wanted to experiment with “parallel” and see how to use this. I should improve the “contactSheet”-script as well. Or the cat-cam-script .. endless opportunities ..
Calliope mini
Ordered me a Calliope mini today. This is some micro-controller-project from several german instituations to allow pupils beginning from early grades to lay their hands on something similar to a Raspberry Pi. After playing around with the code-generator (one of them ..) I placed my order. 35 € is for the given package (board + periphery) ‘average’, but I am interested in how easy it would be to teach someone (;)) completely programming-unaware how to “do this”.
My first example from the code-gen ():
1 2 3 4 5 6 7 8 9 |
input.onGesture(Gesture.Shake, () => { basic.showLeds(` . . . . . . . # . . . . # . . . # # # . . . # . . `); }); |
Install wordpress on a DSM213
.. just for your information: don’t touch any of the suggested settings while installing the package. Because: else it won’t install! My monthly award for most awkward design goes to: SNYOLOGY!
I spent now 15 min to find this out – if I would have stuck to the defaults, I would be done in a second!
create win7-usb-drive under Linux
Ok, first I squashed the only computer with a cd-burner. Installed Linux Mint 18.1. Everything perfect, went on to install VirtualBox and then Win7 as guest. Ran some checks while waiting. Noticed that in 2016 NO VIRTUALISATION solution SUPPORTS IEEE1394!
Ok, then just install Win7 again. Noticed I can’t find my burned install-DVD, had just an ISO.
# format usb-drive as NTFS
# download Unetbootbin as special version: allows to select NTFS- and other partitions
# select ISO, hook “show partitions”, select /dev/sdb or whatever it is
# plug out, plug in, start, select boot device, install … wait over 9000! hours.