Skip to content

Instantly share code, notes, and snippets.

View funkyfuture's full-sized avatar

Frank Sachsenheim funkyfuture

  • The Soviet Sector
View GitHub Profile
@anthonyray
anthonyray / kiosk.md
Created September 6, 2019 15:45
Turn your Raspberry Pi into a kiosk playing looping videos

An acquaintance needed a video kiosk that plays looping videos for an exposition booth. Since I have a bunch of Raspberry Pis lying around, I figured that it would be the perfect use case for using one of them.

Let's assume we start from scratch, with a unflashed, brand new SD card and your Raspberry Pi.

Installing the OS

Install a version of Raspbian that includes the desktop. You can head over to : https://www.raspberrypi.org/downloads/raspbian/ and follow the instructions.

Once the image is downloaded, you can burn it to your SD card with tools like Etcher (https://www.balena.io/etcher/)

@obskyr
obskyr / stream_response.py
Last active April 2, 2024 09:53
How to stream a requests response as a file-like object.
# -*- coding: utf-8 -*-
import requests
from io import BytesIO, SEEK_SET, SEEK_END
class ResponseStream(object):
def __init__(self, request_iterator):
self._bytes = BytesIO()
self._iterator = request_iterator
@vancluever
vancluever / gnome-tracker-disable.md
Last active April 16, 2024 04:57
GNOME Tracker Disable

Disabling GNOME Tracker and Other Info

GNOME's tracker is a CPU and privacy hog. There's a pretty good case as to why it's neither useful nor necessary here: http://lduros.net/posts/tracker-sucks-thanks-tracker/

After discovering it chowing 2 cores, I decided to go about disabling it.

Directories

@Changaco
Changaco / btrfs-undelete
Last active April 22, 2024 20:06
btrfs-undelete
#!/bin/bash
# btrfs-undelete
# Copyright (C) 2013 Jörg Walter <info@syntax-k.de>
# This program is free software; you can redistribute it and/or modify it under
# the term of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or any later version.
if [ ! -b "$1" -o -z "$2" -o -z "$3" ]; then
echo "Usage: $0 <dev> <file/dir> <dest>" 1>&2
echo
@jonls
jonls / doilinks.py
Last active March 20, 2023 21:06
DOI role for Sphinx
@clneagu
clneagu / .bashrc
Last active January 20, 2018 09:09 — forked from cjerdonek/.bashrc
# Call virtualenvwrapper's "workon" if .venv exists. This is modified from--
# http://justinlilly.com/python/virtualenv_wrapper_helper.html
# which is linked from--
# http://virtualenvwrapper.readthedocs.org/en/latest/tips.html#automatically-run-workon-when-entering-a-directory
check_virtualenv() {
if [ -e .venv ]; then
env=`cat .venv`
if [ "$env" != "${VIRTUAL_ENV##*/}" ]; then
echo "Found .venv in directory. Calling: workon ${env}"
workon $env
@epicserve
epicserve / example_command.py
Created October 30, 2013 17:05
Example of how to setup logging for a Django management command.
from django.core.management.base import BaseCommand
from mymodule import main
import logging
class Command(BaseCommand):
help = 'Do foo'
def handle(self, *args, **options):
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite