xcode-select --installto makegitwork- 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.gitgit clone https://github.com/phette23/bashrc.gitgit clone https://github.com/phette23/fishrc.git- these all have bash
./copy.shscripts to install them
- run the set up scripts from dotconfig:
This file contains hidden or 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 | |
| # loop over repos and create local & remote "main" branches | |
| set dirs (exa -D) # or could do the less elegant `ls -d */` | |
| for dir in $dirs | |
| set_color --bold | |
| echo "Entering $dir" | |
| set_color normal | |
| cd $dir | |
| # test for git repo |
This file contains hidden or 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
| // only add if not already there, add as last subject with "local" authority | |
| if (!xml.contains('mods/subject/topic', 'Oakland Campus Legacy')) { | |
| var len = xml.count('mods/subject') | |
| xml.set('mods/subject[' + len + ']/@authority', 'local') | |
| xml.set('mods/subject[' + len + ']/topic', 'Oakland Campus Legacy') | |
| } |
This file contains hidden or 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
| setTimeout(() => { | |
| libScope(angular.element('html').scope()); | |
| }, 1000); | |
| function libScope(scope) { | |
| // Watch results feed for changes... | |
| scope.$watchCollection('feed', () => { | |
| // give AngularJS time to update the DOM | |
| // Probably need to wait a few seconds before running this to make sure the DOM loads | |
| setTimeout(function() { |
This file contains hidden or 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
| $.get('https://library.cca.edu/cgi-bin/koha/svc/report?id=130', function(data) { | |
| // header row | |
| let html = '<table><thead><th>Field One</th><th>Field Two</th><th>Field Three</th></thead><tbody>' | |
| // content rows | |
| data.forEach(row => { | |
| html += '<tr>' | |
| row.forEach(value => html += `<td>${value}</td>`) | |
| html += '</tr>' | |
| }) | |
| // close tags (optional), add to DOM |
This file contains hidden or 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
| SELECT u.first_name, u.last_name, u.email, pub.title, pub.published_in, pub.url, pub.date, pub.description | |
| FROM people_ppublication pub | |
| JOIN people_portalprofile prof ON (pub.object_id = prof.id) | |
| JOIN people_userprofile u ON (prof.user_id = u.id) |
This file contains hidden or 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
| <?xml version="1.0"?> | |
| <oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/"> | |
| <dc:title>Do Re Mi</dc:title> | |
| </oai_dc:dc> |
This file contains hidden or 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 | |
| //jshint node:true | |
| // useful for finding location of files on server, for non-advanced storage config location is | |
| // {{data dir}}/Institutions/{{institution name}}/Attachments/${hashCode(uuid)}/${uuid}/${version} | |
| // for advanced storage config it's | |
| // {{data dir}}/Institutions/{{institution name}}/Attachments/${collection UUID}/${hashCode(uuid)}/${uuid}/${version} | |
| const readline = require('readline') | |
| let hashCode = function(str){ | |
| let hash = 0 |
This file contains hidden or 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
| SELECT b.title, b.author, b.biblionumber | |
| FROM biblio b | |
| GROUP BY b.datecreated DESC | |
| LIMIT 20 |
This file contains hidden or 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 |