Skip to content

Instantly share code, notes, and snippets.

View jamestomasino's full-sized avatar
🎯
Focusing

James Tomasino jamestomasino

🎯
Focusing
View GitHub Profile
A. W. Tozer - The Knowledge of the Holy (1961)
Abir Mukherjee - A Rising Man (2017)
Adele Abbott - Witch is When it All Began (2015)
Adrian Tchaikovsky - Children of Ruin (2019)
Adrian Tchaikovsky - Children of Time (2015)
Agatha Christie - And Then There Were None
Agatha Christie - Miss Marple 01 - Murder at the Vicarage
Agatha Christie - Miss Marple 03 - The Moving Finger
Agatha Christie - Miss Marple 04 - A Murder is Announced
Agatha Christie - Miss Marple 05 - They Do it With Mirrors
@jamestomasino
jamestomasino / index.php
Created September 26, 2020 13:10
Tomasino.is homepage
<?php
$article = "";
$path = explode('/', $_SERVER['REQUEST_URI'])[1];
$path2 = explode('/', $_SERVER['REQUEST_URI'])[2];
if (! $path) {
$path = shell_exec("shuf -n1 /usr/share/dictd/gcide.index | cut -f1 ");
}
if (($path === "a") || ($path === "an") || ($path === "the")) {
if (isset($path2)) {
@jamestomasino
jamestomasino / digitalocean-config.md
Last active September 22, 2020 16:14
Digital Ocean Droplet setup for Nuxt Blue/Green deploys

Setting up a new digital ocean droplet

  • Create droplet with Ubuntu using special digitalocean key for root access.
  • SSH as root with digitalocean key
  • update and upgrade everything in apt

Setting up user and permissions

  • create 'web' user
  • use strong password
#!/usr/bin/env bash
# credentials for stream
TILDE_USER=""
TILDE_PASS=""
# don't return a * if no files found in glob
shopt -s nullglob
# change to directory where script is and run everything there
@jamestomasino
jamestomasino / bashrc.insults
Created March 22, 2019 16:03
bash insult on error
# source this as part of your bash startup scripts
suicidePostCommand() {
if [ $? -ne 0 ]; then
local INSULT
INSULT[0]="Just what do you think you're doing Dave?"
INSULT[1]="It can only be attributed to human error."
INSULT[2]="That's something I cannot allow to happen."
INSULT[3]="My mind is going. I can feel it."
INSULT[4]="Sorry about this, I know it's a bit silly."
@jamestomasino
jamestomasino / tokipona.json
Last active July 15, 2018 17:11
Flashleit Set - Toki Pona Vocabulary
{
"front": "----------------------------------------\n- -\n- -\n- Mi -\n- -\n- -\n----------------------------------------\n",
"back": "----------------------------------------\n- -\n- -\n- Me/My -\n- -\n- -\n----------------------------------------\n",
"level": 1,
"lastReviewed": null
},
{
"front": "----------------------------------------\n- -\n- -\n- Sina -\n- -\n- -\n----------------------------------------\n",
"back": "-------------------------------
@jamestomasino
jamestomasino / history-commands.txt
Created May 7, 2018 13:55
Commands in history file with at least 2 uses
1777 git
1511 ls
908 cd
863 vim
612 fe
322 z
289 make
287 gs
193 rm
176 cdroot
@jamestomasino
jamestomasino / sdf-update-gopher
Created April 29, 2018 18:29
Update script to mirror my gopher repo on SDF, updating relative links
#!/usr/bin/env bash
# Config
GOPHER_DIR="/ftp/pub/users/tomasino/"
GOPHERMAP="${GOPHER_DIR}/gophermap"
# Overrides
pushd () {
command pushd "$@" > /dev/null
}
@jamestomasino
jamestomasino / center.awk
Last active May 13, 2022 23:54
center a file of text visually in the terminal (for ascii art)
#!/usr/bin/awk -f
BEGIN {
"tput cols" | getline c
while(getline < ARGV[1])
{
if(length>l){l=length}
}
w=(c-l)/2
}
@jamestomasino
jamestomasino / vcard-to-contact.awk
Created March 21, 2018 00:19
Generate contact files from vcard download
# to run: awk -f vcard-to-contact.awk vcard-file.vcf
BEGIN {
FS = ";"
}
/BEGIN:VCARD/ {
# new contact, reset variables
c_n = ""
c_fn = ""