Skip to content

Instantly share code, notes, and snippets.

View dewomser's full-sized avatar
😎
leisure at work

Stefan Höhn dewomser

😎
leisure at work
View GitHub Profile
@dewomser
dewomser / Statistik_masto_500.txt
Created April 13, 2024 11:41
Die Statistik vom @dewomser die 5 besten… aus den letzten 200
Total toots: 200 (excluding replies & boosts)
Ratio toots/replies: 6.45
Likes per toot: 0.48 (total likes: 96)
Boosts per toot: 0.26 (total boosts: 51)
Replies per toot: 0.31 (total replies: 62)
┌─────────────────────────────┬──────────────┐
│ USERS YOU MENTIONED MOST │ INTERACTIONS │
├─────────────────────────────┼──────────────┤
│ doppeldau │ 5 │
@dewomser
dewomser / linux_gebabbel.txt
Created April 13, 2024 11:19
Was @dewomser auf Mastodon über Linux gebabbelt hat

Searching toots for linux 1 of 3563 [#>---------------------------] 0.03%
Found toot: @Lioh Ich glaube nicht,dass der Kollege Linux lerrnen will.. Hauptsache der Computer funktioniert wieder. Ich hab ihm ein Debian auf den Stick kopiert und ihm den Tipp gegeben im "BIOS" alles abzuschalten mit "safe" und "secure" bevor er mit der Installation beginnt. Er will selbst machen. Könnte klappen 😃
Date: 13 Apr 24 05:29 UTC
URL: https://social.tchncs.de/@dewomser/112262260850854448
Found toot: Eieiei Linuxkernel. schon wieder https://www.heise.de/news/Linux-Kernel-Neuer-Exploit-verschafft-Root-Privilegien-9682586.html
Was was ist an meinem Geburtstag sonst noch passiert ?
Ein Einzeiler 😃
(calender muss installiert sein)
echo "Was war eigentlich am:"; read -p "Tag (2-stellig): " tag; read -p "Monat (2-stellig): " monat;calendar -A 0 -t $monat$tag
@dewomser
dewomser / bash_array.txt
Created March 27, 2024 17:24
Bash Spielerei mit einem Array
#Spielerei mit array
readarray -t lines < /etc/passwd oder lines=( $(</etc/passwd) )
#Das erste Zeile
echo ${lines[0]}
#das ganze Array in einer Zeile
echo ${lines[@]}
#Zeile root wenn vorhanden
echo ${lines[@]} | grep -Eow root[[:punct:][:alnum:]]*[[:space:][:alnum:]]*[[:punct:][:alnum:]]*
#oder alle Zeilen
for i in "${lines[@]}" ; do echo "$i" ; done
@dewomser
dewomser / autocommit.txt
Created March 15, 2024 06:18
Autocommit für Git . Ein 1-Liner für die Bash
#Git zwingt zum Commit.
Wenn man gerade gar keine Ahnung hat wie man seine Zeit totschlagen soll … Hier kommt Autocommit ein 1-Liner.
----
echo "Autocommit" >> README.md && git add "README.md" && git commit -m "$(w3m -dump https://whatthecommit.com | head -n 1)"
----
Vorsicht ! README.md wird tatsächlich geändert
@dewomser
dewomser / yt-dlp_over_tor.txt
Last active March 3, 2024 17:20
yt-dlp over tor
systemctl start tor
yt-dlp --proxy socks5://127.0.0.1:9050 https://www.youtube.com/watch?v=
@dewomser
dewomser / klimastreifen_worms.py
Created January 11, 2024 07:40
Erzeugt einen Klimastreifen für Worms. Ein Pythonscript für die toolbox bei https://cds.climate.copernicus.eu
import cdstoolbox as ct
# Application plotting climate stripes of temperature anomaly.
@ct.application(title='Climate Stripes')
@ct.output.livefigure()
def plot_time_series():
# Retrieve surface temperature data between 1979 and 2022
data = ct.catalogue.retrieve(
'reanalysis-era5-single-levels',
from collections import OrderedDict
import cdstoolbox as ct
# Define dictionary of cities to extract data from
cities = OrderedDict({
'Worms': {'lat': 49.6327, 'lon': 8.3591},
'Rosenheim': {'lat': 47.85637,'lon': 12.1224},
'Emden': {'lat': 53.36745, 'lon': 7.2077},
'Aachen': {'lat': 50.7766,'lon':6.08342},
'Dresden': {'lat': 51.05089,'lon': 13.7383},
@dewomser
dewomser / multimeter.py
Created December 27, 2023 21:57
Multimeter von Parkside Lidl und die serielle Schnittstelle
import serial
# Modify the port name to match your serial port
port = serial.Serial('/dev/ttyUSB0', 2400, timeout=1, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE)
# Read data from the serial port
while True:
# Read 2-byte preamble
preamble = port.read(2)
@dewomser
dewomser / bashmenue.sh
Created November 22, 2023 08:27
Ausführen einzelner Bashbefehle aus einer Liste
#!/bin/bash
# Definieren Sie eine Liste von Befehlen
commands=("ponysay" "lolcat" "htop" "hollywood" "cmatrix" "figlet" "neofetch" "sl" "toilet" "bpytop" "asciiquarium" "cowsay")
# Hauptmenüschleife
while true; do
echo "Wählen Sie einen Befehl aus der Liste aus:"
select cmd in "${commands[@]}"; do
if [ -n "$cmd" ]; then