Skip to content

Instantly share code, notes, and snippets.

View bkbilly's full-sized avatar
🎃
Let's Build a Better World Together

Vasilis Koulis bkbilly

🎃
Let's Build a Better World Together
View GitHub Profile
@bkbilly
bkbilly / bulbSwitchControl.py
Last active December 22, 2023 11:00
Control Yeelight and others from a raspberry connected switch. Supports Multiple clicks, and long click.
import RPi.GPIO as GPIO
import socket
import json
import signal
from itertools import cycle
from wakeonlan import wol
import time
class switchButton():
def __init__(self, inputPin, pressDelay=0.5, pressStep=1.5):
#!/usr/bin/env python
''' This application returns the the remaining minutes in the asterisk format
ex: the 326 minutes are returned as 300 20 6'''
import csv
import re
import datetime
import logging
import sys
import click
@bkbilly
bkbilly / vcard_skidoosh.rb
Created October 18, 2016 17:35 — forked from rmm5t/vcard_skidoosh.rb
vCards -> Asterisk commands for improved caller id
#!/usr/bin/env ruby
# usage: ruby vcard_skidoosh.rb vcard.vcf
# outputs a bunch of asterisk commands to stdout.
# taste it.
# Tested for VCARD version 2.1 & 3.0
ARGV.collect{ |f| open(f).readlines }.flatten.each do |line|
if line =~ /^N:(.*)$/
$name = $1.chomp