Skip to content

Instantly share code, notes, and snippets.

🔐
All your bits belong to me

Ian Spence ecnepsnai

🔐
All your bits belong to me
Block or report user

Report or block ecnepsnai

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
@ecnepsnai
ecnepsnai / service_monitor.sh
Created Feb 19, 2020
Systemd Unit Discord Monitor
View service_monitor.sh
#!/bin/bash
# Usage:
# $ DISCORD_WEBHOOK_URL=<Webhook URL> ./service_monitor.sh <SystemD Unit Name>
UNIT_NAME=$1
STATE_FILE="~/.${UNIT_NAME}_last_state"
function get_current_state {
(systemctl is-active --quiet ${UNIT_NAME})
@ecnepsnai
ecnepsnai / zfs_backup_restore.md
Last active Jan 18, 2020
Backup & Restore ZFS to External USB Drive
View zfs_backup_restore.md

Backup

1. Take a snapshot

Take a snapshot of the zpool you wish to backup

zfs snapshot tank@backup-jan-2020
@ecnepsnai
ecnepsnai / setup.md
Last active Mar 15, 2020
Windows 10 New PC Setup
View setup.md

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
ecnepsnai / update_go.sh
Created Apr 9, 2019
Script to manage go versions easily
View update_go.sh
#!/bin/bash
set -e
VERSION=${1:?Version Required}
INSTALL_DIR="/usr/local/go"
if [[ ! -d ${INSTALL_DIR} ]]; then
mkdir -p ${INSTALL_DIR}
fi
VERSION_DIR="${INSTALL_DIR}/${VERSION}"
@ecnepsnai
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
ecnepsnai / install.sh
Created Jan 5, 2019
Install Go Report Card
View install.sh
#!/bin/bash
go get github.com/gojp/goreportcard/cmd/goreportcard-cli
go get github.com/alecthomas/gometalinter
go get github.com/fzipp/gocyclo
go get github.com/gordonklaus/ineffassign
go get github.com/client9/misspell/cmd/misspell
@ecnepsnai
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);
@ecnepsnai
ecnepsnai / guidelines.txt
Created Jun 6, 2017
App Store Review Guidelines
View guidelines.txt
App Store Review Guidelines
Introduction
Apps are changing the world, enriching people’s lives, and enabling developers like you to innovate like never before. As a result, the App Store has grown into an exciting and vibrant ecosystem for millions of developers and more than a billion users. Whether you are a first time developer or a large team of experienced programmers, we are excited that you are creating apps for the App Store and want to help you understand our guidelines so you can be confident your app will get through the review process quickly.
The guiding principle of the App Store is simple - we want to provide a safe experience for users to get apps and a great opportunity for all developers to be successful. We have updated the App Review Guidelines with that principle in mind. The guidelines themselves haven’t changed, but they are better organized and provide more context. On the following pages you will find guidelines arranged into five clear sections: Safety, Performance, Business, Design,
@ecnepsnai
ecnepsnai / csvhash.rb
Created Jan 10, 2017
Ruby CSV to/from Hash
View csvhash.rb
require 'csv'
class CSV
# Read the CSV file into an array of hashes
# @param path [String] The path to the CSV file to read
#
# @return [Array<Hash>] An array of hashes of each column mapped to the rows value
def self.readHash(path)
columns = {} # name mapped to index
return_hash = []
View obfuscate.js
var images = [
//"http://artdelicorp.com/img2/n.gif",
//"http://artdelicorp.com/img2/b.jpg",
//"http://artdelicorp.com/img2/m.gif",
//"http://artdelicorp.com/img2/bluered-00.gif",
//"http://artdelicorp.com/img2/d.jpg",
//"http://artdelicorp.com/img2/e.jpg",
//"http://artdelicorp.com/img2/f.jpg",
//"http://artdelicorp.com/img2/g.jpg",
//"http://artdelicorp.com/img2/h.jpg",
You can’t perform that action at this time.