Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright 2017 NextThing Co
* Peter Nyboer <[email protected]>
* This file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@nyboer
nyboer / renamechip.sh
Created January 3, 2017 01:32
rename CHIP hostname for easy network access
# call this with an argument for the new name
new=${1:-toto}
OLD=$(hostname)
echo "New name for chip is ${new}"
echo $old
sudo sed -i "s/${OLD}/${new}/g" /etc/hostname
sudo sed -i "s/${OLD}/${new}/g" /etc/hosts
@nyboer
nyboer / mopidy.list
Created July 15, 2016 21:53
Package repositories for libspotify
# Mopidy APT archive
deb http://apt.mopidy.com/ stable main contrib non-free
deb-src http://apt.mopidy.com/ stable main contrib non-free
@nyboer
nyboer / chipgpioedge.py
Created July 5, 2016 22:35
Simply python script to try out edge detection with NTC C.H.I.P. GPIO and buttons.
#use edge detection to trigger button event with CHIP_IO and Adafruit GPIO Library on Next Thing Co's C.H.I.P.
import time
import CHIP_IO.GPIO as GPIO
# Pin configuration.
pinA = "XIO-P4"
pinB = "XIO-P5"
pinC = "XIO-P6"
# Setup input for pin
@nyboer
nyboer / pulseaudio-bluetooth.conf
Last active August 8, 2018 10:24
This allows users to add bluetooth audio sinks to pulseaudio for CHIP computers without a desktop manager.
<!-- This configuration file specifies the required security policies
for PulseAudio Bluetooth integration. -->
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- ../system.conf have denied everything, so we just punch some holes -->
<policy user="pulse">