Skip to content

Instantly share code, notes, and snippets.

@Dianoga
Dianoga / node.service
Created December 13, 2012 15:51
systemd .service file for node.js app. Requires forever.
[Unit]
Description=Start Herir Node.js Service
Requires=network.target
After=network.target
[Service]
Type=forking
WorkingDirectory=/srv/hereir/node
ExecStart=/usr/bin/forever start --pidFile /var/run/hereir.pid HereIR.js
ExecStop=/usr/bin/forever stop HereIR.js
048c76c6c2eb6c5b8dfcfba1e8d9d0e3a6b75a0da7b34721b4b494f741ff37527678f5eaa1e7bc011fbeb6d5c47f1eef58b88e010df3164c4e026598019783c2d4
@Dianoga
Dianoga / nest.devicetype.groovy
Last active September 16, 2018 02:09
Nest Device Type for SmartThings
/**
* Nest Direct
*
* Author: dianoga7@3dgo.net
* Date: 2013-07-18
* Code: https://gist.github.com/Dianoga/6055918
*
* INSTALLATION
* =========================================
* 1) Create a new device type (https://graph.api.smartthings.com/ide/devices)
@Dianoga
Dianoga / ttp-appt.js
Created January 2, 2020 19:06
Trusted Traveler Better Appointment Checker
#!/usr/bin/node
const https = require('https');
const currentAppt = '2020-05-26T09:30'; // Replace with the timestamp of your current appointment
const locationId = 6840; // Replace with the id of the location you want to check
const pushoverApiKey = '<your pushover api key>';
const pushoverUserKey = '<your pushover user key>';
configure
# Configure Firewall
set firewall ipv6-name IPV6WAN_IN description 'IPV6WAN to internal'
set firewall ipv6-name IPV6WAN_IN default-action drop
set firewall ipv6-name IPV6WAN_IN rule 10 action accept
set firewall ipv6-name IPV6WAN_IN rule 10 state established enable
set firewall ipv6-name IPV6WAN_IN rule 10 state related enable
set firewall ipv6-name IPV6WAN_IN rule 10 log disable
/* [General] */
// Transition length in mm
transition_length = 10;
// Number of sections in cylinder (more = more circular)
circle_sections = 360;
// Used for debugging
show_real_part = true;
@Dianoga
Dianoga / mvp.ts
Created July 23, 2021 15:12
node-mv with promises and typescript
import mv from 'mv';
export function mvp(
src: string,
dest: string,
options: mv.Options = {}
): Promise<void> {
return new Promise((resolve, reject) => {
mv(src, dest, options, (error) => {
if (error) reject(error);
#
# fair-queue based settings for EdgeRouter Lite traffic shaping
#
# download is typically 30 and change. everything can burst to 100%
# of bandwidth, priority rules keep the garbage in check
set traffic-policy shaper download
set traffic-policy shaper download bandwidth 60Mbit