This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # docker run -runtime=nvidia --rm -ti -v "${PWD}:/app" tensorflow/tensorflow:latest-gpu python /app/test.py gpu 10000 | |
| import sys | |
| import numpy as np | |
| import tensorflow as tf | |
| from datetime import datetime | |
| device_name = sys.argv[1] # Choose device from cmd line. Options: gpu or cpu | |
| shape = (int(sys.argv[2]), int(sys.argv[2])) | |
| if device_name == "gpu": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # setup | |
| sudo tc qdisc add dev $1 root tbf rate 1.0mbit latency 50ms burst 50kb mtu 10000 | |
| # remove | |
| sudo tc qdisc del dev $1 root |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ps -ef | grep <filter-here> | grep -v grep | awk '{print $2}' | xargs kill -9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| LOGIN=<USER> | |
| NEWUID=<NEWUID> | |
| NEWGID=<NEWGID> | |
| OLDUID=<OLDUID> | |
| OLDGID=<OLDGID> | |
| usermod -u $NEWUID $LOGIN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt install virtualbox virtualbox-ext-pack |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TZ=America/Los_Angeles date -d @1524291778 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # plug in grey panda | |
| # open Lefebure NTRIP Client android app | |
| # configure it: | |
| # - Receiver Settings -> External via TCP/IP (enter the IP of the machine running this script and port 3001) | |
| # - Receiver Settings -> GPS Mock Locations (check checkbox) | |
| # - NTRIP Settings -> Caster IP/Port/Username Password for your local RTK network | |
| # - NTRIP Settings -> Data Stream needs to be an RTCM3 source | |
| # go into android developer settings and select the Lefebure NTRIP Client app to use for mock locations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import sys | |
| import time | |
| import struct | |
| from panda import Panda | |
| DEBUG = False | |
| def main(): | |
| logfile = sys.argv[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require('fs'); | |
| const content = fs.readFileSync('./data.csv', 'utf8'); | |
| const messages = content | |
| .split('\n') | |
| .map(line => line.trim()) | |
| .filter(line => line.length > 0 && line !== 'time,addr,bus,data') | |
| .map(line => line.split(',')) | |
| .map(msg => ({ | |
| addr: parseInt(msg[1]), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get -y install python python-setuptools | |
| sudo easy_install pip |