Skip to content

Instantly share code, notes, and snippets.

@NickNothom
NickNothom / network_failover.sh
Last active November 5, 2022 19:03
Network Failover
#!/bin/bash
# Set defaults if not provided by environment
CHECK_DELAY=${CHECK_DELAY:-5}
CHECK_IP=${CHECK_IP:-8.8.8.8}
PRIMARY_IF=${PRIMARY_IF:-eth0}
PRIMARY_GW=${PRIMARY_GW:-10.0.0.1}
BACKUP_IF=${BACKUP_IF:-eth0}
BACKUP_GW=${BACKUP_GW:-10.0.0.6}
@NickNothom
NickNothom / s500_enumerator.py
Created September 30, 2020 05:42
S500 Enumerator
#!/usr/bin/env python -u
"""Scan serial ports for ping devices
Symlinks to detected devices are created under /dev/serial/ping/
This script needs root permission to create the symlinks
"""
from __future__ import print_function
import subprocess
from brping import PingDevice
from brping.definitions import *
@NickNothom
NickNothom / gist:d1ae6dd28dd00c7940d675f9a16359a7
Created November 6, 2019 00:33
Ping360 Stops Responding
[16:16:39:519] ping.protocol.pingsensor[Debug]: Handling Message: 2300
[16:16:39:519] ping.protocol.ping360[Debug]: Handling Message: 2300
[16:16:39:644] ping.protocol.pingsensor[Debug]: Handling Message: 2300
[16:16:39:644] ping.protocol.ping360[Debug]: Handling Message: 2300
[16:16:39:670] ping.protocol.pingsensor[Debug]: Handling Message: 2300
[16:16:39:670] ping.protocol.ping360[Debug]: Handling Message: 2300
[16:16:39:707] ping.protocol.pingsensor[Debug]: Handling Message: 2300
[16:16:39:707] ping.protocol.ping360[Debug]: Handling Message: 2300
[16:16:39:810] ping.protocol.pingsensor[Debug]: Handling Message: 2300
[16:16:39:810] ping.protocol.ping360[Debug]: Handling Message: 2300
@NickNothom
NickNothom / gist:c914d5cfb62eec1751d2b4b96ac475ee
Created November 6, 2019 00:32
Ping360 Stops Responding
This file has been truncated, but you can view the full file.
[16:08:30:986] ping.settingsmanager[Debug]: "Load darkTheme with:" true
[16:08:30:987] ping.settingsmanager[Debug]: "Load debugMode with:" false
[16:08:31:025] ping.settingsmanager[Debug]: "Load replayMenu with:" true
[16:08:31:026] ping.settingsmanager[Debug]: "Load enabledCategories with:" 1
[16:08:31:026] ping.settingsmanager[Debug]: "Load enabledCategories with:" 1
[16:08:31:026] ping.settingsmanager[Debug]: "Load logScrollLock with:" true
[16:08:31:026] ping.settingsmanager[Debug]: "Load logScrollLock with:" true
[16:08:31:033] ping.settingsmanager[Debug]: "Load debugMode with:" false
[16:08:31:033] ping.settingsmanager[Debug]: "Load debugMode with:" false
[16:08:31:033] ping.settingsmanager[Debug]: "Load debugMode with:" false
@NickNothom
NickNothom / gist:16f4afa59c70436b18de76c30e2806cc
Created November 6, 2019 00:32
Ping360 Stops Responding
This file has been truncated, but you can view the full file.
[16:08:30:986] ping.settingsmanager[Debug]: "Load darkTheme with:" true
[16:08:30:987] ping.settingsmanager[Debug]: "Load debugMode with:" false
[16:08:31:025] ping.settingsmanager[Debug]: "Load replayMenu with:" true
[16:08:31:026] ping.settingsmanager[Debug]: "Load enabledCategories with:" 1
[16:08:31:026] ping.settingsmanager[Debug]: "Load enabledCategories with:" 1
[16:08:31:026] ping.settingsmanager[Debug]: "Load logScrollLock with:" true
[16:08:31:026] ping.settingsmanager[Debug]: "Load logScrollLock with:" true
[16:08:31:033] ping.settingsmanager[Debug]: "Load debugMode with:" false
[16:08:31:033] ping.settingsmanager[Debug]: "Load debugMode with:" false
[16:08:31:033] ping.settingsmanager[Debug]: "Load debugMode with:" false
@NickNothom
NickNothom / ping1d-simple-hardware-serial.ino
Last active September 20, 2019 03:20
Blue Robotics Ping Arduino Hardware Serial Example
/**
This example is targeted toward the arduino platform
This example demonstrates the most simple usage of the Blue Robotics
Ping1D c++ API in order to obtain distance and confidence reports from
the device.
This API exposes the full functionality of the Ping1D Echosounder
Communication is performed with a Blue Robotics Ping1D Echosounder
@NickNothom
NickNothom / BlueROV_Chromebook_Setup.sh
Created August 7, 2018 21:10
BlueROV Chromebook Setup
#!/bin/sh
############################################
# BlueROV2 Chromebook Setup Script [Beta]
# Author: Nick Nothom
# Date: 20180807
############################################
#Modify necessary settings
sudo usermod -a -G dialout $USER
@NickNothom
NickNothom / .bash_aliases
Created October 20, 2017 02:05
Autossh Server
#AutoSSH Ports
CORAPORT="2222"
MICRAPORT="2223"
ONYXPORT="2224"
YORKPORT="2225"
ZEROPORT="2226"
PUSHBOXPORT="2227"
#AutoSSH Aliases
alias CORA="ssh -p $CORAPORT nick@127.0.0.1"
@NickNothom
NickNothom / autossh
Created October 20, 2017 01:54
Autossh Client
#!/usr/bin/env bash
#Enter your username and host here
SERVERUSER=""
SERVER=""
screen -dm -S 'autossh' bash -c 'autossh -M 65520 -o ServerAliveInterval=20 -R 2220:localhost:22 $SERVERUSER@$SERVER'
@NickNothom
NickNothom / designer.html
Last active August 29, 2015 14:28
designer
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-item/paper-item.html">
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;