Skip to content

Instantly share code, notes, and snippets.

@nathandarnell
nathandarnell / Code.gs
Created October 18, 2020 04:58 — forked from dexterlabora/Code.gs
Google Sheets Scripts with the Meraki Dashboard API
// Settings - Modify this with your values
// *************************
// User Defined in the Script
var API_KEY = '';
var ORG_ID = '';
var NET_ID = '';
var TIMESPAN = '';
// User Defined in a Sheet
@nathandarnell
nathandarnell / polycom-dir-xslt.xsl
Last active June 21, 2018 19:09
Sorts the Polycom directory file and is kept in /usr/local/sbin
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="@*|node()">
<xsl:copy><xsl:apply-templates select="@* | node()"/></xsl:copy>
</xsl:template>
<xsl:template match="item_list">
<xsl:copy>
<xsl:apply-templates select="@*|node()">
<xsl:sort select="ln"/>
</xsl:apply-templates>
@nathandarnell
nathandarnell / polycom-dir-xslt.sh
Last active June 21, 2018 19:29
Sorts the Polycom directory and formats the XML to be prettier. Could be combined with "polycom-dir.sh" but keeping it separate now for testing
#!/bin/bash
# Sorts the Polycom directory file by last name
# That original file is produced by: https://crosstalksolutions.com/freepbx-polycom-directory-automation/
# XSL code taken from: https://stackoverflow.com/questions/28322438/sort-xml-in-alphabetic-order
# XSL file is at: https://gist.github.com/nathandarnell/0c7cac5e628a43b126f96d7c64970cf9#file-polycom-dir-xslt-xsl
# Runs every hour from "nano -w /etc/crontab"
#!/bin/bash
## https://crosstalksolutions.com/freepbx-polycom-directory-automation/
## Runs every hour from "nano -w /etc/crontab"
## http://thyrusgorges.com/post/generate-polycom-xml-directory-using-freepbx/
# Author: Thyrus Gorges
# Date: 2015/03/04
#The MIT License (MIT)
@nathandarnell
nathandarnell / soundboard.cpp
Created November 2, 2017 23:36 — forked from hdo/soundboard.cpp
Arduino Soundboard Project with DFPlayer mini
#include <Arduino.h>
#define BUTTON_COUNT 36
#define KEYPAD_OUTPUT_BEGIN 2
#define KEYPAD_OUTPUT_END 7
#define KEYPAD_INPUT_BEGIN 8
#define KEYPAD_INPUT_END 13
#!/bin/sh
# SetHomepages.sh
# Change Chrome and Safari Homepage
# This script assumes that default preference files for all three browsers have been installed
# with FUT/FEU options in Casper.
# Define homepage
@nathandarnell
nathandarnell / rsa.py
Created January 13, 2017 19:42 — forked from tylerl/rsa.py
RSA Explained in Python
#!/usr/bin/env python
# This example demonstrates RSA public-key cryptography in an
# easy-to-follow manner. It works on integers alone, and uses much smaller numbers
# for the sake of clarity.
#####################################################################
# First we pick our primes. These will determine our keys.
#####################################################################
@nathandarnell
nathandarnell / Proxmox-Backup-to-Google-Drive
Last active July 13, 2024 20:33
A script to backup Proxmox backups to Google Drive and delete any over a certain limit
#All backups go to here automatically:
#/var/lib/vz/dump
#install rclone if uninstalled or update available
#downloads page is http://rclone.org/downloads/
wget http://downloads.rclone.org/rclone-current-linux-amd64.zip
# version on webpage is http://downloads.rclone.org/rclone-v1.33-linux-amd64.zip
# from: http://blog.mattwynne.net/2008/04/26/fetch-and-parse-html-web-page-content-from-bash-wow/
# Download ZIP, keep zip in working folder, check future runs against HTML piped through w3c for newer versions
# from: http://tips.webdesign10.com/scrape-web-pages-gnu-linux-shell:

Capybara

save_and_open_page

Matchers

have_button(locator)
CROSS COMPILING FFMPEG FOR THE RASPBERRY PI
This is how to cross compile ffmpeg with x264 support for the Raspberry Pi on a Debian 6 64bit host.
Build environment
First set up your build environment by installing the build-essential and git packages from the Debian repo and cloning the debian cross compiling toolchain from GitHub:
$ sudo apt-get install build-essential git-core
$ sudo git clone https://github.com/raspberrypi/tools.git /opt/tools