Skip to content

Instantly share code, notes, and snippets.

@crawc
crawc / index.html
Created December 15, 2015 00:34 — forked from arisetyo/index.html
Dynamic Real-time Chart Using Chart.js, Socket.io, and Knockout.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Galenic">
<script src="js/jquery-1.9.1.js"></script>
<script src="js/knockout-2.1.0.js"></script>
<script src="js/Chart.js"></script>
<link rel="stylesheet" href="pure-min.css">
Sails.js
first install sails gloabaly:
sudo npm install -g sails
During development, Sails auto generates all your js, less, image files in the assets folder.
everything in /assets/* will be accesible through: http://localhost:1337/*
Install forever. (Other packages are available for this, but this is what I use)
@crawc
crawc / rpi_unifi.md
Created April 11, 2017 13:36 — forked from kburdett/rpi_unifi.md
Install Ubiquiti's UniFi Controller on a Raspberry Pi

#Compatibility

I currently run Ubiquiti's UniFi Controller on a Raspberry Pi 3B without issue. I have tried with a Raspberry Pi 1B, but the application crashes on startup. I assume it is due to a lack of RAM. Presumably, it would run on a Raspberry Pi 2B as well (same amount of RAM), but I have not tested it on this model. YMMV.

#Instructions

  1. Install Raspbian on a SD card. I tested this with Jessie Lite (headless)

  2. Use raspi-config to expand the filesystem, rename your PI, etc

@crawc
crawc / US Zip Codes from 2013 Government Data
Created September 13, 2017 18:58 — forked from erichurst/US Zip Codes from 2013 Government Data
All US zip codes with their corresponding latitude and longitude coordinates. Comma delimited for your database goodness. Source: http://www.census.gov/geo/maps-data/data/gazetteer.html
This file has been truncated, but you can view the full file.
ZIP,LAT,LNG
00601,18.180555, -66.749961
00602,18.361945, -67.175597
00603,18.455183, -67.119887
00606,18.158345, -66.932911
00610,18.295366, -67.125135
00612,18.402253, -66.711397
00616,18.420412, -66.671979
00617,18.445147, -66.559696
@crawc
crawc / gist:c78616db322541f13370008cb3b6c01e
Created May 17, 2018 13:45 — forked from mattm7n/gist:1405067
Monitor DHCP traffic with tcpdump
# Monitoring on interface eth0
tcpdump -i eth0 -n port 67 and port 68
@crawc
crawc / iptv-to-hls.sh
Created September 10, 2018 23:50 — forked from drzax/iptv-to-hls.sh
IPTV to HTTP live streaming
#!/bin/bash
while true; do
currTime=`date +%Y%m%d%H%M`
if [ "$currTime" -ge 201507081658 -a "$currTime" -le 201507082300 ]; then
echo "$currTime: Stream should be on. Start ffmpeg if the process does not exist"
if [ "$(pidof ffmpeg)" ]; then
echo "$currTime: ffmpeg already running."
sleep 10
else
@crawc
crawc / README.md
Created October 3, 2018 01:40 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@crawc
crawc / nginx.conf
Created October 3, 2018 01:41
Nginx transcode example using ffmpeg and two applications
#user nobody;
worker_processes 1;
error_log logs/rtmp_error.log debug;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
@crawc
crawc / nginx-unificontroller.conf
Created November 20, 2018 20:28 — forked from vidia/nginx-unificontroller.conf
Example, working, NGINX config for proxying to Unifi Controller software and using letsencrypt. Includes websocket fix.
# I had a bit of trouble getting my unifi controller (hosted offsite) to use a proxy/letsencrypt. So here are the fruits of my labor.
# The unifi default port is 8443 running on localhost.
# License: CC0 (Public Domain)
server {
# SSL configuration
#
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
@crawc
crawc / genieacs-install.sh
Created February 9, 2019 18:55 — forked from si458/genieacs-install.sh
Install GenieACS on Ubuntu 16.04
#!/bin/sh
set -e
# install all updates/upgrades to begin with
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
# install essential packages
sudo apt-get install -y build-essential git curl software-properties-common python-software-properties zlib1g-dev tmux libsqlite3-dev
# install nodejs
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -