Skip to content

Instantly share code, notes, and snippets.

View audstanley's full-sized avatar
📡
Send me a message on aprs: KM6LZF

Richard Stanley audstanley

📡
Send me a message on aprs: KM6LZF
View GitHub Profile
var bcrypt = require('bcrypt');
const saltRounds = 10;
const myPlaintextPassword = 'thisisplaintext';
bcrypt.genSalt(saltRounds, function(err, salt) {
bcrypt.hash(myPlaintextPassword, salt, function(err, hash) {
console.log(hash);
})
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
# you will need the library "requests"
#LINUX command: sudo pip install requests
#PC command: pip install requests
import requests
# This is the ip of the Nvidia if you are making the request while attached to the VPN
ipOfNvidia = "10.8.0.88:4080"
# First request to make a records update
payload = {"body":[{"topic": "record", "action":"write", "recordName": "junk/testData", "data": {"lat": 33.000, "lon": -117.000}}]}
request = requests.post('http://' + ipOfNvidia, json=payload)
import requests
import plotly.plotly as py
from time import sleep
from plotly.graph_objs import *
from datetime import datetime
global ipOfNvidia
ipOfNvidia = "http://10.8.0.2:4080"
payload = {
"body":[
#!/bin/sh
# Prepare to build the FTDI module the NVIDIA Jetson TX2
if [ $(id -u) != 0 ]; then
echo "This script requires root permissions"
echo "$ sudo "$0""
exit
fi
# Go to the kernel sources
cd /usr/src/linux-headers-$(uname -r)
# Get the kernel configuration file
from time import sleep
from threading import Thread
from deepstream import get, post
'''
This is example code of how can can switch threads of
processes running in neverending while loops, This will
ensure that our code always runs on startup, and uses deepstream
as a tool to switch our rovers processes.
'''
import numpy as np
from time import time
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
from collections import defaultdict
@audstanley
audstanley / cleanUpXmlPaths.py
Created February 17, 2018 03:02
This cleans up the xml paths that will be a problem for when we are annotating on different computers
import os, re
regex = r"<filename>([A-Za-z0-9()+-_ ]+)<\/filename>"
regex2 = r"<path>([A-Za-z0-9()+-_ /]+)<\/path>"
for file in os.listdir("./"):
if file.endswith(".xml"):
with open(file, 'r') as f:
content = f.readlines()
listOfLines = []
replace = ""
for l in content:
@audstanley
audstanley / renameImages.py
Created February 17, 2018 20:46
Rename images for object Detection
from glob import glob
from os import rename
prefix = "tball"
count = 0
for f in glob("*.jpg"):
# remove .jpg at the end of the filename
newFname = prefix + "_" + str(count).zfill(5) + ".jpg"
print(newFname)
rename(f, newFname)
count += 1
#!/usr/bin/python
'''
Richard Stanley
TitanRover 2017
audstanley@gmail.com
'''
import requests
import os
import sys
import json