View DHT11_BMP180_server.ino
// HTTP JSON API.
#include <EtherCard.h>
#include <DHT.h>
#include <Wire.h>
#include <Adafruit_BMP085_U.h>
// Ethernet:
View sharenet.sh
#!/usr/bin/env sh
#
# Internet Sharing
#
# Based on: https://wiki.archlinux.org/index.php/Internet_sharing
#
LAN=enp0s0
WAN=wlp0s0
View index.sh
#!/usr/bin/env sh
rtmpdump -v -r "rtmp://37.187.153.186:1935/asmedia/index" -o- \
| cvlc \
--extraintf http \
--http-password changeme \
-
View pixel.go
// Package pixel serves a one pixel image.
package pixel
import (
"encoding/base64"
"net/http"
)
const px = `iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGP6zwAAAgcBApocMXEAAAAASUVORK5CYII=`
View p38n31.go
package main
import (
"math/big"
"fmt"
)
type powersOf struct {
E int64
b, n *big.Int
View git-aliases.sh
alias g='git status'
alias gb='git branch'
alias gd='git diff'
alias gdm='git diff master'
alias gl='git log'
alias ga='git add'
alias gaa='git add -p .'
alias gco='git checkout'
alias gc='git commit -v'
alias gca='git commit -v -a'
View update.sh
#! /usr/bin/env sh
# Execute this file:
# - when logging in
# - from a cron job whet the day of time changes (see below)
# An improved version could probably get the location from
# the internet, and use that to figure out sunrise/sunset times.
# Select a random directory.
View mesq.py
import sys
try:
rng = xrange
except NameError:
rng = range # Python 3+
def mesq(base, exp, mod, debug=False):
View ppinitialize.c
#define _GNU_SOURCE 1
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <dlfcn.h>
long PP_Initialize(void) {
fp = fopen("/dev/stderr", "a");
fprintf(fp, "DEBUG: entering PP_Initialize.\n");
View batterymonitor.lua
-- Hex converter, for RGB colors
function hex(inp)
return inp > 16 and string.format("%X", inp) or string.format("0%X", inp)
end
-- Battery monitor
mybattmon = widget({ type = "textbox", name = "mybattmon", align = "right" })
function battery_status ()
local output={} -- output buffer
local fd=io.popen("acpitool -b", "r") -- list present batteries