Raspberry pi DoorPi

I’ve written a door pi software that not only controls

  • Intercom door open function on buzzer detection
  • Kasa Smart sockets  (to control heaters)
  • Infrared smart hoover (coredy R500)

But I’m also working on pulse width modulated audio to play audio file down the line to the person at the intercom.   Actually i have it done, just need to push the PCM code once i have sorted the audio amplification.

https://github.com/dmzoneill/ashtangayogacork.ie-doorpi

 


Modern HTML5/CSS3 CV

 

If you are looking for a modern print compatible (print to pdf) HTML5/CSS3 template, consider:

https://cv.fio.ie/

https://github.com/dmzoneill/curriculum-vitae

Might be just what you are looking for if you are tired with working with office documents for your CV

 


PHP Binance API

I’ve been spending some time helping out the the PHP Binance API over on github – php binance.

check back in soon, i’ll be releasing a containerized PHP bot for currency trading 🙂

For now you can get started with the API

Clone

git clone https://github.com/jaggedsoft/php-binance-api.git

Clone

PHP Binance API


WordPress booking system (ashtangayoga.ie)

I’ve been working on a wordpress booking system, and its currently live on ashtangayoga.ie.

Check it out, let me know what you think!


Nautilus thumbnail generator (threaded)

I found a modified a python script to do multi threaded nautilus thumbnail generation.
With a large NAS, i don’t want to spend time waiting for thumbnails to be made, while entering a folder.

Run this as a cron job once a week and have thumbnails pre-generated 🙂

The code

#!/usr/bin/python
import os
import sys
import gi
import threading
import time

threads = []

gi.require_version('GnomeDesktop', '3.0')
from gi.repository import Gio, GnomeDesktop

def make_thumbnail(factory, filename):
    mtime = os.path.getmtime(filename)
    # Use Gio to determine the URI and mime type
    f = Gio.file_new_for_path(filename)
    uri = f.get_uri()
    info = f.query_info(
        'standard::content-type', Gio.FileQueryInfoFlags.NONE, None)
    mime_type = info.get_content_type()

    if factory.lookup(uri, mtime) is not None:
        print "FRESH       %s" % uri
        return False

    if not factory.can_thumbnail(uri, mime_type, mtime):
        print "UNSUPPORTED %s" % uri
        return False

    thumbnail = factory.generate_thumbnail(uri, mime_type)
    if thumbnail is None:
        print "ERROR       %s" % uri
        return False

    print "OK          %s" % uri
    factory.save_thumbnail(thumbnail, uri, mtime)
    return True

def thumbnail_folder(factory, folder):
    for dirpath, dirnames, filenames in os.walk(folder):
        for filename in filenames:
            t = threading.Thread(target=make_thumbnail, args=(factory,os.path.join(dirpath, filename),))
            threads.append(t)
            t.start()

            while len(threads) > 4:
                time.sleep(1)
                i = 0
                while i < len(threads):
                    if threads[i].is_alive():
                        i = i + 1
                    else:
                        del threads[i]


def main(argv):
    factory = GnomeDesktop.DesktopThumbnailFactory()
    for filename in argv[1:]:
        if os.path.isdir(filename):
            thumbnail_folder(factory, filename)
        else:
            make_thumbnail(factory, filename)

if __name__ == '__main__':
    sys.exit(main(sys.argv))