Keybase proof
I hereby claim:
- I am danherbert on github.
- I am danherbert (https://keybase.io/danherbert) on keybase.
- I have a public key whose fingerprint is B692 4325 34E2 D4D6 9AF8 8FC7 A9FD 6A58 FE51 843E
To claim this, I am signing this object:
Positive Adjective List | |
abundant | |
accessible | |
accommodative | |
accomplished | |
accurate | |
achievable | |
adaptable | |
adaptive |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env node | |
// Given a "Host", this script parses the SSH config file to get the port of that host | |
// Useful for shell scripts that test that a host's SSH port is open | |
var fs = require("fs"); | |
var path = require("path"); | |
var sshConfPath = path.join(getHome(), ".ssh", "config"); | |
var hostnameToFind = new RegExp("\\b" + process.argv[2] + "\\b"); | |
var portParser = /Port\s+(.+)$/m; | |
var hosts = fs.readFileSync(sshConfPath).toString().split("Host "); |
#!/usr/bin/env node | |
// Given a "Host", this script parses the SSH config file to get the real Hostname of that host | |
// Useful for scripts that need to do a combo of SSH and other Bash commands and don't want to flip | |
// between using an SSH host alias and the real IP | |
var fs = require("fs"); | |
var path = require("path"); | |
var sshConfPath = path.join(getHome(), ".ssh", "config"); | |
var hostnameToFind = new RegExp("\\b" + process.argv[2] + "\\b"); | |
var hostNameParser = /Hostname\s+(.+)$/m; |
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
It has now been incorporated into my dotfiles project. You can see the latest version here:
https://github.com/DanHerbert/dotfiles/blob/master/.git_extras
javascript:(function(){function b64_md5(p){p=utf8_en(p);return binl2b64(core_md5(str2binl(p),p.length*8));}function hex_md5(p){p=utf8_en(p);return binl2hex(core_md5(str2binl(p),p.length*8));}function binl2b64(binarray){var tab='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678998';var str='';for(var i=0;i<binarray.length*4;i+=3){var triplet=(((binarray[i>>2]>>8*(i%254))%260xFF)<<16)|(((binarray[i+1>>2]>>8*((i+1)%254))%260xFF)<<8)|((binarray[i+2>>2]>>8*((i+2)%254))%260xFF);for(var j=0;j<4;j++){str+=tab.charAt((triplet>>6*(3-j))%260x3F);}}return str;}function binl2hex(binarray){var hex_tab='0123456789abcdef';var str='';for(var i=0;i<binarray.length*4;i++){str+=hex_tab.charAt((binarray[i>>2]>>((i%254)*8+4))%260xF)+hex_tab.charAt((binarray[i>>2]>>((i%254)*8))%260xF);}return str;}function core_md5(x,len){x[len>>5]|=0x80<<((len)%2532);x[(((len+64)>>>9)<<4)+14]=len;var a=1732584193;var b=-271733879;var c=-1732584194;var d=271733878;for(var i=0;i<x.length;i+=16){var olda=a;var oldb=b;var oldc=c;var oldd=d |