Skip to content

Instantly share code, notes, and snippets.

View guyzyl's full-sized avatar

Guy Zylberberg guyzyl

  • Tel Aviv, Israel
View GitHub Profile
@guyzyl
guyzyl / sonos.py
Last active March 27, 2024 16:55
A small server that locates all Sonos devices on the network, synchronizes their volume, and groups them with the device that is playing music
from typing import Optional, List
from flask import Flask
from soco import discover, SoCo
app = Flask(__name__)
@app.route("/normalize")
def normalize_volume(devices: Optional[List[SoCo]]=None) -> str:
@guyzyl
guyzyl / delete_s3_files.py
Created September 20, 2023 07:08
Delete all files in an S3 bucket including file versions
import boto3
BUCKET_NAME = "my-bucket"
s3 = boto3.resource("s3")
bucket = s3.Bucket(BUCKET_NAME)
bucket.objects.delete()
bucket.object_versions.delete()
@guyzyl
guyzyl / whatsapp_mac_beta_check.py
Created August 18, 2022 08:10
A short Python code snippet that notifies you once a slot opens up on the WhatsApp mac beta.
"""
A short Python code snippet that notifies you once a slot opens up
on the WhatsApp mac beta.
Make sure to install the TestFlight app beforehand, so you don't miss
you chance when a slot opens up.
"""
import os
from datetime import datetime
from time import sleep
import requests
2020-06-15T08:46:09.1208507Z ##[group]Run make testacc
2020-06-15T08:46:09.1208817Z make testacc 
2020-06-15T08:46:09.1308362Z shell: /bin/bash -e {0}
2020-06-15T08:46:09.1308488Z ##[endgroup]
2020-06-15T08:46:09.1612955Z ==> Checking that code complies with gofmt requirements...
2020-06-15T08:46:09.2371024Z TF_ACC=1 go test "./helm" -v -timeout 120m -parallel=4
2020-06-15T08:46:16.8242685Z === RUN TestAccDataRepository_basic
2020-06-15T08:46:23.2248188Z --- PASS: TestAccDataRepository_basic (6.40s)
2020-06-15T08:46:23.2248527Z === RUN TestProvider
2020-06-15T08:46:23.2248782Z --- PASS: TestProvider (0.00s)