Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

wolfg wolfg1969

🏠
Working from home
View GitHub Profile
@wolfg1969
wolfg1969 / build.sh
Last active Apr 29, 2020
Build aws lambda layer for mysqlclient
View build.sh
#!/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 Feb 26, 2020
Volumio Bluetooth receiver
View README.md

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 Oct 11, 2017 — forked from ivesdebruycker/volumio-gpio-buttons.py
Control Volumio2 with GPIO buttons
View volumio-gpio-buttons.py
# 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 Jul 14, 2016 — 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
View fontdemo.py
#!/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 Dec 4, 2015
Delete obsolete elasticbeanstalk app versions
View purge-old-app-version.sh
#!/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
View demo.html
<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>
@wolfg1969
wolfg1969 / git_find_big.sh
Created Dec 28, 2014
Shows you the largest objects in your repo's pack file.
View git_find_big.sh
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
View vpn_connection.scpt
tell application "System Events"
-- get current clipboard contents as a string
set CurrentClipboard to the clipboard as string
-- set the clipboad to your password
set the clipboard to "Y0urVPNPa$$w0rd"
-- start playing with the VPN
tell current location of network preferences
@wolfg1969
wolfg1969 / mysql2mongo.py
Created Oct 1, 2014
import mysql tables into mongodb
View mysql2mongo.py
#!/bin/env python
import sys
from decimal import Decimal
from optparse import OptionParser
from pymongo import MongoClient
from pymongo.son_manipulator import SONManipulator
import MySQLdb
import MySQLdb.cursors
You can’t perform that action at this time.