Mac for Unix Geeks

Total Page:16

File Type:pdf, Size:1020Kb

Mac for Unix Geeks Mac for Unix Geeks ## references - dynamic man library <https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/> - CLI guides 10.3 <http://www.apple.com/server/docs/Command_Line.pdf> (10.3) 10.6 <http://manuals.info.apple.com/MANUALS/1000/MA1173/en_US/IntroCommandLine_v10.6.pdf> 10.9 <http://help.apple.com/advancedserveradmin/mac/3.1> Mac for Unix Geeks 4E (Leopard) [2008] <http://shop.oreilly.com/product/9780596520632.do> - Developer Tools (XCode) - gcc, make - Command Line Developer Tools for OS X - autoinstall on first run ## history AT&T UNIX -> A/UX (1991 Quadra 700/900) NeXTStep: (1989) 4.3BSD + Mach microkernel + Objective-C (1991) Tim Berners-Lee uses NeXTCube to create Web 1996 MkLinux for PowerPC 1997 Apple acquires NeXT OPENSTEP -> Darwin on XNU (modified Mach) kernel + I/O Kit 2001 Mac OS X 10.0 ## access Terminal Command-S at startup >console at login box (if showing user/password) ## shortcuts drag folder to Terminal window to insert path option-click to reposition cursor within shell command save shell scripts with .command suffix to make them clickable apps ## integration - where Unix appears Console == tail -f logs firewall via ipfw / pf sharing via File Sharing (smbd), Remote Login (sshd), Internet Sharing (natd), Web (Apache), Screen Sharing (VNC) printing via CUPS - <http://localhost:631> $ cupsctl WebInterface=yes OS X Server - CardDAV, CalDAV, DHCP (bootpd), Wiki/WebDAV, Mail (cyrus/dovecot/postfix), VPN (raccoon/ pppd), DNS (bind) X11 / XQuartz ## paths FreeBSD file structure title-case (Apple-land) vs lowercase (Unix-land) /private (etc, tmp, var) /Applications, Developer, Library, Network, System, Users, Volumes /.DocumentRevisions-V100/ (Versions) /.Spotlight-V100/ (metadata) /.Trashes/, ~/.Trashes/ ## commands * open open [path/to/document] || [path/to/folder] || [app name] # open document in alt editor $ open -a textwrangler test.txt # open URL in default browser open [URL] opendiff file1 file2 - launches FileMerge (part of Developer Tools) * clipboard pbcopy < filename $ command | pbcopy pbpaste pbpaste > filename $ pbpaste | command * Quick Look qlmanage -p [path/to/file] - preview file * text nano vi -> vim emacs * files applesingle / binhex / macbinary dot_clean .DS_Store (Finder settings, e.g. icon location and window size) ls -le (ACL) ls -l@ (extended attributes) [Spotlight] mdfind (search) / mdls (view metadata) / mdutil (manage metadata) / mdimport scp -E The ʻ-Eʼ flag preserves extended attributes, resource forks, and ACL information. textutil $ textutil -info MyFile $ textutil -convert html MyWordFile -output /tmp/webfile.html * PLists == Property Lists, defaults # set user LoginHook sudo defaults write com.apple.loginwindow LoginHook /path/to/script Property LIst Editor (XCode) /usr/libexec/PlistBuddy # Allow user to set DVD region once upon first insertion of disc $ /usr/libexec/PlistBuddy -c "Set :rights:system.device.dvd.setregion.initial:class allow" /etc/authorization plutil ## remote admin * disks asr - Apple System Restore rsync | ditto | dd bless - manage boot / startup volumes createhomedir diskutil (Disk Utility - physical disks) hdiutil (DU - disk images) drutil (DU - disk burners) disktool (deprecated) * network airport $ /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s networksetup # check DNS servers on Ethernet interface $ networksetup -getdnsservers ethernet scutil - system config $ scutil -r IP $ scutil --get ComputerName (sharing) | LocalHostName (Bonjour) | HostName $ scutil --dns * software installer / pkgutil / packagemaker softwareupdate * system info sysctl - kernel state $ sysctl -n hw.model $ sysctl -n machdep.cpu.brand_string $ sysctl vm.loadavg system_profiler * system settings nvram -p pmset #Set System Sleep Preferences | 0 = Off | 15 = 15 Min | 20 = 20 Min | etc | $ pmset sleep 0 systemsetup # List startup disks $ systemsetup -liststartupdisks # Show current startup disk $ systemsetup -getstartupdisk # Change startup disk $ systemsetup -setstartupdisk path # Set time zone and time server. $ systemsetup -setusingnetworktime on $ systemsetup -settimezone America/New_York -setnetworktimeserver time.apple.com # Activate WakeOnLAN. $ systemsetup -setwakeonnetworkaccess on # Set computer to start up after power failure $ systemsetup -setwaitforstartupafterpowerfailure seconds (0 | 30 / +30 ) * user/group dscl dsmemberutil - to see what group a user or another group are a member of, or check user/group UUIDs dseditgroup - To edit, create, manipulate, or delete groups # Allow all local users to add/remove printers, as part of the lpadmin group, substitute localadmin for your admin's short username dseditgroup -o edit -u localadmin –t group -a staff _lpadmin dscacheutil - To work with various Directory Service caches, including LDAP and DNS # flush DNS cache 10.4: $lookupd -flushcache 10.5/10.6: dscacheutil -flushcache 10.7/10.8: sudo killall -HUP mDNSResponder dsenableroot - to enable root - - - ## misc automator / amlint / osascript caffeinate (10.8+) - disable sleep osascript scriptfile - run AppleScripts $ osascript -e 'Applescript syntax' screencapture $ screencapture -m screenfile.png ## launchd launchctl /System/Library/LaunchDaemons - Apple system daemons /System/Library/LaunchAgents - Apple agents (all users) /Library/LaunchDaemons - third party system daemons /Library/LaunchAgents - third party agents (all users) ~/Library/LaunchAgents - third party agents (logged-in user) Schedule via StartCalendarInterval / StartInterval keys ## extending - MacOSForge.org - open sourced Apple projects (WebKit, XQuartz) - MacPorts.org | FinkProject.org | Homebrew (Brew.sh) ## tools <http://www.clockwise.ee/gasmask/> - edit Hosts <http://www.hanynet.com/icefloor/> - Icefloor - edit PF Platypus Term2 Visor.
Recommended publications
  • Connecting to Cat5 Via X2go from Macos Before Connecting to Cat5 the First Time, Please Follow the “First Time Only” Steps Below
    Brought to you by DES Computing Services Questions? [email protected] Connecting to Cat5 via X2Go from macOS Before connecting to Cat5 the first time, please follow the “First Time Only” steps below. Connecting to Cat5 1. From the Applications menu in Finder, run the “x2goclient” application. 2. Click on the white box on the right that says “cat5.” 3. Enter your Cat5 password as prompted and click OK. 4. The first time you connect, it will ask if you trust the host key. To verify the secure connection, check that the provided “hash” exactly matches one of these lines: • 5e:c1:1a:7a:3d:07:72:64:d3:fc:fe:0a:cc:c5:0f:c8:d1:92:aa:0a • 55:87:cd:ef:80:dc:9d:e8:1d:14:87:27:40:00:01:4a If it matches one of those, then click “Yes” to connect. If it doesn't match either of them, then please check Cat5 Host Key Fingerprints on the DES website for more possible hash values. Do not accept an unverified host key! Disconnecting from Cat5 1. To properly close your session, click on the “System” menu (within the Cat5 desktop) and then click “Log out <name>...” 2. If you just close the window, it will pause your session. You should be able to reconnect later to resume where you left off, but sometimes this might not work. To be safe, follow step 1. First Time Only Steps Install XQuartz You must have the “XQuartz” X-Window system installed before you install X2Go. You may have already installed it for another class.
    [Show full text]
  • Chapter 1. Origins of Mac OS X
    1 Chapter 1. Origins of Mac OS X "Most ideas come from previous ideas." Alan Curtis Kay The Mac OS X operating system represents a rather successful coming together of paradigms, ideologies, and technologies that have often resisted each other in the past. A good example is the cordial relationship that exists between the command-line and graphical interfaces in Mac OS X. The system is a result of the trials and tribulations of Apple and NeXT, as well as their user and developer communities. Mac OS X exemplifies how a capable system can result from the direct or indirect efforts of corporations, academic and research communities, the Open Source and Free Software movements, and, of course, individuals. Apple has been around since 1976, and many accounts of its history have been told. If the story of Apple as a company is fascinating, so is the technical history of Apple's operating systems. In this chapter,[1] we will trace the history of Mac OS X, discussing several technologies whose confluence eventually led to the modern-day Apple operating system. [1] This book's accompanying web site (www.osxbook.com) provides a more detailed technical history of all of Apple's operating systems. 1 2 2 1 1.1. Apple's Quest for the[2] Operating System [2] Whereas the word "the" is used here to designate prominence and desirability, it is an interesting coincidence that "THE" was the name of a multiprogramming system described by Edsger W. Dijkstra in a 1968 paper. It was March 1988. The Macintosh had been around for four years.
    [Show full text]
  • Release and Installation Notes
    CSD Release and Installation Notes 2016 CSDS Release Copyright © 2016 Cambridge Crystallographic Data Centre Registered Charity No 800579 Conditions of Use The Cambridge Structural Database System (CSD System) comprising all or some of the following: ConQuest, Quest, PreQuest, deCIFer, Mercury, (Mercury CSD and CSD-Materials [formerly known as the Solid Form or Materials module of Mercury], Mercury DASH), Mogul, IsoStar, DASH, SuperStar, web accessible CSD tools and services, WebCSD, CSD Java sketcher, CSD data file, CSD-UNITY, CSD-MDL, CSD-SDFile, CSD data updates, sub files derived from the foregoing data files, documentation and command procedures, test versions of any existing or new program, code, tool, data files, sub-files, documentation or command procedures which may be available from time to time (each individually a Component) is a database and copyright work belonging to the Cambridge Crystallographic Data Centre (CCDC) and its licensors and all rights are protected. Use of the CSD System is permitted solely in accordance with a valid Licence of Access Agreement or Products Licence and Support Agreement and all Components included are proprietary. When a Component is supplied independently of the CSD System its use is subject to the conditions of the separate licence. All persons accessing the CSD System or its Components should make themselves aware of the conditions contained in the Licence of Access Agreement or Products Licence and Support Agreement or the relevant licence. In particular: The CSD System and its Components are licensed subject to a time limit for use by a specified organisation at a specified location. The CSD System and its Components are to be treated as confidential and may NOT be disclosed or re-distributed in any form, in whole or in part, to any third party.
    [Show full text]
  • Building an Openstep Application by Michael Rutman, Independent Consultant
    Building an OpenStep Application by Michael Rutman, independent consultant Is it really as easy to program in OpenStep OpenStep and NEXTSTEP In 1985, Steve Jobs left Apple and formed NeXT. He found the latest technologies and brought together a team of developers to turn the newest theories into realities. To verify the new technologies, during development Steve would often stop development and have the entire team use the system they were creating. Several existing apps were created during these day or week long kitchens. More importantly, each developer knew how the framework would be used. If developers had a hard time using an object during a kitchen, they knew they had to rework that object. The system they created was called NEXTSTEP. NEXTSTEP has several layers, and each layer was state of the art in 1985. In the 12 years since Steve picked these technologies, the state of the art may have moved, but not advanced. The underlying OS is a Mach mini-kernel running a unix emulator. For practical purposes, Mach is a flavor of BSD unix. However, the Mach mini-kernel offers programmers a rich set of functionality beyond what unix provides. Most of the functionality of Mach is wrapped into the NEXTSTEP framework, so programmers get the power and flexibility of Mach with the ease of use of NEXTSTEP. Sitting on top of Mach is Display Postscript. Postscript, the language of printers, is a nice graphics language. NeXT and Adobe optimized Postscript for displaying on the screen and produced a speedy and powerful display system. NeXT's framework hides most of the Postscript, but if a programmer wants to get into the guts, there are hooks, called pswraps, to work at the Postscript level.
    [Show full text]
  • Openstep User Interface Guidelines
    OpenStep User Interface Guidelines 2550 Garcia Avenue Mountain View, CA 94043 U.S.A. Part No: 802-2109-10 A Sun Microsystems, Inc. Business Revision A, September 1996 1996 Sun Microsystems, Inc. 2550 Garcia Avenue, Mountain View, California 94043-1100 U.S.A. All rights reserved. Portions Copyright 1995 NeXT Computer, Inc. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Portions of this product may be derived from the UNIX® system, licensed from UNIX System Laboratories, Inc., a wholly owned subsidiary of Novell, Inc., and from the Berkeley 4.3 BSD system, licensed from the University of California. Third-party font software, including font technology in this product, is protected by copyright and licensed from Sun's suppliers. This product incorporates technology licensed from Object Design, Inc. RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR 52.227-19. The product described in this manual may be protected by one or more U.S. patents, foreign patents, or pending applications. TRADEMARKS Sun, Sun Microsystems, the Sun logo, SunSoft, the SunSoft logo, Solaris, SunOS, and OpenWindows are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
    [Show full text]
  • Mac OS X Intro for UNIX Users
    Mac OS X An Introduction for UNIX Users Leon Towns-von Stauber, Occam's Razor Seattle BSD Users Group, October 2004 http://www.occam.com/osx/ X Contents Opening Remarks.............................3 Where Did Mac OS X Come From?.....5 What is Mac OS X?..........................13 A New Kind of UNIX........................25 A Different Kind of UNIX.................28 Why Use Mac OS X?.........................60 Resources.......................................63 Closing Remarks.............................67 X Opening Remarks 3 This is a technical introduction to Mac OS X, mainly targeted to experienced UNIX users for whom OS X is at least relatively new Some emphasis on comparisons with FreeBSD I'm assuming basic familiarity with operating system design Where I'm coming from: UNIX user and some-time admin since 1990 Full-time UNIX admin since 1995 NeXTstep user and admin since 1991 This presentation covers primarily Mac OS X 10.3.5 (Darwin 7.5) X Legal Notices 4 This presentation Copyright © 2003-2004 Leon Towns-von Stauber. All rights reserved. Trademark notices Apple®, Mac®, Macintosh®, Mac OS®, Aqua®, Finder™, Quartz™, Cocoa®, Carbon®, AppleScript®, Rendezvous™, Panther™, and other terms are trademarks of Apple Computer. See <http:// www.apple.com/legal/appletmlist.html>. NeXT®, NeXTstep®, OpenStep®, and NetInfo® are trademarks of NeXT Software. See <http://www.apple.com/legal/nexttmlist.html>. PowerPC™ is a trademark of International Business Machines. Java™ is a trademark of Sun Microsystems. Other trademarks are the property of their
    [Show full text]
  • The Apple Ecosystem
    APPENDIX A The Apple Ecosystem There are a lot of applications used to manage Apple devices in one way or another. Additionally, here’s a list of tools, sorted alphabetically per category in order to remain vendor agnostic. Antivirus Solutions for scanning Macs for viruses and other malware. • AVG: Basic antivirus and spyware detection and remediation. • Avast: Centralized antivirus with a cloud console for tracking incidents and device status. • Avira: Antivirus and a browser extension. Avira Connect allows you to view device status online. • BitDefender: Antivirus and malware managed from a central console. • CarbonBlack: Antivirus and Application Control. • Cylance: Ransomware, advanced threats, fileless malware, and malicious documents in addition to standard antivirus. • Kaspersky: Antivirus with a centralized cloud dashboard to track device status. © Charles Edge and Rich Trouton 2020 707 C. Edge and R. Trouton, Apple Device Management, https://doi.org/10.1007/978-1-4842-5388-5 APPENDIX A THe AppLe ECOSYSteM • Malware Bytes: Antivirus and malware managed from a central console. • McAfee Endpoint Security: Antivirus and advanced threat management with a centralized server to track devices. • Sophos: Antivirus and malware managed from a central console. • Symantec Mobile Device Management: Antivirus and malware managed from a central console. • Trend Micro Endpoint Security: Application whitelisting, antivirus, and ransomware protection in a centralized console. • Wandera: Malicious hot-spot monitoring, jailbreak detection, web gateway for mobile threat detection that integrates with common MDM solutions. Automation Tools Scripty tools used to automate management on the Mac • AutoCasperNBI: Automates the creation of NetBoot Images (read: NBI’s) for use with Casper Imaging. • AutoDMG: Takes a macOS installer (10.10 or newer) and builds a system image suitable for deployment with Imagr, DeployStudio, LANrev, Jamf Pro, and other asr or Apple Systems Restore-based imaging tools.
    [Show full text]
  • Quick Installation Guide: Macos® Standalone (For SUNLL Licenses)
    Quick Installation Guide: macOS® Standalone (for SUNLL Licenses) Thermo-Calc Version 2021b macOS® Standalone Quick Install Guide macOS® Standalone Quick Install Guide This quick guide helps you do a full standalone installation. A standalone installation is used with the Single-User Node-Locked License (SUNLL), where the software and the license file are together on one computer. This guide is applicable to: l macOS l Full Standalone installation (SUNLL) l Upgrading to a new standalone version of Thermo-Calc (maintenance plan only) Other Installations For instructions about other operating systems, network installations, or installing an SDK (e.g. TC-Python or TC-Toolbox for MATLAB®) search the Thermo-Calc Installation Guide, which is also available on our website. You can also review the Licensing Options included on our website. Request a License File Upgrades to a new version of Thermo-Calc: Skip this section if you are upgrading to a new version of Thermo-Calc and (and you have a maintenance plan). Your license is sent to you in an email from Thermo-Calc Software AB. Save it to your computer to use during software installation. 1. From the Apple main menu, select System Preferences. 2. Click Network. 3. In the left column select Ethernet or Built-in Ethernet (do not select a WiFi connection as a local static MAC address is required). 4. Click Advanced → Hardware. The Network window shows you the MAC Address. For example, the MAC address (the host ID) might be 3c:07:54:28:5f:72. macOS® Standalone Quick Install Guide ǀ 2 of 5 macOS® Standalone Quick Install Guide 5.
    [Show full text]
  • DISCOVERING OPENSTEP: a Developer Tutorial
    DISCOVERING OPENSTEP: A Developer Tutorial Rhapsody Developer Release Apple Computer, Inc. User Interface Tips copyright © 1997 Apple Computer, Inc. All rights reserved. [6467.00] No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, mechanical, electronic, photocopying, recording, or otherwise, without prior written permission of Apple Computer, Inc., except to make a backup copy of any documentation provided on CD-ROM. Printed in the United States of America. The Apple logo is a trademark of Apple Computer, Inc. Use of the “keyboard” Apple logo (Option-Shift-K) for commercial purposes without the prior written consent of Apple may constitute trademark infringement and unfair competition in violation of federal and state laws. No licenses, express or implied, are granted with respect to any of the technology described in this book. Apple retains all intellectual property rights associated with the technology described in this book. This book is intended to assist application developers to develop applications only for Apple-labeled or Apple-licensed computers. Every effort has been made to ensure that the information in this manual is accurate. Apple is not responsible for printing or clerical errors. Apple Computer, Inc. 1 Infinite Loop Cupertino, CA 95014 408-996-1010 Apple, and the Apple logo are trademarks of Apple Computer, Inc., registered in the United States and other countries. NeXT, the NeXT logo, NEXTSTEP, the NEXTSTEP logo, Digital Librarian, NeXTmail, and
    [Show full text]
  • Xfree86® on Darwin and Mac OS X Torrey T
    XFree86® on Darwin and Mac OS X Torrey T. Lyons 15 December 2003 1. Introduction XFree86, a freely redistributable open-source implementation of the X Window System, has been ported to Darwin and Mac OS X. This document is a collection of information for anyone running XFree86 on Apple’s next generation operating system. Most of the current work on XFree86 for Darwin and Mac OS Xiscentered around the XonX project at SourceForge. If you areinterested in up-to-date status, want to report a bug, or are interested in working on XFree86 for Darwin, stop by the XonX project. 2. Hardware Supportand Configuration The X window server for Darwin and Mac OS Xprovided by the XFree86 Project, Inc. is called XDarwin. XDarwin can run in three different modes. On Mac OS X, XDarwin runs in parallel with Aqua in full screen or rootless modes. These modes arecalled Quartz modes, named after the Quartz 2D compositing engine used by Aqua. XDarwin can also be run from the Darwin con- sole in IOKit mode. In full screen Quartz mode, when the X Window System is active, it takes over the entirescreen. Youcan switch back to the Mac OS Xdesktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS Xdesktop, click on the XDarwin icon in the Dock to switch back to the X window system. (You can change this behavior in the user preferences so that you must click the XDarwin icon in the floating switch window instead.) In rootless mode, the X window system and Aqua shareyour display.
    [Show full text]
  • Introduction to Mobile Platforms
    EMBEDDED SYSTEMS PROGRAMMING 2017-18 Introduction to the Platforms LIBRARY A collection of resources (in our context, classes) used to develop software Examples: the Java Class Library, the C++ Standard Template Library (STL), the C standard library... FRAMEWORK A collection of libraries organized to provide a key functionality A framework suggests/imposes a programming model Example: Apple’s UIKit framework provides the classes needed to construct and manage an application’s user interface for iOS PLATFORM A collection of software frameworks (including application frameworks) that allows software to run A platform specifies an operating system, a set of programming languages and run-time system libraries. It may include an hardware architecture Examples: Android, iOS, Windows Phone ECOSYSTEM ECOSYSTEM ECOSYSTEM A platform together with the community developing hardware and software products for that platform The products and the users are sometimes considered part of the ecosystem as well Example: Android together with Android developers, Google Play, etc. ANDROID, IOS, WP They share several characteristics. They are platforms They include an operating system, a set of core applications (browser, e-mail, ...) and a rich set of libraries to develop custom applications Libraries for data storage, hardware access, multimedia, 3D graphics... (More on this later) They are optimized for embedded devices OPERATING SYSTEM (1/2) RESEARCH, OPENNESS AND REGULATIONS Thompson and Ritchie invented Unix in the 1960s as a research project while at Bell
    [Show full text]
  • Openstep and Solaris
    OpenStep and Solaris A White Paper A Sun Microsystems, Inc. Business 2550 Garcia Avenue Mountain View, CA 94043 TM U.S.A. 1994 Sun Microsystems, Inc., NeXT Computer, Inc. Sunsoft 2550 Garcia Avenue, Mountain View, California 94043-1100 U.S.A. NeXT Computer, Inc. 900 Chesapeake Drive, Redwood City, California 94063 U.S.A. NEXTSTEP Release 3 Copyright 1988-1994 NeXT Computer, Inc. All rights reserved. [6453.00] This product and related documentation are protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or related documentation may be reproduced in any form by any means without prior written authorization of NeXT, Sun and their licensors, if any. Portions of this product may be derived from the UNIX® and Berkeley 4.3 BSD systems, licensed from UNIX System Laboratories, Inc. and the University of California, respectively. Third-party font software in this product is protected by copyright and licensed from NeXT’s Font Suppliers. RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the United States Government is subject to the restrictions set forth in DFARS 252.227-7013 (c)(1)(ii) and FAR 52.227-19. The product described in this publication may be protected by one or more U.S. patents, foreign patents, or pending applications. TRADEMARKS Sun, Sun Microsystems, the Sun logo, SMCC, the SMCC logo, SunSoft, the SunSoft logo, Solaris, SunOS, OpenWindows, DeskSet, ONC, NFS, NetISAM, and ToolTalk are trademarks or registered trademarks of Sun Microsystems, Inc. NeXT, the NeXT logo, NEXTSTEP, the NEXTSTEP logo, OpenStep, NEXTSTEP Developer, ObjectWare, Portable Distributed Objects, and PDO are trademarks or registered trademarks of NeXT Computer, Inc.
    [Show full text]