Skip to content

Instantly share code, notes, and snippets.

View peelman's full-sized avatar

Nick Peelman peelman

View GitHub Profile
@peelman
peelman / how-to-restore.md
Created March 16, 2022 18:23 — forked from AmazingTurtle/how-to-restore.md
restore access to unifi controller

Restore access to a unifi controller

When you are unable to login to the unifi controller or forgot admin password, you can restore access using SSH and manipulating mongodb directly.

Warning

Do not uninstall unifi controller - most of the data is not stored in mongodb. In case you thought a mongodb backup would be sufficient, you may have fucked up already, just like me. However I managed to write this "tutorial" for anyone to not run into the same trap.

Steps

@peelman
peelman / puppetlabs.pp
Created July 12, 2016 12:16 — forked from garthk/puppetlabs.pp
Use Puppet to ensure Ubuntu can get the latest Puppet
class puppetlabs {
# Install Puppet repository and call apt-get update
case $operatingsystem {
ubuntu: {
$key = "4BD6EC30"
exec { 'apt-key puppetlabs':
path => "/bin:/usr/bin",
unless => "apt-key list | grep '${key}' | grep -v expired",
command => "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ${key}",
}
@peelman
peelman / DashingUnifiVideo.md
Last active January 20, 2016 11:50 — forked from tracstarr/DashingUnifiVideo.md
Dashing UnifiVideo Widget

Dashing.io Widget for UnifiVideo NVR

This method uses API Key access so I suggest you setup a guest account with API access but limited (Visible and View Feed) access. Then login as the guest user, enable API access, and generate a new key. Copy the key for use.

Switch to the Devices tab and open the Configure dialog for the cam. On the Details tab, right-click the thumbnail view and Copy the image URL to the clipboard. It will look similar to the following if pasted to an address bar or text editor: http://192.168.1.105:7443//api/2.0/snapshot/camera/05a2bc63-d1ce-399f-8327-3a19b0cd3e8f?width=%d&force=true

The guid after /camera/ is what you want to use in the unifivideo.rb file.

You can setup as many cameras as you want, just add a name and UUID for each to the secrets/unifi.yml file.

@peelman
peelman / README.md
Last active November 11, 2015 21:11 — forked from bitflingr/README.md
Dashing widget for puppetdb

##Description Simple Dashing widget (and associated job) to display general puppetdb status. Pulled the API calls from Puppetboard.

WARNING: This only works if puppetdb is listening on HTTP. I have not gotten around to getting this to work with SSL client certificates yet. If you know how, please leave them at the comments below.

##Screenshot

##Dependencies None

@peelman
peelman / README.md
Created November 4, 2015 17:59 — forked from roelentless/README.md
Countdown widget for Dashing

Description

Simple Dashing widget to countdown until a certain moment. Flashes the widget when finished.

##Usage

To use this widget, copy countdown.html, countdown.coffee, and countdown.scss into the /widgets/countdown directory.

To include the widget in a dashboard, add the following snippet to the dashboard layout file:

@peelman
peelman / ping.rb
Created October 30, 2015 20:59 — forked from DiogoAndre/ping.rb
Simple ICMP Ping script in Ruby. Using the Net-Ping gem https://github.com/djberg96/net-ping
require 'net/ping'
@icmp = Net::Ping::ICMP.new('142.40.81.34')
rtary = []
pingfails = 0
repeat = 5
puts 'starting to ping'
(1..repeat).each do
if @icmp.ping
#!/usr/bin/perl
#
# Update the path to your lease file below
use strict;
use File::Copy;
#use DateTime;
#always parse a copy not the live file
#my $leasefile = '/var/lib/dhcpd/dhcpd.leases';
my $leasefile = '/var/lib/dhcp/db/dhcpd.leases';
@peelman
peelman / index.html
Last active October 31, 2015 15:52 — forked from dgs700/index.html
<!doctype html>
<html lang=en>
<head>
<meta charset="utf-8" />
<meta name="verify-v1" content="91yIG+EaOdwKuPX+R9ChHEWVXJ6wdQsq0gqD1c1sbaY="/>
<title>David Shapiro, Resume- Web Developer</title>
<style type="text/css">
body{font-family:Geneva, Arial, Helvetica, sans-serif;font-size:12px;font-weight:normal;color:#000000;text-align:center;margin:0;padding:0;line-height:1.5em;}
header, section, article{display:block;}
header{text-align:center;position:relative;z-index:1;}
#!/bin/bash
#
# transcode-video.sh
#
# Copyright (c) 2013-2014 Don Melton
#
about() {
cat <<EOF
$program 4.0 of October 23, 2014
#!/bin/bash
#
# transcode-video.sh
#
# Copyright (c) 2013-2014 Don Melton
#
about() {
cat <<EOF
$program 4.0 of October 23, 2014