Skip to content

Instantly share code, notes, and snippets.

View pdp7's full-sized avatar
💭
Linux on RISC-V

Drew Fustini pdp7

💭
Linux on RISC-V
View GitHub Profile
geocache.service:
< https://gist.github.com/Technicus/7b7ce39254bc36711add >
statuspin_1.sh:
< https://gist.github.com/Technicus/b17d754550592ced9094 >
statuspin_0.sh:
< https://gist.github.com/Technicus/97fa961f4a3db6131a1d >
geocache.service - status:
#/bin/bash
if [$1 == ""];then
echo Need a file name!
else
fswebcam --no-banner --rotate -90 -v -r 768x1024 --jpeg 95 -D 1 $1.jpg
feh -F $1.jpg
fi
#/etc/systemd/system/geocache-shmile.service
[Unit]
Description=shmile for geocache
[Service]
Type=simple
WorkingDirectory=/home/debian/shmile
ExecStart=/home/debian/shmile/node_modules/coffee-script/bin/coffee /home/debian/shmile/app.coffee
/*
* MCP23S08 SPI/GPIO gpio expander driver
*/
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
@pdp7
pdp7 / timetemp.py
Created September 8, 2012 10:06
[timetemp] python script for Raspberry Pi to display time and temp on 7-segment display
#!/usr/bin/env python
# element14 Blog post:
# http://www.element14.com/community/groups/raspberry-pi/blog/2012/09/26/time-temp-display-for-raspberry-pi
# Based on Simon Monk's library:
# http://www.doctormonk.com/2012/08/led-clock-using-raspberry-pi.html
#
import i2c7segment as display
import time
import sensors
from time import sleep
@pdp7
pdp7 / timetemp.sh
Created September 17, 2012 04:59
[timetemp] shell wrapper for python script for Raspberry Pi to display time and temp on 7-segment display
#!/bin/bash
LOG=/var/log/timetemp.log
echo tmp102 0x48 > /sys/class/i2c-adapter/i2c-0/new_device
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-0/new_device
hwclock &> $LOG
date &>> $LOG
hwclock -s &>> $LOG
date &>> $LOG
/home/pi/timetemp/timetemp.py
@pdp7
pdp7 / timetemp
Created September 17, 2012 05:00
[timetemp] init script for Raspberry Pi to start display of time and temp on 7-segment display
### BEGIN INIT INFO
# Provides: time and temp on 7-segment
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: 7-segment display
# Description: time and temp
### END INIT INFO
@pdp7
pdp7 / lighthouse notes 2015-12-14
Created December 14, 2015 17:55 — forked from bonnieking/lighthouse notes 2015-12-14
lighthouse notes 2015-12-14
########################################################################
root@outernet:~# find /sys |grep bcm
/sys/bus/sdio/drivers/bcmsdh_sdmmc
/sys/bus/sdio/drivers/bcmsdh_sdmmc/bind
/sys/bus/sdio/drivers/bcmsdh_sdmmc/sdio:0001:1
/sys/bus/sdio/drivers/bcmsdh_sdmmc/sdio:0001:2
/sys/bus/sdio/drivers/bcmsdh_sdmmc/uevent
/sys/bus/sdio/drivers/bcmsdh_sdmmc/unbind
root@outernet:~# find /sys -type f |grep broadcm
anonymous
anonymous / Bonescript_server.js
Created August 27, 2013 04:26
Updated server.js file for Bone101 (Bonescript) application for BeagleBone Black to enable HTTP Digest Authentication by Dan/Drew @ PS1
// Copyright (C) 2011 - Texas Instruments, Jason Kridner
//
var fs = require('fs');
var child_process = require('child_process');
var http = require('http');
var url = require('url');
var path = require('path');
var winston = require('winston');
var b = require('../bonescript');
var socketio = require('socket.io');
@grizmio
grizmio / gist:bc752dd070652f21266b
Created November 17, 2015 19:53
Patch to make Adafruit's ADC python libraries works with ubuntu xenial, kernel 4
diff --git a/source/c_adc.c b/source/c_adc.c
index e0c754c..5269407 100644
--- a/source/c_adc.c
+++ b/source/c_adc.c
@@ -30,29 +30,28 @@ SOFTWARE.
#include "c_adc.h"
#include "common.h"
-char adc_prefix_dir[40];
+char adc_prefix_dir[49];