- Create a new directory with these three files (requirements.txt, main.py, README.md)
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python main.py
- Update
main()
to run the example prompt chains
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -f /var/log/mute_unmute.lock ]; then # avoid running twice in the debounce time | |
touch /var/log/mute_unmute.lock | |
else | |
exit 0 | |
fi | |
volume=$(mpc status | grep volume | awk '{print $2}') | |
vol=${volume::-1} | |
if [ "$vol" != "0" ]; then | |
echo $vol > /tmp/last_vol |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################ | |
# 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 |
See https://community.volumio.com/t/guide-volumio-bluetooth-receiver/7859
Install dependencies:
sudo apt-get update
sudo apt-get install dh-autoreconf libasound2-dev libortp-dev pi-bluetooth
sudo apt-get install libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc-dev
Compile Bluez 5.51:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[=====[ | |
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", |
Directories on host machine:
-
/data/certbot/letsencrypt
-
/data/certbot/www
-
Nginx server in docker container
docker run -d --name nginx \
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
systemctl stop docker | |
systemctl disable docker | |
echo "Copying scripts to /var/ssl/" | |
mkdir -p /var/ssl | |
cp ca.pem server-cert.pem server-key.pem /var/ssl/ | |
cat<<-EOF > /etc/systemd/system/docker.service | |
[Unit] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
mkdir certs && cd certs | |
echo "Creating server keys..." | |
echo 01 > ca.srl | |
openssl genrsa -des3 -out ca-key.pem | |
openssl req -new -x509 -days 3650 -key ca-key.pem -out ca.pem | |
openssl genrsa -des3 -out server-key.pem | |
openssl req -new -key server-key.pem -out server.csr | |
openssl x509 -req -days 365 -in server.csr -CA ca.pem -CAkey ca-key.pem \ |
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
NewerOlder