Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan A. Pavlik rpavlik

View GitHub Profile
@rpavlik
rpavlik / fonts.ps1
Last active May 18, 2022
basic system setup
View fonts.ps1
$FontRelease = "2111.01"
$FontArchive = "CascadiaCode-${FontRelease}.zip"
wget.exe "https://github.com/microsoft/cascadia-code/releases/download/v$FontRelease/$FontArchive"
# -aoa = always overwrite
7z x -oCascadiaCode -aoa "${FontArchive}"
# https://blog.simontimms.com/2021/06/11/installing-fonts/
$fonts = (New-Object -ComObject Shell.Application).Namespace(0x14)
@rpavlik
rpavlik / winvm.md
Last active May 18, 2022
Windows Dev VM in libvirt
View winvm.md

One time

  • Build rhsrvany using a windows toolchain like i686-w64-mingw32, and put the resulting rhsrvany.exe and pnp_wait.exe in /usr/share/virt-tools (or see https://salsa.debian.org/rpavlik/rhsrvany for a debian package of it)
    • git clone https://github.com/rwmjones/rhsrvany.git
    • cd rhsrvany
    • autoreconf -i -f
    • ./configure --host=i686-w64-mingw32
    • make
  • sudo mkdir -p /usr/share/virt-tools
View git-prep.sh
#!/bin/sh
# SPDX-FileCopyrightText: 2020-2021, Ryan Pavlik
# SPDX-License-Identifier: CC0-1.0
# Nothing sh-specific here, these work fine in pwsh as well
# Mostly about remote handling
git config --global alias.rup "remote update --prune"
git config --global alias.pf "push --force-with-lease"
git config --global pull.ff only
git config --global commit.verbose true
@rpavlik
rpavlik / fix_homebrew.rb
Created Jan 6, 2011 — forked from mxcl/install_homebrew.markdown
Fix permissions on /usr/local for Homebrew
View fix_homebrew.rb
#!/usr/bin/ruby
#
# This script fixes /usr/local only.
#
# 6th January 2010:
# Modified the script to just fix, rather than install. - rpavlik
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
@rpavlik
rpavlik / GetRenderManager.cmd
Last active Feb 23, 2022
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. <http://sensics.com/osvr>
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.
@rpavlik
rpavlik / script.sh
Created Mar 1, 2018
Reading 24xx i2c eeprom using rpi or other linux board
View script.sh
# 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 https://elixir.bootlin.com/linux/v4.14.18/source/drivers/misc/eeprom/at24.c#L136
# description further up at https://elixir.bootlin.com/linux/v4.14.18/source/drivers/misc/eeprom/at24.c#L30
# and info about what this command actually does at
# https://elixir.bootlin.com/linux/v4.14.18/source/Documentation/i2c/instantiating-devices#L207
echo 24c16 0x50 | sudo tee new_device
@rpavlik
rpavlik / ring-buffer-with-all-iterators.h
Last active Dec 7, 2021
Ring buffer impl with all iterators
View ring-buffer-with-all-iterators.h
// Copyright 2021, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
* @brief Ringbuffer implementation for keeping track of the past state of things
* @author Ryan Pavlik <ryan.pavlik@collabora.com>
* @author Moses Turner <moses@collabora.com>
* @ingroup aux_util
*/
@rpavlik
rpavlik / code.py
Created Nov 30, 2021
Adafruit EyeLights Digital Rain
View code.py
# SPDX-FileCopyrightText: 2021 Phil Burgess for Adafruit Industries
# SPDX-FileCopyrightText: 2021, Ryan Pavlik <ryan.pavlik@gmail.com>
#
# SPDX-License-Identifier: MIT
import math
import random
import time
from supervisor import reload
import board
@rpavlik
rpavlik / notes.md
Last active Oct 27, 2021
Debian packaging notes
View notes.md

These are my personal notes on how to handle Debian packaging best locally. Naturally they aren't authoritative, and I may have "missed a memo" - if so, let me know!

  • New package
    • git init
    • gbp import-orig ...
    • debmake
  • Clean up and edit
    • cme edit dpkg
  • see
@rpavlik
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
www.cnet.com/videos/manifest/*.m3u8?device=ott*
! Block the script that loads the playlists
*.cbsistatic.com/fly/js/pages/desktop/article_video_test*.js
! Element hiding: hide the now-useless placeholder
www.cnet.com##.entered.dock.inviewElement