Skip to content

Instantly share code, notes, and snippets.

@Paraphraser
Paraphraser / Checking your Raspberry Pi's view of its power supply.md
Last active March 17, 2026 07:51
Checking your Raspberry Pi's view of its power supply (sometimes it's not the wall-wart)

Checking your Raspberry Pi's view of its power supply

Sometimes it seems like the first (and sometimes only) advice you get offered for almost any problem with a Raspberry Pi is "check your power supply". You think something like:

"hey, I'm using an official power supply sold as being matched with my Pi so how can there be any problem?"

You look up the specs then stick a controlled load across your supply and confirm that it can deliver the required number of Watts.

Yet your problems persist…

@elafargue
elafargue / A Hypriot K8S install.md
Last active March 16, 2025 22:38 — forked from aaronkjones/k8s-pi.md
K8s (v1.10.5) on Hypriot (July 2018)
@alexellis
alexellis / k8s-pi.md
Last active March 1, 2026 16:50
K8s on Raspbian
@ololobus
ololobus / create-and-fill-up-table.sql
Last active March 12, 2025 17:35
Create large ~1 GB random dataset in PostgreSQL
CREATE TABLE large_test (num1 bigint, num2 double precision, num3 double precision);
INSERT INTO large_test (num1, num2, num3)
SELECT round(random()*10), random(), random()*142
FROM generate_series(1, 20000000) s(i);
EXPLAIN (analyse, buffers)
SELECT num1, avg(num3) as num3_avg, sum(num2) as num2_sum
FROM large_test
GROUP BY num1;
consul.*.runtime.*
name="consul_runtime"
type="$2"
host="{{ inventory_hostname }}"
consul.runtime.total_gc_pause_ns
name="consul_runtime_total_gc_pause_ns"
type="$2"
host="{{ inventory_hostname }}"

SORACOM Air + Raspberry Pi + L-05Aを使ったインターネット接続の設定.md

wvdial設定

$ sudo apt-get remove --purge usb-modeswitch
$ sudo apt-get install -y eject wvdial dnsutils
$ sudo vi /etc/wvdial.conf

[Dialer Defaults]

@ianblenke
ianblenke / add-xfleet-conflicts.sh
Last active August 29, 2015 14:14
Add an X-Fleet Conflicts to all deis deployed units
#!/bin/bash -e
fleetctl list-units -fields=unit -no-legend | grep -v -e '@\|deis' | cut -d. -f1-2 | sort | uniq | while read name ; do
max=$(fleetctl list-machines -no-legend | wc -l)
count=$(fleetctl list-units -fields=unit -no-legend | grep -e "^$name" | wc -l)
if [ $count -gt $max ]; then
echo "Skipping $name, there are $count deployed units on $max fleet machines"
else
echo "Processing $name"
fleetctl list-units -fields=unit -no-legend | grep -e "^$name" | while read service; do
others=$(echo $service | cut -d. -f1-2)
@sogko
sogko / app.js
Last active February 21, 2025 08:34
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');

コマンド

set policy route PPPOE-IN rule 10 destination address 0.0.0.0/0
set policy route PPPOE-IN rule 10 protocol tcp
set policy route PPPOE-IN rule 10 tcp flags 'SYN,!ACK,!FIN,!RST'
set policy route PPPOE-IN rule 10 set tcp-mss 1414
set interface ethernet eth0 policy route PPPOE-IN

/sbin/iptables -L -n -t mangle

@mclark
mclark / docker time
Last active October 9, 2020 17:00
set docker container time
$ docker run --rm busybox date
Thu Mar 20 04:42:02 UTC 2014
$ docker run --rm -v /etc/localtime:/etc/localtime busybox date
Thu Mar 20 14:42:20 EST 2014
$ FILE=$(mktemp) ; echo $FILE ; echo -e "Europe/Brussels" > $FILE ; docker run --rm -v $FILE:/etc/timezone -v /usr/share/zoneinfo/Europe/Brussels:/etc/localtime busybox date
/tmp/tmp.JwL2A9c50i
Thu Mar 20 05:42:26 CET 2014