Skip to content

Instantly share code, notes, and snippets.

View williamshen-nz's full-sized avatar
🤖
AI/ML/Robotics Research

William Shen williamshen-nz

🤖
AI/ML/Robotics Research
View GitHub Profile
[
{
"panda_joint1": -0.07755724817390137,
"panda_joint2": 1.537605810126505,
"panda_joint3": 2.1164561266342385,
"panda_joint4": -2.1883537067146728,
"panda_joint5": -1.217370993925899,
"panda_joint6": 1.1961867272863265,
"panda_joint7": -2.0828194296420635
},
[[-1.0374797041694672, 1.2599013502160639, 1.8446745356275016, -1.0035036660485197, -0.9220189431269672, 0.861248139181024, -1.2563435429410557, 0.04, 0.04], (-1.0374797041694672, 1.2599013502160639, 1.8446745356275016, -1.0035036660485197, -0.9220189431269672, 0.861248139181024, -1.2563435429410557, 0.04, 0.04), (-1.0139451342891284, 1.2512943313823848, 1.8253501168145028, -0.9778212306647002, -0.9216877597721709, 0.8559955183182034, -1.2820553809858164, 0.04, 0.04), (-0.9904105644087895, 1.2426873125487057, 1.806025698001504, -0.9521387952808806, -0.9213565764173746, 0.8507428974553828, -1.3077672190305771, 0.04, 0.04), (-0.9668759945284506, 1.2340802937150266, 1.786701279188505, -0.9264563598970611, -0.9210253930625782, 0.8454902765925623, -1.3334790570753379, 0.04, 0.04), (-0.9433414246481118, 1.2254732748813473, 1.7673768603755062, -0.9007739245132416, -0.9206942097077819, 0.8402376557297416, -1.3591908951200984, 0.04, 0.04), (-0.9198068547677729, 1.216866256047668, 1.7480524415625074, -0.875091489129422
[-1.7215931632687036, -1.585715215050266, 1.4691875546658801, -2.928693424258104, 1.4746053600896651, 1.5347767889346393, 1.3969238184695327]
[-1.4910691317029763, 0.9231752016062879, 1.0694197568218138, -1.496525409803306, -0.8374731724251556, 1.915048269101921, -1.1228672541461093]
[-0.29890073216901847, -1.6492679699210204, -2.120648808286869, -2.645938772664007, 0.30046316355695524, 2.8997516383184205, 1.513207842249765]
@williamshen-nz
williamshen-nz / spot_interrupt.py
Created October 1, 2019 07:38
Spot Instance Interrupt upload to S3
import os
import time
import boto3
import requests
import subprocess
from datetime import datetime
POLL_URL = "http://169.254.169.254/latest/meta-data/spot/instance-action"
S3_ID = ""
// ==UserScript==
// @name Clean up Wattle
// @namespace https://shen.nz
// @version 0.1
// @description Remove the huge banner image, search bar and course image previews from Wattle
// @author William Shen
// @match https://wattlecourses.anu.edu.au/my/*
// @grant none
// ==/UserScript==
@williamshen-nz
williamshen-nz / spot.py
Created October 21, 2018 06:57
Simple Script that checks if an EC2 Spot Instance is going to terminate
"""
Run on crontab every minute or something
"""
import os
import requests
url = 'http://169.254.169.254/latest/meta-data/spot/termination-time'
r = requests.get(url)
@williamshen-nz
williamshen-nz / reprint.py
Created January 26, 2018 07:42
Reprinting PDFs using Ghostscript
import locale
import os
import subprocess
import sys
# Ask for OS and directory path
operating_system = input('Specify OS. Mac OS/Unix (0), Windows (1): ')
assert(operating_system == '0' or operating_system == '1')
input_path = input('Specify input directory: ')
assert(os.path.isdir(input_path))
@williamshen-nz
williamshen-nz / scraper.py
Created June 29, 2017 08:29
Formula-E Scraper
import urllib.request
import os
from bar import ProgressBar
from bs4 import BeautifulSoup
from pathlib import Path
FE_ROOT = 'http://fiaformulae.alkamelsystems.com/'
files_path = [f for f in os.listdir('.') if os.path.isfile(f)]