Skip to content

Instantly share code, notes, and snippets.


Walid Shouman weshouman

  • Stuttgat, Germany
View GitHub Profile
weshouman / Makefile
Last active Dec 26, 2020
arduino cli tips
View Makefile
# - Avoid redownloading
# - Avoid overwriting
# - To overwrite, use make uninstall
mkdir -p $${TMPDIR} && \
weshouman /
Created Nov 29, 2020 — forked from amatelin/
A simple script to automatically downsize all the images in a folder using Gimp python console (Gimp->Filters/Python-Fu/console).
from os import listdir
from os.path import isfile, join
## Set image folder path
dir_path = "C:/img_dir/"
## Store files names in folder
files = [f for f in listdir(dir_path) if isfile(join(dir_path, f))]
for file in files:
weshouman /
Last active Jun 30, 2020
Update RPI 4 Bootloader

How I update RPIs bootloader


  • Get an extra sd-card for flashing updates


  • Flash Raspberry OS (used the minimal version) into the sd-card using balena-etcher
  • Using sudo run touch /mnt/.../boot/ssh to enable ssh login to the rpi
  • Move the sd-card to the RPi
  • Debug hint: from now on use the following to get the different versions /opt/vc/bin/vcgencmd version or vcgencmd bootloader_version or event vgencmd bootloader_config.
weshouman /
Created May 31, 2020
A guide to crontab

Adding jobs

  • crontab -e: then add a line representing the job


  • @reboot sleep 60 &&
  • 59 12 * * * simon /usr/bin/ > /dev/null 2>&1

Known issues

  • silent failures: running a job with no permission for the current user fails silently, be careful to provide sudo when needed
weshouman /
Created Apr 26, 2020
git submodules walkthrough
weshouman /
Created Apr 21, 2020
Gitea SSH debugging

This gist tackles, how I did debug the ssh configuration for gitea.

tl;dr: Only read to have some debugging insights, follow this issue to get the final answer directly.

First of all Gitea uses s6 to supervise sshd and gitea itself.
Which automatically resurrects sshd, whenever sshd shuts down. To rerun the sshd with some other options, hopefully over the same port, as it's the one correctly exposed through docker


Following are some hints

  • There are many flavors for awk, mawkminimal&default, gawkfeature-full & nawknew-implementation
  • For a technical comparison between mawk and gawk follow this google discussion
  • MAWK was slow, follow this guide. But the recent version 1.3.4 seems to fix that
  • AWKPATH is only available in gawk. nawk may have it too. But the default one mawk only uses the -f notation, it doesn't even havet the @inlcude statement, thus one can't nest the files, without creating a wrapper application, in a conf/lib like directory structure.

Hints for working with memory on linux

  • Set swappiness to zero guide
  • Utilize ps_mem to check for the real memory usage
  • Check for the caches by checking /proc/meminfo, for GB/MB view use this answer
  • Drop the caches if desired by using sudo sh -c "/bin/echo 3 > /proc/sys/vm/drop_caches" then resetting to 0, the guide is here, notice that sudo should wrap the whole redirection.
weshouman /
Last active Feb 25, 2021
Automating Synology Disk Station

Following are the steps I followed to have further understanding

  1. Know the architecture from this link. Whether the API totally encapsulates the CGI or there are some differences, that is not the topic of this guide, so it's better to be always aware of the Disk Station Architecture your script would support, so that when we have to read the sources we'll know which source to check

  2. Try a working ansible role. That will give a pretty good overview of how the interaction is implemented.

  3. Check the official docs for the