Skip to content

Instantly share code, notes, and snippets.

View lmzdev's full-sized avatar
🏠

lmzdev

🏠
View GitHub Profile
@lmzdev
lmzdev / throttled.sh
Last active October 19, 2022 09:06 — forked from aallan/throttled.sh
Script to parse the output of the 'vcgencmd get_throttled' command on a Raspberry Pi
#!/bin/bash
# https://retropie.org.uk/forum/topic/2295/runcommand-warning-if-voltage-temperature-throttling
# https://github.com/mschlenstedt/Loxberry/issues/952
#Flag Bits
UNDERVOLTED=0x1
CAPPED=0x2
THROTTLED=0x4
HAS_UNDERVOLTED=0x10000
@lmzdev
lmzdev / timeservers.txt
Last active December 20, 2022 15:08
NTP Time Servers
ptbtime1.ptb.de 192.53.103.108
ptbtime2.ptb.de 192.53.103.104
ptbtime3.ptb.de 192.53.103.103
ntp0.fau.de 131.188.3.220
ntp1.fau.de 131.188.3.221
ntp2.fau.de 131.188.3.222
time.esa.int 192.171.1.150
@lmzdev
lmzdev / cputemp.py
Created October 10, 2022 10:37
Python read cpu temperature and send to MQTT-Broker
import paho.mqtt.client as mqtt
import time,os, json
brokerHost = "localhost"
def on_connect(client, userdata, flags, rc):
print("Connected to MQTT Broker with result code "+str(rc))
client = mqtt.Client()
client.on_connect = on_connect
@lmzdev
lmzdev / docker-compose.yml
Created September 7, 2022 09:57
statping-ng postgres docker-compose
version: "3.6"
services:
statping:
container_name: statping
image: adamboutcher/statping-ng:latest
restart: always
depends_on:
- postgres
ports:
- 8080:8080
@lmzdev
lmzdev / iperf3.service
Last active October 10, 2022 10:19
Iperf3 systemd unit file
# sudo useradd --system -s /usr/sbin/nologin iperf
# sudo nano /etc/systemd/system/iperf3.service
[Unit]
Description=iperf3 Server Service
After=syslog.target network.target auditd.service
[Service]
ExecStart=/usr/bin/iperf3 -s
User=iperf
@lmzdev
lmzdev / .bash_extras
Last active December 20, 2022 15:09
RHEL / centos / fedora
###
# https://gist.github.com/lmzdev
###
# Others
alias cls='clear -x'
alias svi='sudo vi'
#alias svi='sudo vim'
# IP command
@lmzdev
lmzdev / install_deb.sh
Last active November 8, 2022 16:23
Debian/Ubuntu setup script
#!/bin/bash
#
###
# https://gist.github.com/lmzdev
###
C=`tput setaf 6`
NC=`tput sgr0`
cd ~
echo
@lmzdev
lmzdev / splash.sh
Last active June 15, 2022 13:11
Simple and clean MOTD
#!/bin/sh
# copy to /etc/profile.d/ or /etc/update-motd.d/
###
# https://gist.github.com/lmzdev
###
COL_PRIM=`tput setaf 78`
COL_SEC=`tput setaf 84`
COL_DARK=`tput setaf 239`
NC=`tput sgr0`
@lmzdev
lmzdev / .bash_prompt.sh
Last active January 11, 2023 11:20
Lightweight dynamic Bash prompt
# Source this file from your .bashrc
###
# https://gist.github.com/lmzdev
###
COL_PRIM="\[`tput setaf 4`\]"
COL_SEC="\[`tput setaf 42`\]"
COL_DARK="\[`tput setaf 239`\]"
COL_DANGER="\[`tput setaf 125`\]"
COL_UL="\[`tput sgr 0 1`\]"
@lmzdev
lmzdev / .bash_aliases
Last active March 22, 2023 08:28
Useful bash aliases on Debian/Ubuntu
# This file gets sourced by .bashrc or .zshrc
###
# 2023/03 https://gist.github.com/lmzdev
###
# Optional aliases
alias py='python3'
alias clock='tty-clock -f "%d.%m.%Y" -S -c'
alias btop='bpytop'
#alias t='grc sensors'