Skip to content

Instantly share code, notes, and snippets.

@nathandarnell
nathandarnell / Code.gs
Created Oct 18, 2020 — forked from dexterlabora/Code.gs
Google Sheets Scripts with the Meraki Dashboard API
View Code.gs
// 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 Jun 21, 2018
Sorts the Polycom directory file and is kept in /usr/local/sbin
View polycom-dir-xslt.xsl
<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 Jun 21, 2018
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
View polycom-dir-xslt.sh
#!/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"
View polycom-dir.sh
#!/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 Nov 2, 2017 — forked from hdo/soundboard.cpp
Arduino Soundboard Project with DFPlayer mini
View soundboard.cpp
#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
View SetChromeSafariHomepage.sh
#!/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 Jan 13, 2017 — forked from tylerl/rsa.py
RSA Explained in Python
View rsa.py
#!/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 Feb 20, 2022
A script to backup Proxmox backups to Google Drive and delete any over a certain limit
View Proxmox-Backup-to-Google-Drive
#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:
View capybara.md

Capybara

save_and_open_page

Matchers

have_button(locator)
View ffmpeg
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