Skip to content

Instantly share code, notes, and snippets.

View starbuck93's full-sized avatar
:bowtie:

Adam Starbuck starbuck93

:bowtie:
View GitHub Profile
@starbuck93
starbuck93 / gist:2c9ad8f6a6d0a57f1164352c80ab0531
Last active September 14, 2020 18:05 — forked from maccath/gist:3981205
Split PDF to individual pages using FPDI and FPDF while keeping the original PDF's size
<?php
/**
* Split PDF file
*
* <p>Split all of the pages from a larger PDF files into
* single-page PDF files.</p>
*
* @package FPDF required http://www.fpdf.org/
* @package FPDI required http://www.setasign.de/products/pdf-php-solutions/fpdi/
#!/bin/bash
# GUI-related packages
#pkgs="
#xserver-xorg-video-fbdev
#xserver-xorg xinit
#gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base
#gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa
#gstreamer1.0-libav
#epiphany-browser
@starbuck93
starbuck93 / pihut_pi_zero_in_stock.js
Created March 1, 2016 21:38 — forked from MxAshUp/pihut_pi_zero_in_stock.js
Checks for Pi Zero availability on Adafruit, Pimoroni, and Pi Hut, sends alerts to Pushbullet
var requestjson = require('request-json');
var request = require('request');
var PushBullet = require('pushbullet');
var pusher = new PushBullet('PUSHBULLET_API_KEY');
var cheerio = require('cheerio');
var stores = [
{name:"The Pi Hut",url:'http://thepihut.com/products/raspberry-pi-zero',in_stock:check_pihut_inventory
},
{name:"Adafruit",url:'https://www.adafruit.com/products/2816',in_stock:check_adafruit_inventory
#!/bin/bash
DISKAVAILABLE=$(df / | awk '{ a = $3 } END { print a }');
DISKUSED=$(df / | awk '{ a = $2 } END { print a }');
DISKTOTAL=$((DISKAVAILABLE+DISKUSED));
DISKPERCENTUSED=$(df / | awk '{ a = $5 } END { print a }');
MEMUSE=$(free -m | head -n 2 | tail -n 1 | awk {'print $3'});
MEMTOTAL=$(free -m | head -n 2 | tail -n 1 | awk {'print $2'});
SWAPUSE=$(free -m | head -n 3 | tail -n 1 | awk {'print $3'});
SWAPTOTAL=$(free -m | head -n 3 | tail -n 1 | awk {'print $2'});
# TODO - Execute curl command once per day via cron, cat file here