Skip to content

Instantly share code, notes, and snippets.

@disler
disler / README.md
Created March 31, 2024 14:34
Use these Prompt Chains to build HIGH QUALITY AI Agents (Agentic Building Blocks)

Setup

  1. Create a new directory with these three files (requirements.txt, main.py, README.md)
  2. python -m venv venv
  3. source venv/bin/activate
  4. pip install -r requirements.txt
  5. python main.py
  6. Update main() to run the example prompt chains
@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",
@maxivak
maxivak / _0__ssl_certbot_letsencrypt.md
Last active April 16, 2024 21:48
Let's encrypt SSL certificates using certbot in docker

Directories on host machine:

  • /data/certbot/letsencrypt

  • /data/certbot/www

  • Nginx server in docker container

docker run -d --name nginx \
@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
#!/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]
#!/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 \
@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
@hannesdatta
hannesdatta / download_from_dropbox.py
Last active January 25, 2024 17:13
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