Skip to content

Instantly share code, notes, and snippets.

AlejandroF cdgraff

Block or report user

Report or block cdgraff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cdgraff
cdgraff / icecast2-bq-table-schema
Last active May 15, 2019
BigQuery + Icecast2 logs
View icecast2-bq-table-schema
[ { "type": "TIMESTAMP", "name": "time" },
{ "type": "STRING", "name": "host" },
{ "type": "STRING", "name": "user" },
{ "type": "STRING", "name": "method" },
{ "type": "STRING", "name": "path" },
{ "type": "STRING", "name": "code" },
{ "type": "INTEGER", "name": "size" },
{ "type": "STRING", "name": "referer" },
{ "type": "STRING", "name": "agent" },
{ "type": "STRING", "name": "duration" } ]
View gist:0db25a2780374d4aa8e9fa57783fee49
root@raspberrypi3-e78c6d9:/data# SoapySDRUtil --probe
######################################################
## Soapy SDR -- the SDR abstraction library ##
######################################################
Probe device
usb_claim_interface error -6
Found Rafael Micro R820T tuner
Detached kernel driver
Found Rafael Micro R820T tuner
View gist:52e414fb3254910b47e9cdc8bc0d5f78
#!/usr/bin/env python
"""
Produces load on all available CPU cores
"""
from multiprocessing import Pool
from multiprocessing import cpu_count
def f(x):
while True:
x*x
View gist:c1ab87cecd2f7f52dac053fa2b1d82cc
const {Storage} = require('@google-cloud/storage');
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const ffmpeg = require('fluent-ffmpeg');
var bucket = 'test-demo-transcode';
ffmpeg.setFfmpegPath(ffmpegPath);
exports.transcodeVideo = (data, context) => {
const file = data;
@cdgraff
cdgraff / asound.state
Created Jun 23, 2018
/var/lib/alsa/asound.state
View asound.state
state.audioinjectorpi {
control.1 {
iface MIXER
name 'Master Playback Volume'
value.0 121
value.1 121
comment {
access 'read write'
type INTEGER
count 2
View Crosstool NG 1.23, Raspberry PI3
$ git clone -b 1.23 https://github.com/crosstool-ng/crosstool-ng.git
$ cd crosstool-ng
$ ./bootstrap
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
$ cd ..
$ mkdir ctng
$ ct-ng menuconfig
@cdgraff
cdgraff / gist:654d839f455e8f838c997fce2eb60cc7
Created Mar 8, 2018 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
View gist:654d839f455e8f838c997fce2eb60cc7
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
View rtl_fm options
rtl_fm, a simple narrow band FM demodulator for RTL2832 based DVB-T receivers
Use: rtl_fm -f freq [-options] [filename]
-f frequency_to_tune_to [Hz]
use multiple -f for scanning (requires squelch)
ranges supported, -f 118M:137M:25k
[-M modulation (default: fm)]
fm, wbfm, raw, am, usb, lsb
wbfm == -M fm -s 170k -o 4 -A fast -r 32k -l 0 -E deemp
raw mode outputs 2x16 bit IQ pairs
View gist:57c16a9d04341900044ce2fe913e782d
kubectl get po -a --all-namespaces -o json | jq '.items[] | select(.status.reason!=null) | select(.status.reason | contains("Evicted")) | "kubectl delete po \(.metadata.name) -n \(.metadata.namespace)"' | xargs -n 1 bash -c
View gist:9e83bfae73e3db7351ce660be09e2d2a
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
You can’t perform that action at this time.