Skip to content

Instantly share code, notes, and snippets.

@jackm
jackm / can-packages-and-tools.md
Last active Sep 29, 2022
Collection of CAN bus packages and tools
View can-packages-and-tools.md

Collection of CAN bus packages and tools

This document assumes the use of Linux as the chosen development platform. Items in bold are highly recommended.

It is recommended to use SocketCAN when working with CAN bus on Linux. It is supported by the Linux kernel mainline and follows the Linux interface model, allowing you to use other network tools such as Wireshark. This also allows the creation of virtual CAN interfaces where no physical hardware is required to simulate or replay CAN messages.

@jackm
jackm / vpn.sh
Last active Sep 16, 2018
Wrapper script for managing connection to a VPN server using openconnect
View vpn.sh
#!/bin/bash
# Connect to a VPN server using openconnect
prog_name=$(basename $0)
pid_file="/var/run/openconnect"
default_server="https://vpn.example.com/"
help () {
echo "Usage: $prog_name [-c server] [-d]"
@jackm
jackm / unit4_interface.user.js
Last active Nov 13, 2018
Greasemonkey/Tampermonkey userscript for various interface improvements to Unit4
View unit4_interface.user.js
// ==UserScript==
// @name Unit4 interface improvements
// @namespace https://ubw.unit4cloud.com
// @version 0.3
// @description Make the Unit4 interface more user friendly and less painful to enter information
// @match https://ubw.unit4cloud.com/*
// @grant none
// ==/UserScript==
(function() {
@jackm
jackm / Disable auto scrolling.js
Created Jul 19, 2017
Disable auto scrolling userscript
View Disable auto scrolling.js
// ==UserScript==
// @name Disable auto scrolling
// @version 1.0
// @description Disables auto scrolling on pages (ie. middle mouse scrolling)
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
@jackm
jackm / kijiji_repost_ad_simple.user.js
Last active Jul 31, 2017
Greasemonkey/Tampermonkey script for simple ad re-posting on Kijiji.ca
View kijiji_repost_ad_simple.user.js
// ==UserScript==
// @name Kijiji Repost Ad Simple
// @namespace KijijiScripts
// @version 0.3.1
// @description Allows for easy and free ad reposting on Kijiji when managing your ads. A new link named "Repost Ad" will appear in the ad manage widget as well as on the My Kijiji page for each ad.
// @match http://www.kijiji.ca/v-view-details.html?*
// @match https://www.kijiji.ca/v-view-details.html?*
// @match https://www.kijiji.ca/m-my-ads.html*
// @grant none
// ==/UserScript==
@jackm
jackm / timeStamp.js
Created Jan 12, 2016
Javascript function for a human readable timestamp in ISO8601 format
View timeStamp.js
// Human readable timestamp in ISO8601 format
function timeStamp() {
var now = new Date();
var date = [now.getFullYear(), now.getMonth() + 1, now.getDate()];
var time = [now.getHours(), now.getMinutes(), now.getSeconds()];
// Prefix a zero to month and day
date[1] = ("00" + date[1]).slice(-2);
date[2] = ("00" + date[2]).slice(-2);
@jackm
jackm / kijiji_show_cat_id.user.js
Last active Jan 22, 2018
Greasemonkey/Tampermonkey script to show hidden cateogry IDs on Kijiji.ca
View kijiji_show_cat_id.user.js
// ==UserScript==
// @name Kijiji show category ID
// @namespace KijijiScripts
// @version 0.5
// @description Add an indicator to show decoded location IDs and category IDs in the breadcrumb nav list (not normally visible)
// @match https://www.kijiji.ca/*
// @grant none
// ==/UserScript==
(function() {
@jackm
jackm / kijiji_repost_ad.user.js
Last active Jan 19, 2018
Greasemonkey/Tampermonkey script for easy ad re-posting on Kijiji.ca - NOTE: This script is broken as of Nov 2016, it no longer works with Kijiji
View kijiji_repost_ad.user.js
// ==UserScript==
// @name Kijiji Repost Ad
// @namespace KijijiScripts
// @version 0.4
// @description Allows for easy ad reposting on Kijiji when managing your ads. A new link named "Repost Ad" will appear in the ad manage widget. Clicking it will redirect the page to the new ad page with most form field pre-filled. You can also specifiy a different category ID in the text field beside the "Repost Ad" button if you wish to repost to a different category than before. Note that this script assumes that you have a Kijiji account and are already logged in and able to manage your existing ads. Also note that when reposting the ad, you will have to manually upload the ad images again, as these are not saved or carried forward automatically (sorry!). Reposting an ad in this way actually creates a whole new ad, so you should delete your old ad as well.
// @match http://www.kijiji.ca/v-view-details.html?*
// @match https://www.kijiji.ca/v-view-details.html?*
// @match http://www