Skip to content

Instantly share code, notes, and snippets.

@silverjam
silverjam / main.cpp
Created July 15, 2020 06:04
Arduino remote hack using esp8266 (NodeMCU) and some relays
#include <Arduino.h>
#include <ESP8266WiFi.h>
char ssid[] = "An Wi-Fi";
char pass[] = "xxx";
int status = WL_IDLE_STATUS;
#define BUTTON1_ON_PIN D1
#define BUTTON1_OFF_PIN D2
import sys
import gnss
import sbp
from typing import Union
from sbp.client import Handler, Framer
from sbp.client.drivers.file_driver import FileDriver
use std::boxed::Box;
use std::error::Error;
use std::fs::File;
use std::io::BufReader;
use std::io::ErrorKind;
use std::result::Result;
use sbp::messages::SBP;
use sbp::messages;
[package]
name = "sbptest"
version = "0.1.0"
authors = ["Jason Mobarak <jason@swiftnav.com>"]
edition = "2018"
[dependencies]
sbp = { git = "https://github.com/swift-nav/libsbp", branch = "master" }
@silverjam
silverjam / jira.py
Created February 6, 2020 16:23
JIRA scripting with Python
from jira import JIRA
server = "https://swift-nav.atlassian.net"
api_key = open('jira_api_key.txt').read()
# print(api_key)
basic_auth = ('jason@swift-nav.com', api_key)
# Query string for the cloned issues:
query_str = 'project = INFRA AND issuekey >= INFRA-77 AND issuekey <= INFRA-83 AND creator = currentUser()'
@silverjam
silverjam / cli.dhall
Created September 20, 2019 18:21
Generating lots of YAML with Dhall (recursive incoation translation)
let Argument : Type =
List
{ mapKey : Text
, mapValue :
{ help : Text
, index : Integer
, required : Bool
, takes_value : Bool
, value_name : Text
}
@silverjam
silverjam / socat.bash
Last active April 12, 2019 07:12
socat experiments
# Create input FIFO
rm -f /tmp/input.fifo
mkfifo /tmp/input.fifo
# Bind to FD in the shell to keep the FIFO alive
exec 10<>/tmp/input.fifo
# Create output FIFO
rm -f /tmp/output.fifo
mkfifo /tmp/output.fifo
# Bind to FD in the shell to keep the FIFO alive
# Usage: python dist_to_ntrip_caster.py
#
# Get list of NTRIP caster streams:
# > curl https://cddis-caster.gsfc.nasa.gov/ -o caster_reg.txt
#
# Find streams that support GPS + base station messages:
# > grep 1004.*100[56] caster_reg.txt >creg_gps.txt
#
# Find streams that support GLO + base station messages:
# > grep 100[56].*1012 caster_reg.txt >creg_glo.txt
Add-Type -TypeDefinition @"
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.ComponentModel;
public static class Kernel32c
{
[DllImport("kernel32", SetLastError=true, CharSet = CharSet.Ansi)]
@silverjam
silverjam / intents.json
Created August 10, 2016 18:12
Alexa Lambda Arduino
{
"intents": [
{
"intent": "YourDino"
},
{
"intent": "HasTeradactyl"
}
]
}