Skip to content

Instantly share code, notes, and snippets.

@weshouman
weshouman / README.md
Created September 11, 2021 04:10
parsers tips and tricks
@weshouman
weshouman / 0_urllib2.py
Created June 9, 2021 07:40 — forked from kennethreitz/0_urllib2.py
urllib2 vs requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
@weshouman
weshouman / Makefile
Last active June 8, 2024 18:57
arduino cli tips
VERSION=0.14.0
SPECIFIER=arduino-cli_${VERSION}_Linux_64bit
BINDIR=/usr/local/bin/
# - Avoid redownloading
# - Avoid overwriting
# - To overwrite, use make uninstall
install:
TMPDIR=/tmp/$(SPECIFIER) && \
mkdir -p $${TMPDIR} && \
@weshouman
weshouman / gimp_img_downsize.py
Created November 29, 2020 19:17 — forked from amatelin/gimp_img_downsize.py
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
weshouman / README.md
Last active August 1, 2022 05:21
Wacom tips and tricks
@weshouman
weshouman / README.md
Last active June 30, 2020 10:18
Update RPI 4 Bootloader

How I update RPIs bootloader

Prerequisits

  • Get an extra sd-card for flashing updates

Setup

  • 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
weshouman / README.md
Created May 31, 2020 14:28
A guide to crontab

Adding jobs

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

Syntax

  • @reboot sleep 60 && my_script.sh
  • 59 12 * * * simon /usr/bin/sample.sh > /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
weshouman / README.md
Created April 26, 2020 04:09
git submodules walkthrough
@weshouman
weshouman / README.md
Created April 21, 2020 23:29
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