Skip to content

Instantly share code, notes, and snippets.

@wolfg1969
wolfg1969 / README.md
Last active April 15, 2024 15:30
Volumio Bluetooth receiver on Raspberry Pi Zero W
@wolfg1969
wolfg1969 / README.md
Last active December 15, 2023 08:06
python-gps sample codes, Raspberry Pi 4 + u-blox GPS module (uart)

Raspberry Pi 4 + u-blox GPS module (uart)

$ sudo apt-get update
$ sudo apt-get install gpsd gpsd-client python-gps

Enable the serial interface and disable serial login shell with raspi-config then reboot. Confirm /dev/ttyS0 exists

$ ls -l /dev/serial*
lrwxrwxrwx 1 root root 5 May 9 10:38 /dev/serial0 -> ttyS0
@wolfg1969
wolfg1969 / download_from_dropbox.py
Created December 1, 2023 03:08 — forked from hannesdatta/download_from_dropbox.py
Python script to download entire folder/directory structure from a (shared) Dropbox folder to a local computer
################################################################
# DOWNLOAD ENTIRE FOLDER STRUCTURE FROM DROPBOX TO LOCAL DRIVE #
################################################################
# Instructions:
# (1) install dropbox API using pip
# > pip install dropbox
# (2) Create application to make requests to the Dropbox API
# - Go to: https://dropbox.com/developers/apps
@wolfg1969
wolfg1969 / README.md
Last active September 5, 2023 00:31
Volumio Bluetooth receiver

Volumio Bluetooth receiver

https://forum.volumio.org/volumio-bluetooth-receiver-t8937.html

Install dependencies:

sudo apt-get update
sudo apt-get install wajig
wajig install dh-autoreconf libasound2-dev libortp-dev pi-bluetooth
wajig install libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc-dev
@wolfg1969
wolfg1969 / heweather-aqi-parser.lua
Last active March 6, 2023 04:50
HeWeather API v7 parser for Domoticz
--[=====[
https://dev.qweather.com/docs/api/air/air-now/
curl -L -X GET --compressed 'https://api.qweather.com/v7/air/now?location=101010100&key=YOUR_KEY'
{
"code": "200",
"updateTime": "2021-02-16T14:42+08:00",
"fxLink": "http://hfx.link/2ax4",
"now": {
"pubTime": "2021-02-16T14:00+08:00",
"aqi": "28",
# build helloworld executable when user executes "make"
volumecontrol: volumecontrol.o
$(CC) $(LDFLAGS) -lasound volumecontrol.o -o volumecontrol
volumecontrol.o: volumecontrol.c
$(CC) $(CFLAGS) -c volumecontrol.c
# remove object files and executable when user executes "make clean"
clean:
rm *.o volumecontrol
@wolfg1969
wolfg1969 / pypiserver.conf
Last active February 26, 2022 03:02
pypiserver.wsgi
<VirtualHost *:80>
ServerAdmin foo@bar.com
ServerName pypi.dev.example.com
ErrorLog logs/pypiserver-error_log
CustomLog logs/pypiserver-access_log common
DocumentRoot /var/www/html
<Directory /var/www/html>
Order allow,deny
Allow from all
@wolfg1969
wolfg1969 / pcd8544_rpi_ip.c
Last active November 11, 2020 11:49
show ip address A simple PCD8544 LCD (Nokia3310/5110) for Raspberry Pi for displaying some system informations. Makes use of WiringPI-library of Gordon Henderson (https://projects.drogon.net/raspberry-pi/wiringpi/)
/*
=================================================================================
Name : pcd8544_rpi.c
Version : 0.1
Copyright (C) 2012 by Andre Wussow, 2012, desk@binerry.de
Description :
A simple PCD8544 LCD (Nokia3310/5110) for Raspberry Pi for displaying some system informations.
Makes use of WiringPI-library of Gordon Henderson (https://projects.drogon.net/raspberry-pi/wiringpi/)
@wolfg1969
wolfg1969 / build.sh
Last active April 29, 2020 04:34
Build aws lambda layer for mysqlclient
#!/bin/bash
rm -rf lib python
mkdir -p lib
for version in "python3.6" "python3.7" "python3.8"
do
echo "Building $version ..."
mkdir -p python/lib/${version}
docker run -v "$PWD":/var/task "lambci/lambda:build-$version" /bin/sh -c "yum install -y mysql-devel && cp /usr/lib64/mysql/libmysqlclient* lib/ && pip install mysqlclient -t python/lib/$version/site-packages/ && exit"
done
@wolfg1969
wolfg1969 / create_eb_env.sh
Created August 4, 2014 01:45
create a eb environment
#!/usr/bin/env bash
set -e
EB_CLI_HOME=$1
APP_NAME=$2
CONFIG_NAME=$3
export AWS_CREDENTIAL_FILE=/var/lib/jenkins/.elasticbeanstalk/aws_credential_file
export PATH=$PATH:$EB_CLI_HOME/api/bin/