xcode-select --install
to makegit
work- download Google Drive or "Backup & Sync" or whatever they are calling it these days
- download 1Password https://1password.com/
- open 1P and sync the password VAULT
- once XCode has finished, start doing command line things
git clone https://github.com/phette23/dotconfig.git
git clone https://github.com/phette23/bashrc.git
git clone https://github.com/phette23/fishrc.git
- these all have bash
./copy.sh
scripts to install them
- run the set up scripts from dotconfig:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
# similar script in Fish | |
# still under construction, need to quiet `git status` more effectively | |
function update -d 'Update git repo' | |
git stash --quiet | |
git pull | |
git stash apply --quiet | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
# usage: vlog [date string] e.g. `vlog yesterday` or just `vlog` (for today's logs) | |
# requires SSH aliases for both app nodes (v1 & v2) | |
set today (gdate "+%Y-%m-%d") | |
if test -n "$argv[1]" | |
# need to use gnu date to get the human readable --date parameter | |
set d (gdate --date="$argv[1]" "+%Y-%m-%d") | |
# there can be multiple logs per day, rsync does this in only 1 ssh connection (requires rsync 3+) | |
rsync -ruzvhP v1:/opt/equella/logs/resource-centre/$d/ :/opt/equella/logs/tomcat/$d/ v1-$d | |
rsync -ruzvhP v2:/opt/equella/logs/resource-centre/$d/ :/opt/equella/logs/tomcat/$d/ v2-$d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put this in your .bash_profile | |
if [ $ITERM_SESSION_ID ]; then | |
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND"; | |
fi | |
# Piece-by-Piece Explanation: | |
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment | |
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too | |
# the $PROMPT_COMMAND environment variable is executed every time a command is run | |
# see: ss64.com/bash/syntax-prompt.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# backup the mdl_data_records table before we modify it | |
gcloud sql export sql mysql-prod-1 gs://cca-manual-db-dumps/(dt)-mdl_data_records.sql -d m_prod1 -t mdl_data_records |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const fs = require('fs') | |
const path = require('path') | |
const readline = require('readline') | |
const todo_dir = process.env.TODO_DIR | |
// TODO we could make this optionally count todo.txt too e.g. with a CLI flag | |
const done_file = path.join(todo_dir, 'done.txt') | |
const projregex = /(\+[A-Za-z0-9]+)(\s|$)/g | |
const ctxregex = /(@[A-Za-z0-9]+)(\s|$)/g | |
let counts = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
# download ALL live vault items to item.json and metadata.xml files | |
# 47283 total items, we can download 50 at a time | |
set total (eq search -l 1 | jq '.available') | |
set length 50 | |
set pages (math floor $total / $length) | |
for i in (seq 0 $pages) | |
set start (math $i \* $length) | |
echo "Downloading items $start to" (math $start + $length) | |
eq search -l $length --info metadata --start $start > .tmp/$i.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// check if these sections appear on EQUELLA search results page | |
const sections = [ | |
'GELCT-6700-2', | |
'LITPA-2000-10', | |
'WRITE-6000-2', | |
] | |
console.log(`Checking for ${sections.length} section codes`) | |
// return list of missing sections | |
const missing = sections.filter(s => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
# used for Art Practical site | |
# fill in credentials | |
set USER username | |
set PASS password | |
set COLLECTION 15633 | |
# destination files | |
set JSONFILE data.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var clipboard = require('child_process').spawn('pbcopy') | |
, data = 'put whatever data here'; | |
clipboard.stdin.write(data); | |
clipboard.stdin.end(); |
NewerOlder