Skip to content

Instantly share code, notes, and snippets.

View mmstick's full-sized avatar
🦀
Developing Rust projects for Pop!_OS

Michael Murphy mmstick

🦀
Developing Rust projects for Pop!_OS
View GitHub Profile
@mmstick
mmstick / keybase.md
Created January 12, 2024 02:51
keybase.md

Keybase proof

I hereby claim:

  • I am mmstick on github.
  • I am mmstick (https://keybase.io/mmstick) on keybase.
  • I have a public key whose fingerprint is 2A8C B607 A1D3 332C 18E8 6652 B273 2D42 40C9 212C

To claim this, I am signing this object:

@mmstick
mmstick / sofa-install.sh
Last active August 1, 2023 13:08
SOFA Spatializer Installer
#!/bin/bash
GREEN='\e[32m'
RESET='\e[0m'
FILTER_CHAIN_DIR="${HOME}/.config/pipewire/filter-chain.conf.d"
FILTER_CONFIG='https://gist.githubusercontent.com/mmstick/039422a63c73a09e998d08608abaee43/raw/9c4dfef5a447fe25a47e3492e518e134e57ee9d4/7.1-spatializer.conf'
SOFA_RESOURCES='/usr/share/pipewire/sofa'
SOFA_INPUT='https://sofacoustics.org/data/database_sofa_0.6/ari/dtf%20b_nh724.sofa'
echo -e "${GREEN}1/3: Requesting permission to install resources to ${SOFA_RESOURCES}${RESET}"
sudo mkdir -p ${SOFA_RESOURCES}
@mmstick
mmstick / 7.1-spatializer.conf
Last active July 25, 2023 23:19
Pipewire SOFA spatializer
context.modules = [
{ name = libpipewire-module-filter-chain
args = {
node.description = "7.1 Spatializer"
media.name = "7.1 Spatializer"
filter.graph = {
nodes = [
{
type = sofa
label = spatializer
@mmstick
mmstick / xanmod-install.sh
Last active October 4, 2023 18:43
Script for installing xanmod on Pop!_OS
#!/bin/bash
set -e
for field in $(cat /proc/cmdline); do
if [[ "${field}" = root=* ]]; then
UUID=$(echo $field | awk -F= '{print $3}')
break
fi
done
@mmstick
mmstick / sources.list
Created May 3, 2020 00:49
Focal Source List
deb mirror://mirrors.ubuntu.com/mirrors.txt/ focal restricted multiverse universe main
deb-src mirror://mirrors.ubuntu.com/mirrors.txt/ focal restricted multiverse universe main
deb mirror://mirrors.ubuntu.com/mirrors.txt/ focal-updates restricted multiverse universe main
deb-src mirror://mirrors.ubuntu.com/mirrors.txt/ focal-updates restricted multiverse universe main
deb mirror://mirrors.ubuntu.com/mirrors.txt/ focal-security restricted multiverse universe main
deb-src mirror://mirrors.ubuntu.com/mirrors.txt/ focal-security restricted multiverse universe main
deb mirror://mirrors.ubuntu.com/mirrors.txt/ focal-backports restricted multiverse universe main
deb-src mirror://mirrors.ubuntu.com/mirrors.txt/ focal-backports restricted multiverse universe main
deb mirror://mirrors.ubuntu.com/mirrors.txt/ focal-proposed restricted multiverse universe main
deb-src mirror://mirrors.ubuntu.com/mirrors.txt/ focal-proposed restricted multiverse universe main
@mmstick
mmstick / install-fahclient-systemd.sh
Last active March 22, 2020 01:53
Folding@Home Linux Setup
#!/bin/sh
# Create a systemd service for the FAH client.
echo '[Unit]
Description=Folding@Home Client
After=network.target
[Service]
WorkingDirectory=/var/lib/fahclient
ExecStart=/usr/bin/FAHClient /etc/fahclient/config.xml --run-as fahclient --pid-file=/var/run/fahclient.pid
### Keybase proof
I hereby claim:
* I am mmstick on github.
* I am mmstick (https://keybase.io/mmstick) on keybase.
* I have a public key ASB9fnv3gH4sQQcdnvwt7jGb-dD3HoKQNjSGkLU-MxdR4wo
To claim this, I am signing this object:
@mmstick
mmstick / distinst.h
Created March 2, 2018 16:51
distinst FFI
#ifndef distinst_h
#define distinst_h
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
typedef enum {
DISTINST_FILE_SYSTEM_TYPE_NONE = 0,
DISTINST_FILE_SYSTEM_TYPE_BTRFS = 1,
@mmstick
mmstick / 01-main.c
Last active December 30, 2017 18:13
Advent of Code 2017 (C Edition)
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <errno.h>
#include <string.h>
/// A fat pointer which points to byte array of text.
typedef struct str {
uint8_t *data;
size_t len;
@mmstick
mmstick / paths.rs
Created August 22, 2017 15:28
Rusty One-Liners
/// Takes a pathname and shortens it for readability.
pub fn shorten_path(path: &Path) -> PathBuf {
// Attempt to strip the current working directory from the path.
path.strip_prefix(&env::current_dir().unwrap())
// If the home directory was split, return a new `PathBuf` with "." as the replacement.
.map(|value| PathBuf::from(".").join(value))
// If the current working directory could not be found, attempt to strip the home directory from the path.
.unwrap_or(path.strip_prefix(&env::home_dir().unwrap()).ok()
// Return the input path if the home directory was not found, otherwise prepend "~" to the path.
.map_or_else(|| path.to_path_buf(), |value| PathBuf::from("~").join(value)))