Skip to content

Instantly share code, notes, and snippets.

All your bits belong to me

Ian Spence ecnepsnai

All your bits belong to me
View GitHub Profile
ecnepsnai / main.go
Created Nov 8, 2020
Simple go app to organize files with dates into subdirs of those dates
View main.go
package main
import (
View resource.5s.rb
# <bitbar.title>Resources</bitbar.title>
# <bitbar.version>v1.1</bitbar.version>
# <>Ian Spence</>
# <>ecnepsnai</>
# <bitbar.desc>Show overall CPU and Memory Usage with colors. Keep it simple, stupid!</bitbar.desc>
# <bitbar.dependencies>ruby</bitbar.dependencies>
cpu_count = `sysctl -n hw.logicalcpu`.chomp().to_f
total = `ps -Ao %cpu= | paste -sd+ - | bc`.chomp().to_f
ecnepsnai /
Created Jun 22, 2020
Getting the Sims 2 to run on Windows 10

Does The Sims 2 work on Windows 10?

Yes! The game runs just fine on Windows 10 on new hardware (Such as a AMD Ryzen and a GeForce RTX)

So then what's the problem?

The problem is updating the Sims 2.

It's hard to picture now, but when the Sims 2 came out EA knew that not everybody had reliable internet, if they even had internet at all. The Sims 2 base game was for many people the ONLY version of the game they could get.

ecnepsnai /
Created Feb 19, 2020
Systemd Unit Discord Monitor
# Usage:
# $ DISCORD_WEBHOOK_URL=<Webhook URL> ./ <SystemD Unit Name>
function get_current_state {
(systemctl is-active --quiet ${UNIT_NAME})
ecnepsnai /
Last active Sep 9, 2020
Backup & Restore ZFS to External USB Drive


1. Take a snapshot

Take a snapshot of the zpool you wish to backup

zfs snapshot tank@backup-jan-2020
ecnepsnai /
Last active Jul 21, 2020
Windows 10 New PC Setup

Windows 10 New PC Setup

The Basics

Local account only

Don't link a local workstation account with an online account.

For Windows 10 Home, during OOBE do not connect to a network (Click "I don't have internet"), otherwise you are forced to use a Microsoft account. Windows 10 Pro installs give you the choice even if you do connect to the internet.

ecnepsnai /
Created Apr 9, 2019
Script to manage go versions easily
set -e
VERSION=${1:?Version Required}
if [[ ! -d ${INSTALL_DIR} ]]; then
mkdir -p ${INSTALL_DIR}
ecnepsnai / settings.json
Last active May 2, 2020
VSCode Settings
View settings.json
"workbench.colorTheme": "One Dark Pro",
"workbench.iconTheme": "material-icon-theme",
"editor.fontSize": 13,
"editor.fontFamily": "JetBrains Mono",
"window.zoomLevel": -1,
"go.testOnSave": false,
"go.liveErrors": {
"enabled": true,
"delay": 500
ecnepsnai /
Created Jan 5, 2019
Install Go Report Card
go get
go get
go get
go get
go get
ecnepsnai / ocsp.c
Created Feb 24, 2018
Get OCSP URI from Certificate
View ocsp.c
X509 * cert;
AUTHORITY_INFO_ACCESS * info = X509_get_ext_d2i(cert, NID_info_access, NULL, NULL);
int len = sk_ACCESS_DESCRIPTION_num(info);
for (int i = 0; i < len; i++) {
// Look for the OCSP entry
ACCESS_DESCRIPTION * description = sk_ACCESS_DESCRIPTION_value(info, i);
if (OBJ_obj2nid(description->method) == NID_ad_OCSP) {
if (description->location->type == GEN_URI) {
char * ocspurlchar = i2s_ASN1_IA5STRING(NULL, description->location->d.ia5);
You can’t perform that action at this time.