[[Apple]]
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

apple [2017/01/16 14:45]
dblume
apple [2018/04/15 22:29] (current)
dblume [Configuration]
Line 33: Line 33:
 OS X comes with BSD grep pre-installed, which doesn't use the Perl -P flag. OS X comes with BSD grep pre-installed, which doesn't use the Perl -P flag.
  
-  - Go to http://brew.sh/ and run the ruby command. +Go to http://brew.sh/ and run the ruby command. 
-  - <nowiki>brew install homebrew/dupes/grep --with-default-namesbrew install gnu-sed --with-default-names&lt;/nowiki+ 
-  - Log out of that console window and log back in again.+  brew install homebrew/dupes/grep --with-default-names 
 +  brew install gnu-sed --with-default-names 
 +  brew install findutils --with-default-names 
 +  brew install jq 
 +  brew install tree 
 +  brew install httpie 
 +  brew install inetutils  # If you need telnet (maybe nc is good enough?) 
 +  # Maybe also readline if you brew install python3 
 +   
 +  brew install bash 
 +  sudo echo /usr/local/bin/bash &gt;> /etc/shells 
 +  chsh -s /usr/local/bin/bash 
 + 
 +Log out of that console window and log back in again.
  
 ** Python Packages ** ** Python Packages **
Line 66: Line 79:
 <code bash tag_ip_address.sh> <code bash tag_ip_address.sh>
 #!/usr/bin/env bash #!/usr/bin/env bash
-curl --data "`hostname -s`=`ifconfig | grep "inet " | grep -v "127.0.0.1" | \ +curl --data "`hostname -s`=`ifconfig | /usr/local/bin/grep "inet " | grep -v "127.0.0.1" | \ 
-sed -E 's/.*inet (([0-9]+.){3}[0-9]+).*/\1/'`&auth=ahov" "http://kvs.dlma.com"+sed -E 's/.*inet (([0-9]+.){3}[0-9]+).*/\1/' | perl -p -e 'chomp if eof;s/\n/,/'`&auth=[your secret auth]" "https://kvs.dlma.com" 
 + 
 +sleep 11  # if launched as a daemon, live for 11s to not be detected as buggy.
 </code> </code>
  
-cd into ~/Library/LaunchAgents and add a new plist file+That "sleep 11" is to mitigate the buggy daemon detection mentioned [[https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html|here]]. 
 + 
 +Note that we had to specify the path to the homebrew grep, because LaunchAgent would use the default one instead. 
 + 
 +cd into ~/Library/LaunchAgents or (/Library/LaunchDaemons if it can really be a daemon) and add a new plist file
  
 <code xml com.dlma.tag_ip_address.plist> <code xml com.dlma.tag_ip_address.plist>
apple.1484606700.txt.gz · Last modified: 2017/01/16 14:45 by dblume
 
Recent changes RSS feed Driven by DokuWiki