Skip to content

Instantly share code, notes, and snippets.

Ryan A. Pavlik rpavlik

Block or report user

Report or block rpavlik

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
rpavlik /
Created Mar 1, 2018
Reading 24xx i2c eeprom using rpi or other linux board
# Make sure you have i2c-dev loaded and set up for whatever interface you're using
# This is the right one for the default rpi interface.
cd /sys/class/i2c-adapter/i2c-1/
# Instantiate a new device at runtime
# use the right generic chip name (24cSOMETHING) - don't screw this up! see
# table at
# description further up at
# and info about what this command actually does at
echo 24c16 0x50 | sudo tee new_device
rpavlik /
Created Feb 24, 2018
Find some installed packages and get just their names, suffixed by a forced version.
# for instance, for fixing/removing a botched locally-build kernel.
dpkg -l|grep "bpo9+1.1" | sed -r 's/ii\s+(\S+).*/\1=4.14.13-1~bpo9+1/' | xargs echo
rpavlik / makerbot_rep2x_1st.def.json
Last active Apr 28, 2019 — forked from d235j/makerbot_rep2x_1st.def.json
Replicator 2X Cura definition - slightly tweaked for my printer, which is running Sailfish
View makerbot_rep2x_1st.def.json
"id": "makerbot_rep2x_1st",
"version": 2,
"name": "Rep2X Right Extruder",
"inherits": "fdmextruder",
"metadata": {
"machine": "makerbot_replicator_2x",
"position": "0"
rpavlik / rules.txt
Created Jan 5, 2018
Stop CNet Auto-Play Videos
View rules.txt
! Block annoying CNet auto-play videos.
! Tried to make it targeted so that if you actually wanted to watch a video, you could...
! Tested/works with uBlock Origin
! Block the playlist*.m3u8?device=ott*
! Block the script that loads the playlists
! Element hiding: hide the now-useless placeholder
rpavlik / CMakeLists.txt
Created Sep 12, 2017
Requesting C++14 and C11
View CMakeLists.txt
cmake_minimum_required(VERSION 3.1.0)
rpavlik /
Created Sep 6, 2017
STM32F103xB scripts/ script for xpack/micro-os-plus usage
set -euo pipefail
# Sample scripts/ file for use of xPacks on an STM32F103xB,
# such as that found on the Nucleo F103RB (only minor changes required for other F1 chips),
# using my "unofficial" xPacks of the HAL and CMSIS device code.
# Based on a combination of these files:
rpavlik / additions_to_config.cson
Created Mar 8, 2017
Markdeep customizations for Atom
View additions_to_config.cson
# Merge (don't replace!) the contents of your config.cson Atom configuration file with this
# to improve support for Markdeep. This is the best I've found so far, but not ideal.
# Markdeep:
customFileTypes: # Merge contents of these keys with any existing config
'source.gfm': [
'md.html' # Recommended file extension for Markdeep - maps here to GitHub-Flavored Markdown.
rpavlik /
Last active Oct 12, 2016
Somewhat hacky, but semi-functional, way of searching for included CMake modules from a directory.
# first grab the lines that have an include command,
# then filter out the ones where it might be commented out (this might over-filter - can drop this stage)
# then, use sed to grab just the stuff in between () in the include statement
# and finally, sort/uniq.
ag --nofilename 'include[(].*' | \
grep -v '#.*include[(]' | \
sed -r -n 's/.*include[(]([^)]+)[)]/\1/p' | \
sort --unique
View PushBulletBookmarklet.js
(function() {
// code for IE7+, Firefox, Chrome, Opera, Safari - forget IE6
var xmlhttp = new XMLHttpRequest();"POST", "", true);
xmlhttp.setRequestHeader('Content-Type', 'application/json');
xmlhttp.setRequestHeader('Authorization', "Bearer " + API_KEY);
/// @todo needs oauth2 update? ugh.
rpavlik / GetRenderManager.cmd
Last active Apr 27, 2017
Batch script for keeping an up-to-date local copy of the latest 32 and 64-bit continuous builds of OSVR RenderManager and OSVR Core
View GetRenderManager.cmd
@echo off
rem By Ryan Pavlik, Sensics, Inc. <>
rem Copyright 2015-2016 Sensics, Inc.
rem SPDX-License-Identifier: Apache-2.0
rem Put this in a directory of its own, preferably. It will create one file and two subdirectories.
rem Doesn't hurt to run it more often than there are builds: it won't re-download (though
rem it will harmlessly re-extract)
rem Requires that you have wget and 7za (the command line version of 7z) in your path.
You can’t perform that action at this time.