Skip to content

Instantly share code, notes, and snippets.

@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 April 15, 2024 15:30
Volumio Bluetooth receiver on Raspberry Pi Zero W
@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",
@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 / 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 / volumio-gpio-buttons.py
Created October 11, 2017 12:36 — forked from ivesdebruycker/volumio-gpio-buttons.py
Control Volumio2 with GPIO buttons
# https://volumio.org/forum/gpio-pins-control-volume-t2219.html
# https://pypi.python.org/pypi/socketIO-client
# https://volumio.github.io/docs/API/WebSocket_APIs.html
import RPi.GPIO as GPIO
import time
import subprocess
from socketIO_client import SocketIO, LoggingNamespace
@wolfg1969
wolfg1969 / fontdemo.py
Created July 14, 2016 00:57 — forked from dbader/fontdemo.py
For my Raspberry Pi internet radio project I needed a way to render text suitable for a low resolution monochrome LCD. This article describes how to render 1-bit text using FreeType and Python. See http://dbader.org/blog/monochrome-font-rendering-with-freetype-and-python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Needs freetype-py>=1.0
# For more info see:
# http://dbader.org/blog/monochrome-font-rendering-with-freetype-and-python
# The MIT License (MIT)
#
# Copyright (c) 2013 Daniel Bader (http://dbader.org)
@wolfg1969
wolfg1969 / purge-old-app-version.sh
Created December 4, 2015 01:45
Delete obsolete elasticbeanstalk app versions
#!/usr/bin/env bash
# 2015/12/03 Guo Yong
# Delete obsolete elasticbeanstalk app versions
# http://franklanganke.com/remove-old-aws-elastic-beanstalk-application-versions-bash-cron/
application=$1
filter="uat"
aws elasticbeanstalk describe-environments --application-name=$application --output text --query 'Environments[*].[EnvironmentName,VersionLabel]' | grep -i $filter | awk '{print $2}' > deployed-versions.txt
<html>
<head>
<link href="style.css" rel="stylesheet">
</head>
<body>
<div id="sound-on" class="music">
<div id="bar1"></div>
<div id="bar2"></div>
<div id="bar3"></div>
</div>