Skip to content

Instantly share code, notes, and snippets.

@dlaz
dlaz / speedtest_cron.sh
Last active December 10, 2020 15:29
Scripts to use with cron to run speedtest-cli append the results to a csv, and create graphs
#!/usr/bin/env bash
# Example crontab to run every hour on the hour:
# 0 * * * * /usr/bin/speedtest_cron.sh
out_csv=$HOME/speedtest_results.csv
# If $out_csv doesn't exist or is empty, write the csv headers to it.
[ -s $out_csv ] || speedtest-cli --csv-header > $out_csv
// ==UserScript==
// @name Blur input
// @namespace http://answers.ros.org/
// @version 0.1
// @description Make the search bar not focus on load
// @author Dan Lazewatsky
// @match http://answers.ros.org/question*
// @grant none
// ==/UserScript==
/* jshint -W097 */
@dlaz
dlaz / OGFilter.User.js
Last active October 18, 2015 21:50
Add filter field for OurGroceries
// ==UserScript==
// @name OGFilter
// @namespace http://dan.lazewatsky.com/
// @version 0.2
// @description Add filter field for OurGroceries
// @author Dan Lazewatsky
// @match https://www.ourgroceries.com/*
// @grant none
// ==/UserScript==
@dlaz
dlaz / validate_package_urls.py
Last active August 29, 2015 14:27
Validate URLs in catkin package.xml files
#!/usr/bin/env python
from os import walk
from os.path import join, split
import sys
import xml.etree.ElementTree as ET
import requests
def test_url(url):
return requests.request('GET', url).status_code < 400
@dlaz
dlaz / sm
Created April 2, 2015 21:01
Source the environment for your catkin workspace from anywhere in the workspace
function sm {
install_space=${1:-devel}
dir=$(pwd)
# while [ ! \( -e src -a -L src/CMakeLists.txt \) -a "$(pwd)" != "/" ] ; do
while [ ! \( -e src -a -e src/CMakeLists.txt \) -a "$(pwd)" != "/" ] ; do
cd ..
done
if [ "$(pwd)" = "/" ]; then
echo "Not in catkin workspace" 1>&2
@dlaz
dlaz / pi.rosinstall
Last active August 29, 2015 14:17
rosinstall file for raspberry pi - includes ros_comm, geometry, and image_transport + deps
- git:
local-name: actionlib
uri: https://github.com/ros-gbp/actionlib-release.git
version: release/hydro/actionlib/1.10.3-0
- git:
local-name: angles
uri: https://github.com/ros-gbp/geometry_angles_utils-release.git
version: release/hydro/angles/1.9.9-0
- git:
local-name: camera_info_manager_py
@dlaz
dlaz / mouse_node.py
Created November 5, 2014 16:56
pose to mouse
#!/usr/bin/env python
import rospy
import tf
from tf.transformations import euler_from_quaternion
from geometry_msgs.msg import PoseStamped
from std_msgs.msg import Empty
from pymouse import PyMouse
import numpy as np
initialized = False
@dlaz
dlaz / mouse_node.py
Created June 13, 2014 20:46
Pose to Mouse
#!/usr/bin/env python
import rospy
import tf
from tf.transformations import euler_from_quaternion
from geometry_msgs.msg import PoseStamped
from std_msgs.msg import Empty
from pymouse import PyMouse
import numpy as np
initialized = False
@dlaz
dlaz / python_pointclouds.py
Created April 30, 2014 19:18
deserialize point clouds in python
#!/usr/bin/env python
from sensor_msgs.msg import PointCloud2, PointField
import numpy as np
import struct
fmt_full = ''
_DATATYPES = {}
_DATATYPES[PointField.INT8] = ('b', 1)
_DATATYPES[PointField.UINT8] = ('B', 1)
import java.io.*;
import java.net.*;
import java.nio.*;
class TestUDP {
public static void main(String[] args) {
DatagramSocket client;
String serverName = "192.168.0.165";
int port = 9999;