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 / 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
#!/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 / 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):
@bkbilly
bkbilly / bulbAlertLinedetection.py
Last active February 27, 2017 15:14
Flash lights for a specific time on the Yeelight when a Line-cross is detected from Hikvision camera.
#!/usr/bin/python
import requests
import re
import threading
import time
import socket
import json
from datetime import datetime
import pytz
#include <IRremoteESP8266.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#define DEBUG 1
const char* ssid = "";
const char* password = "";
@bkbilly
bkbilly / plot_snmp_interfaces.py
Last active April 23, 2020 10:00
Scans the SNMP tree for all the interfaces and its packet sizes and for every interface plots it into a diagram.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "bkbilly"
from pysnmp.entity.rfc3413.oneliner import cmdgen
from datetime import datetime
import matplotlib.pyplot as plt
import matplotlib.animation as animation
@bkbilly
bkbilly / textinput.py
Last active July 1, 2018 11:01
Google Assistant text input from Terminal. e.g. python3 -m googlesamples.assistant.grpc.textinput_intext --device-id 'my-device-identifier' --device-model-id 'my-model-identifier' --intext 'broadcast dinner time'
# Copyright (C) 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@bkbilly
bkbilly / readIR.py
Created June 6, 2018 16:43
Convert an IR signal to binary
#! /usr/bin/python3
import time
import subprocess
import re
START = 4000
DIFF = 500
@bkbilly
bkbilly / backup.py
Created January 7, 2019 20:05
Backup files to a directory and then encrypts it
#!/usr/bin/env python3
import subprocess
import sys
import logging
from shutil import copytree, ignore_patterns, rmtree
import os
from subprocess import call
logging.basicConfig(
@bkbilly
bkbilly / configuration.yaml
Created January 7, 2019 20:44
Home Assistant OASA next bus arrival
sensor:
- platform: oasa
name: "Leave Home Station"
bus: "409"
lat: "37.996364"
lon: "23.792815"