Bash

collection of hints for the easier use of cygwin

Written by  on June 14, 2017

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

else you get the error message that “\r” is not a command … ha
=================================================
how to use proxy for firewalled use:

Maybe more will be added. All just small, but fixing tricky

shell-script to clean a project

Written by  on June 14, 2017

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 ..

Get rid of the master-branch @ github

Written by  on October 30, 2016

issue:

solution:

  1. create a fake branch and push it
  2. go to github > $your_repo > settings > branches > default branch and make the fake branch the current one
  3. delete master
  4. push new master
  5. revert the default branch

share a folder via SMB on CLI

Written by  on October 23, 2016

The missing counter-part for this post.

    • create new smb-user pi: “$ sudo smbpasswd -a pi
    • create directory: “$ mkdir freigabeATminipc
    • set rights: “$ sudo chmod 770 freigabeATminipc/
    • edit config: “$ sudo nano /etc/samba/smb.conf
      add at end of the file the following and save-quit (CTRL+X; y)

  • restart: “$ sudo service smbd restart
  • check if everything fits: “$ testparm

mount a smb-share (not via fstab!)

Written by  on October 7, 2016

Don’t know how often I did this on several systems and still always(!) have to pick the parameters.

Check for available shares in the network via “smbtree”.

Estimate quickly the ‘size’ of the project

Written by  on August 9, 2016

Nothing in comparison to SLOCCount or other tools, but sometimes you just need a ‘value‘ 😉


103 ./main.cpp
90 ./map.cpp
35 ./map.h
63 ./mapitem.cpp
29 ./mapitem.h
122 ./mapprocessor.cpp
27 ./mapprocessor.h
79 ./mapreader.cpp
23 ./mapreader.h
571 total

edith 20160819: sort the result before counting for a much nicer appearance 😉

weather-forecast without annoying advertisments

Written by  on May 18, 2016

wttr

Sounds from the underground

Written by  on May 7, 2016

Found a one-liner which uses input from urandom to create music. And: I’ve experienced worse musical accentuation in games xD

Original source is that blog. Also offers explanations and how to tune the scale. Great!

Read more…

Procrasticoding: annotate animated GIFs (or even add a picture/watermark)

Written by  on April 20, 2016

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

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.

combined320

doEis.sh: convert all negatives via negfix8

Written by  on April 15, 2016

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 ..

ps. ‘do eis’ is latin, not some german-english mumble jumble.