[[Apple]]
 

Differences

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

Link to this comparison view

apple [2017/01/17 13:40]
dblume [Daemons, Agents, Cron, Launchd]
apple [2018/05/23 08:14] (current)
dblume [Configuration] homebrew/dupes is deprecated now
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 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 67: Line 80:
 #!/usr/bin/env bash #!/usr/bin/env bash
 curl --data "`hostname -s`=`ifconfig | /usr/local/bin/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/' | perl -p -e 'chomp if eof' | \ +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" 
-tr ";\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>
 +
 +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. Note that we had to specify the path to the homebrew grep, because LaunchAgent would use the default one instead.
  
-cd into ~/Library/LaunchAgents and add a new plist file+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.1484689212.txt.gz · Last modified: 2017/01/17 13:40 by dblume
 
Recent changes RSS feed Driven by DokuWiki