Skip to content

Instantly share code, notes, and snippets.

View Peetz0r's full-sized avatar

Peter Peetz0r

  • not far from RevSpace
View GitHub Profile
@Peetz0r
Peetz0r / sox2multimon-ng
Created August 19, 2013 13:25
A bash script which connects Gqrx trough a fifo and sox to multimon-ng
#!/bin/bash
# first patch gqrx
# edit qtgui/dockaudio.cpp
# change:
# lastAudio = QDateTime::currentDateTime().toUTC().toString("gqrx-yyyyMMdd-hhmmss.'wav'");
# into:
# lastAudio = QString("/tmp/gqrx");
fifo_path='/tmp/gqrx'
<html>
<body>
<?xml version='1.0' encoding='utf-8'?>
<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" id="chart-7e441dbb-c58f-4c68-8863-a5bd7ec778d8" class="pygal-chart" viewBox="0 0 800 600"><!--Generated with pygal 1.4.6 ©Kozea 2011-2014 on 2014-07-27--><!--http://pygal.org--><!--http://github.com/Kozea/pygal--><defs><style type="text/css">#chart-7e441dbb-c58f-4c68-8863-a5bd7ec778d8 .title{font-family:monospace;font-size:16px}#chart-7e441dbb-c58f-4c68-8863-a5bd7ec778d8 .legends .legend text{font-family:monospace;font-size:14px}#chart-7e441dbb-c58f-4c68-8863-a5bd7ec778d8 .axis text{font-family:monospace;font-size:10px}#chart-7e441dbb-c58f-4c68-8863-a5bd7ec778d8 .axis text.major{font-family:monospace;font-size:10px}#chart-7e441dbb-c58f-4c68-8863-a5bd7ec778d8 .series text{font-family:monospace;font-size:8px}#chart-7e441dbb-c58f-4c68-8863-a5bd7ec778d8 .tooltip text{font-family:monospace;font-size:16px}#chart-7e441dbb-c58f-4c68-8863-a5bd7ec778d8 text.no_data{font-size:64px}
#c
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Peetz0r
Peetz0r / mobile-data-usage.py
Created July 27, 2014 20:11
Ben mobile data usage parser and grapher
#!/usr/bin/env python2
from __future__ import print_function
from pdfminer.converter import TextConverter
from pdfminer.layout import LAParams
from pdfminer.pdfinterp import PDFResourceManager, process_pdf
from calendar import monthrange
import StringIO, re, glob, os, pygal, locale, datetime, sys
locale.setlocale(locale.LC_ALL, '')
@Peetz0r
Peetz0r / gist:91f484a97cc1128d7250
Created January 13, 2015 14:55
Ben facturen (pdf) to html+svg data usage graphs
#!/usr/bin/env python2
from __future__ import print_function
from pdfminer.converter import TextConverter
from pdfminer.layout import LAParams
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from calendar import monthrange
import StringIO, re, glob, os, pygal, locale, datetime, sys
#!/bin/bash
# http://alexpb.com/notes/articles/2014/01/01/xbmc-how-to-remotely-start-media-file-from-command-line/
## XBMC: Remotely Start Playing a Media File From the Command Line Using the JSON API
## Configure your XBMC RPC details here
XBMC_HOST=192.168.1.10
XBMC_PORT=8080
XBMC_USER=xbmc
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
SECRET='XXXXXXXXXXXXXXXX'
(
echo 100;
while true; do
echo -e '#Token: '$(oathtool --totp -b $SECRET)'\n'$(echo '3.3*('$(date +%s.%N)'%30)' | bc);
sleep .1;
done;
@Peetz0r
Peetz0r / zon.ino
Created May 12, 2017 13:09
code op zonnepaneel
#define PIN_BT_PWR 2
#define PIN_SOLAR_CURRENT A7
#define PIN_SOLAR_VOLTAGE A1
#define PIN_BUTTON 3
uint32_t calibratedZero = 0;
bool firstrun = true;
void setup() {
pinMode(PIN_BT_PWR, OUTPUT);
echo [$(echo $(df -h --output=avail / /home | tail -n+2))]
echo ---
echo "$(df -h / /home | awk 1 ORS='\\n') | font=monospace"