Skip to content

Instantly share code, notes, and snippets.

View pcewing's full-sized avatar

Paul Ewing pcewing

  • Blizzard Entertainment
View GitHub Profile
@pcewing
pcewing / rename_mp3s.py
Last active December 1, 2022 21:24
Rename MP3 Files
#!/usr/bin/env python3
import os
import mutagen.id3
import unicodedata
import re
import errno
from shutil import copyfile
OUTPUT_FILENAMES = set()
@pcewing
pcewing / gslp_2021.md
Last active May 25, 2021 15:19
GSLP 2021

GSLP Strength Chart

Date Bench Press Strict Press Back Squat Deadlift
2021/04/02 120x5,5,6 195x5,5,10
2021/03/31 180x5,5,12 265x10
2021/03/29 115x5,5,7 190x5,5,10
2021/03/26 N/A N/A N/A N/A
2021/03/24 175x5,5,8 255x10
2021/03/22 110x5,5,8 185x5,5,10
@pcewing
pcewing / bash_base.sh
Created June 18, 2020 17:55
Bash script base, useful common utilities for shell scripting
#!/usr/bin/env bash
function yell () { >&2 echo "$*"; }
function die () { yell "$*"; exit 1; }
function try () { "$@" || die "Command failed: $*"; }
script_path="$( realpath "$0" )"
script_dir="$( dirname "$script_path" )"
@pcewing
pcewing / main.c
Created June 18, 2020 01:19
Simple thread-safe queue in C
#include "queue.h"
#include <stdio.h>
#define UNUSED(x) ((void)(x))
void string_print_callback(void *item) {
const char *str = item;
printf("%s", str);
}
@pcewing
pcewing / epoll_mpd_client.c
Created June 16, 2020 04:09
Example epoll-based ncurses MPD client
#include <curses.h>
#include <mpd/client.h>
#include <stdlib.h>
#include <sys/epoll.h>
#include <unistd.h>
#define MAX_EVENTS 10
void
toggle_play_pause(struct mpd_connection *mpd_conn) {
FROM centos:latest
RUN groupadd -r -g 1001 john && \
groupadd -r -g 1050 myapp && \
useradd -rM -g john -G myapp -u 1001 john && \
mkdir -p /var/john && \
chown -R john:john /var/john
USER john:john
@pcewing
pcewing / issue
Last active January 30, 2020 05:29
Customized login screen (/etc/issue) for Manjaro


__ __ __ __ _ _ __ _____ ____ ______ __
| \\ / | / \\ | \\ | | | | / \\ | _ \\ / __ \\ | || |
| \\/ | / /\\ \\ | | \\ | | | | / /\\ \\ | |_| / / / \\ \\ | ___|| |
| |\\__/| |/ ____ \\| |\\ \\| |_ | |/ ____ \\ | __ \\ / / \\ \\ | | __ | |
| | | | / \\ \\ | \\ \\ | \\_/ / / \\ \\| | \\ \\\\ \\____/ / | || || |
|_| |_|/ \\_\\| \\__|\\___/_/ \\_\\_| \\_\\\\______/ |__||__||__|
Manjaro Linux \r
@pcewing
pcewing / gslp.md
Last active March 2, 2020 19:37
GSLP Strength Chart

GSLP Strength Chart

Date Bench Press Strict Press Back Squat Deadlift
2020/02/29 105x5,5,11 305x10
2020/02/26 190x5,5,8 205x5,5,8
2020/02/19 100x5,5,10 295x10
2020/02/16 185x5,5,11 200x5,5,8
2020/02/13 95x5,5,12 285x10
2020/02/11 180x5,5,10 195x5,5,8
@pcewing
pcewing / rsync_notes.md
Created October 10, 2019 01:05
Syncing music to flash drive via rsync

Assuming we have a flash drive mounted at the path /mnt/FlashDrive/Music/, we can sync up our own music directory to the flash drive using rsync as follows:

rsync --recursive --delete ~/Music/ /mnt/FlashDrive/Music/

Note that the trailing slashes on the folders are very important!