Skip to content

Instantly share code, notes, and snippets.

Simon Dittlmann Pindar

Block or report user

Report or block Pindar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Pindar
Pindar / README.md
Last active Mar 30, 2019
Raspotify with HifiBerry
View README.md

To use raspotify properly with HifiBerry on raspberry pi 2 (kernel 4.19.29-v7)

  1. Compile https://github.com/librespot-org/librespot
sudo apt-get install build-essential libasound2-dev
curl https://sh.rustup.rs -sSf | sh
cargo build --release --features alsa-backend
  1. Point /etc/systemd/system/raspotify.service to compiled binary from (1), e.g. /home/pi/librespot/target/release/librespot
@Pindar
Pindar / .A.README.md
Last active Jan 6, 2019
This script acts as Slack Bot to post one tip once a day to a defined channel.
View .A.README.md

Tip Of The Day Bot

This script acts as Slack Bot to post one tip once a day to a defined channel.

@Pindar
Pindar / .env
Last active Jul 17, 2018
automate-powerplug-stereoanlage
View .env
HUE_HOST=192.168.XX.XX
HUE_USER=iglksjflXXXXXXXXX
LIGHT_NUMBER=00
View pishutdown.py
#!/usr/bin/env python3
# shutdown/reboot(/power on) Raspberry Pi with pushbutton
import RPi.GPIO as GPIO
from subprocess import call
from datetime import datetime
import time
from signal import pause
# pushbutton connected to this GPIO pin, using pin 5 also has the benefit of
View avoid-popping.service
[Unit]
Description=Playing zeros
# https://raspberrypi.stackexchange.com/questions/74456/i2s-dac-device-support-kernel-drivers-and-noise-pop-crackle-on-playbac
After=alsa-restore.service
Requires=alsa-restore.service
[Service]
TimeoutSec=0
User=pi
ExecStart=/usr/bin/aplay -D default -c 2 -f S16 -r 48000 /dev/zero
View radio-gpio.py
#!/usr/bin/env python3
import os
from subprocess import check_output
from gpiozero import Button
from signal import pause
import time
def playPause():
os.system("mpc toggle")
@Pindar
Pindar / README.md
Last active Nov 24, 2019 — forked from mill1000/README.md
Headless A2DP Audio Streaming on Raspbian Stretch
View README.md

About

This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.

Motivation

A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:

  • Automatic & Headless - Once setup, the system is entirely automatic. No user iteration is required to pair, connect or start playback. Therefore the Raspberry Pi can be run headless.
  • Simple - This solution has few dependencies, readily available packages and minimal configuration.
  • Up to date

Prerequisites

@Pindar
Pindar / backup-folder.sh
Created Jan 9, 2016
Backup files through rsync
View backup-folder.sh
#!/bin/bash
rsync -arq --exclude='.DS_Store' --exclude='.wdmc' /DataVolume/shares/Public/Shared\ Pictures/ nas:/DataVolume/Backup/Pictures/
@Pindar
Pindar / git.sh
Created Jul 28, 2015
git commands
View git.sh
# restore file
git checkout $(git rev-list -n 1 HEAD -- "$file")^ -- "$file"
# stage files with review
git add -p .
View gist:300d3424f05410ad7c04
#!/bin/bash
FILE=${1}
ENVIRONMENT=${2}
SERVICE_NAME=${3}
ETCD=${4:-"127.0.0.1:4001"}
if [[ $FILE == "" || $ENVIRONMENT == "" || SERVICE_NAME == "" ]]; then
You can’t perform that action at this time.