Skip to content

Instantly share code, notes, and snippets.

View m87carlson's full-sized avatar

Mike Carlson m87carlson

View GitHub Profile
@m87carlson
m87carlson / let-it-grow.sh
Created March 8, 2022 23:39
simple script to take a still, over lay datetime, remove original
#!/bin/bash
DATETIME=$(printf "%(%Y-%m-%d_%H%M%S)T")
raspistill -o /data/SecurityPi/HerbsAndSpice/TMP_$DATETIME.jpg
convert -pointsize 36 -fill yellow -draw "text 20,60 \"`date`\"" /data/SecurityPi/HerbsAndSpice/TMP_$DATETIME.jpg /data/SecurityPi/HerbsAndSpice/$DATETIME.jpg
@m87carlson
m87carlson / rey.go
Last active August 14, 2020 18:02
small go program to replace aws credentials
package main
import (
"fmt"
"io/ioutil"
"os"
"regexp"
)
func main() {
@m87carlson
m87carlson / gist:00232d8ac4b98671db50f75b7efa12fe
Last active May 28, 2020 04:44
stream raspicam to vlc across network
raspivid -o - -t 0 -w 1920 -h 1080 -fps 30 | cvlc -vv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8160}' :demux=h264
@m87carlson
m87carlson / fizzbuzz.go
Created April 25, 2020 03:06
fizzbuzz question
package main
import (
"fmt"
)
func main() {
for i := 1; i <= 100; i++ {
if i % 3 == 0 && i % 5 == 0 {
fmt.Println("FIZZBUZZ")
@m87carlson
m87carlson / keybase.md
Created November 23, 2019 19:11
keybase

Keybase proof

I hereby claim:

  • I am m87carlson on github.
  • I am m87carlson (https://keybase.io/m87carlson) on keybase.
  • I have a public key whose fingerprint is 0168 BFC6 59CC 95F5 DAB3 2394 E4C4 C6E3 E67F DD98

To claim this, I am signing this object:

@m87carlson
m87carlson / take-postgres-db-offline.sql
Created March 23, 2016 16:09
Take a postgres database "mydb" offline
update pg_database set datallowconn = false where datname = 'mydb';
@m87carlson
m87carlson / reset-moin-passwd.sh
Created March 22, 2016 18:47
Reset a MoinMoin Wiki Password
#!/bin/sh
moin --config-dir=/data/www/MoinMoin account resetpw --name=${1} changeme
#!/usr/bin/env bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin
usage()
{
cat << EOF
Usage: $0 /zpool/filesystem 90d
This script will send list of files using find and rsync over
N days
find . -name "*.[Jj][Pp][Gg]" -print0 | xargs -I%% -0 -n 1 convert -resize 1024x768 "%%" "tmp/%%"
@m87carlson
m87carlson / create-test-data.sh
Created February 10, 2016 16:49
Create 100,000 files filled with randomness
#!/bin/sh
# create a seed file
mkdir 100k
cd 100k
dd if=/dev/urandom of=seed.dat bs=1024 count=1000
# use split, splits the seed.dat file up in 10 byte increments
split -b 10 -a 10 seed.dat