User Tools

Site Tools


dev:tricks:macos

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:tricks:macos [2014/10/20 11:20] hackerzhoudev:tricks:macos [2020/06/06 23:32] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Mac OS Tricks ====== ====== Mac OS Tricks ======
 +==== Change the hostname ====
 +<code bash>
 +sudo scutil --set HostName testhostname.local
 +hostname
 +</code>
 +
 ==== Create a bootable OS X USB installation disk ==== ==== Create a bootable OS X USB installation disk ====
 <code bash> <code bash>
Line 28: Line 34:
 <code bash> <code bash>
 curl -L https://raw.githubusercontent.com/beautifulcode/ssh-copy-id-for-OSX/master/install.sh | sh curl -L https://raw.githubusercontent.com/beautifulcode/ssh-copy-id-for-OSX/master/install.sh | sh
 +</code>
 +
 +==== Schedule tasks in Mac OS X ====
 +<code>
 +cat >> ~/me.hackerzhou.backup.plist <<EOF
 +<?xml version="1.0" encoding="UTF-8"?>
 +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 +<plist version="1.0">
 +<dict>
 +     <key>Label</key>
 +     <string>me.hackerzhou.backup</string>
 +        <key>ProgramArguments</key>
 +        <array>
 +                <string>/Users/hackerzhou/bin/backup.sh</string>
 +        </array>
 +     <key>StartCalendarInterval</key>
 +     <dict>
 +          <key>Minute</key>
 +          <integer>0</integer>
 +     </dict>
 +</dict>
 +</plist>
 +EOF
 +sudo cp /Users/hackerzhou/me.hackerzhou.backup.plist /Library/LaunchDaemons/
 +sudo launchctl load /Library/LaunchDaemons/me.hackerzhou.backup.plist
 </code> </code>
  
dev/tricks/macos.1413804028.txt.gz · Last modified: 2020/06/06 23:32 (external edit)