Skip to content

Instantly share code, notes, and snippets.

View Mausy5043's full-sized avatar

Maurice (mausy5043) Hendrix Mausy5043

  • The Netherlands
  • 18:43 (UTC +01:00)
View GitHub Profile
@Mausy5043
Mausy5043 / mkpy312
Last active August 17, 2024 20:06
build Python 3.12 on Raspberry Pi
# allow us to kill the SSH-connection while `make`ing
screen
# install dependencies
sudo apt-get -y install build-essential gdb lcov pkg-config \
libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \
libncurses5-dev libreadline-dev libsqlite3-dev libssl-dev \
lzma lzma-dev tk-dev uuid-dev zlib1g-dev # libmpdec-dev
# using /tmp because it has a lot of room (approx. 500MB is needed)
@Mausy5043
Mausy5043 / mkenv
Created August 4, 2024 11:14
Bash script to create conda environment based on the available `environment.yml` file or create a default environment in cast no YAML file provided.
#!/bin/bash
# MIT License applies.
# Copyright 2024 Maurice (mausy5043) Hendrix
# environment name stored in YAML file takes precedence
if [ -f "environment.yml" ]; then
# YAML exists, so we use that
echo "Found : environment.yml"
env_name=$(grep "name:" environment.yml |cut -d ":" -f 2 |xargs)
@Mausy5043
Mausy5043 / buildbluez.sh
Last active April 7, 2023 13:56
install bleeding edge bluez on Rasberry Pi
#!/bin/sh
if [ -z "$STY" ]; then exec screen -dm -S buildbluez /bin/bash "$0"; fi
sudo cp /etc/apt/sources.list /etc/apt/sources.list.d/deb-src.list
sudo sed -i 's/^deb /deb-src /' /etc/apt/sources.list.d/deb-src.list
sudo apt-get update
sudo apt-get build-dep bluez
sudo apt -y install python3-docutils
@Mausy5043
Mausy5043 / btmon.out.txt
Created March 23, 2023 19:55
btmon output
@ MGMT Open: bluepy3-helper version 1.22 {0x0002} 310.837037
@ MGMT Command: Read Management Version Information (0x0001) plen 0 {0x0002} 310.837435
@ MGMT Event: Command Complete (0x0001) plen 6 {0x0002} 310.837453
Read Management Version Information (0x0001) plen 3
Status: Success (0x00)
Version: 1.22
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7 #2822 [hci0] 310.837975
Type: Passive (0x00)
Interval: 60.000 msec (0x0060)
Window: 60.000 msec (0x0060)
@Mausy5043
Mausy5043 / kamstrup_warmte.sh
Created October 15, 2022 08:38
KAMSTRUP warmtemeters
#!/bin/bash
# filenames to be corrected for your specific application
# Temp2 [87] [68]
python3 /home/pi/domoticz/scripts/python/kamstrup403.py /dev/ttyUSB-IR 87 68
# Heat Energy (verbruik) [60] [65]
python3 /home/pi/domoticz/scripts/python/kamstrup403.py /dev/ttyUSB-IR 60 65
@Mausy5043
Mausy5043 / PREP.log
Created November 28, 2021 15:36
DietPi console output
─────────────────────────────────────────────────────
DietPi v7.8.2 : 16:29 - Sun 11/28/2021
─────────────────────────────────────────────────────
- Device model : RPi 3 Model B+ (aarch64)
- CPU temp : 48'C : 118'F (Optimal temperature)
- LAN IP : 192.168.2.77 (eth0)
- MOTD : Read more about the new DietPi-Dashboard:
https://dietpi.com/docs/software/system_stats/#dietpi-dashboard
─────────────────────────────────────────────────────
@Mausy5043
Mausy5043 / 1
Last active June 7, 2019 09:01
enable installation of Cockpit on Raspberry
sudo nano /etc/apt/sources.list.d/backports.list
Add these lines:
# For Cockpit-Project
deb http://deb.debian.org/debian stretch-backports main
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
@Mausy5043
Mausy5043 / _etc_smartd.conf
Last active January 22, 2023 22:21
My SMART configuration
# Sample configuration file for smartd. See man smartd.conf.
# Home page is: http://www.smartmontools.org
# $Id: smartd.conf 4120 2015-08-27 16:12:21Z samm2 $
# smartd will re-read the configuration file if it receives a HUP
# signal
# Sample configuration file for smartd. See man smartd.conf.
@Mausy5043
Mausy5043 / getMyIP
Created May 6, 2018 09:34
Print IP of local machine
#!/bin/bash
getMyIP() {
local _ip _line
while IFS=$': \t' read -a _line ;do
[ -z "${_line%inet}" ] &&
_ip=${_line[${#_line[1]}>4?1:2]} &&
[ "${_ip#127.0.0.1}" ] && echo $_ip && return 0
done< <(LANG=C /sbin/ifconfig)
}