Wednesday, January 2, 2019
Friday, December 28, 2018
macOS Mojave as a guest on a virtual machine (Windows or macOS host)
Search for this text: "VBoxManage setextradata":
https://www.insanelymac.com/forum/topic/309654-run-vanilla-os-x-el-capitan-sierra-high-sierra-or-mojave-in-virtualbox-5xx-on-a-windows-host/
https://web.archive.org/web/20181228140310/https://www.insanelymac.com/forum/topic/309654-run-vanilla-os-x-el-capitan-sierra-high-sierra-or-mojave-in-virtualbox-5xx-on-a-windows-host/
https://www.intoguide.com/install-macos-mojave-virtualbox-windows/
https://web.archive.org/web/20181228141002/https://www.intoguide.com/install-macos-mojave-virtualbox-windows/
https://www.insanelymac.com/forum/topic/309654-run-vanilla-os-x-el-capitan-sierra-high-sierra-or-mojave-in-virtualbox-5xx-on-a-windows-host/
https://web.archive.org/web/20181228140310/https://www.insanelymac.com/forum/topic/309654-run-vanilla-os-x-el-capitan-sierra-high-sierra-or-mojave-in-virtualbox-5xx-on-a-windows-host/
https://www.intoguide.com/install-macos-mojave-virtualbox-windows/
https://web.archive.org/web/20181228141002/https://www.intoguide.com/install-macos-mojave-virtualbox-windows/
6.2. Disk Image Files (VDI, VMDK, VHD, HDD)
Disk image files reside on the host system and are seen by the guest systems as hard disks of a certain geometry. When a guest operating system reads from or writes to a hard disk, Oracle VM VirtualBox redirects the request to the image file.
Like a physical disk, a virtual disk has a size, or capacity, which must be specified when the image file is created. As opposed to a physical disk however, Oracle VM VirtualBox enables you to expand an image file after creation, even if it has data already. See Section 9.24, “VBoxManage modifymedium”.
Oracle VM VirtualBox supports the following types of disk image files:
- VDI. Normally, Oracle VM VirtualBox uses its own container format for guest hard disks. This is called a Virtual Disk Image (VDI) file. This format is used when you create a new virtual machine with a new disk.
- VMDK. Oracle VM VirtualBox also fully supports the popular and open VMDK container format that is used by many other virtualization products, such as VMware.
- VHD. Oracle VM VirtualBox also fully supports the VHD format used by Microsoft.
- HDD. Image files of Parallels version 2 (HDD format) are also supported.
Due to lack of documentation of the format, newer versions such as 3 and 4 are not supported. You can however convert such image files to version 2 format using tools provided by Parallels.
- Parallels bundle (
.pvm) or configuration file (.pvs) or virtual hard disk file (.hdd). - VMware configuration file (
.vmx,.vmwarevm) or virtual hard disk file (.vmdk). - Virtual PC configuration file (
.vmc,.vpc7) or virtual hard disk file (.vhd). - VirtualBox configuration file (
.xml) or virtual hard disk file (.vdi).
https://download.parallels.com/desktop/v14/docs/ko_KR/Parallels%20Desktop%20User's%20Guide/32919.htm
https://support.apple.com/en-us/HT201372
TOOL TO CONVERT A VIRTUAL DISK FORMAT TO ANOTHER VIRTUAL DISK FORMAT:
https://www.starwindsoftware.com/starwind-v2v-converter#download
CHANGE RESOLUTION FOR macOS / Mac OS X guest inside Virtualbox:
Example:
$ VBoxManage setextradata "MacOS 10.12 Sierra 64bits" VBoxInternal2/EfiGraphicsResolution 1920x1080
TOOL TO CONVERT A VIRTUAL DISK FORMAT TO ANOTHER VIRTUAL DISK FORMAT:
https://www.starwindsoftware.com/starwind-v2v-converter#download
CHANGE RESOLUTION FOR macOS / Mac OS X guest inside Virtualbox:
Example:
$ VBoxManage setextradata "MacOS 10.12 Sierra 64bits" VBoxInternal2/EfiGraphicsResolution 1920x1080
The default resolution is 1024x768. To select a graphics resolution for EFI, use the following VBoxManage
command:
VBoxManage setextradata "VM name" VBoxInternal2/EfiGraphicsResolution HxV
Wednesday, November 9, 2016
How to use Macintosh Xcode's Instruments application to trace antivirus CPU usage and file activity
http://www.symantec.com/docs/HOWTO36824
https://support.symantec.com/en_US/article.HOWTO36824.html
https://web.archive.org/web/20161109004138/https://support.symantec.com/en_US/article.HOWTO36824.html
https://support.symantec.com/en_US/article.HOWTO36824.html
https://web.archive.org/web/20161109004138/https://support.symantec.com/en_US/article.HOWTO36824.html
Tuesday, November 8, 2016
Check macOS applications and installers digital signatures
https://developer.apple.com/library/content/technotes/tn2206/_index.html
This command:
This command:
$ codesign --verify --deep --strict --verbose=2 Foo.app |
mimics what Gatekeeper does to check your app.
Mount the disk image, then run the tool like this:
$ cd "/Volumes/Signature Check" |
$ ./check-signature /Path/to/Foo.app /Path/to/Bar.pkg |
For each target, the tool will present a simple
YES answer if the signature meets Gatekeeper requirements, or NO if it does not.
Read the error messages carefully, with particular attention to the
in subcomponent: part which, if present, tells you which nested code is giving you problems.
Understand that this validation will stop on many errors, and thus you must repeat it until you run out of problems.
You can also use the
spctl tool to check if Gatekeeper will accept your app's signature. spctl is a command-line interface to the same security assessment policy subsystem that Gatekeeper uses.
Like Gatekeeper,
spctl will only accept Developer ID-signed apps and apps downloaded from the Mac App Store by default. It will reject apps signed with Mac App Store development or distribution certificates.
Run
spctl on your app like this:$ spctl -a -t exec -vv Foo.app |
This is the output if your app's signature will be accepted:
Foo.app: accepted |
source=Developer ID |
source will be Mac App Store for apps downloaded from the Mac App Store.
If
spctl shows any result other than accepted, you must re-sign your app on Mavericks or later to ensure Gatekeeper compatibility.Check Apple macOS disk images signature
https://developer.apple.com/library/content/technotes/tn2206/_index.html
$ spctl -a -t open --context context:primary-signature -v MyImage.dmg |
/Users/me/Downloads/MyImage.dmg: accepted |
source=Developer ID |
Sunday, July 19, 2015
Tool to check if Mac OS X Applications and Packages are correctly signed
RB App Checker Lite - Version 1.1.2 (311)
( https://web.archive.org/web/*/http://brockerhoff.net/RB/AppCheckerLite/ )
( https://web.archive.org/web/*/http://brockerhoff.net/RB/AppCheckerLite/ )
RB App Checker Lite helps users and developers to check code signatures and receipts for applications from any source. It will show certificates, requirements and entitlements, cross-check all this information for consistency, and check that the application’s resources have not been altered after signing.
Check if your application is properly signed before submitting it to the App Store or publishing it elsewhere, or if the application you downloaded has been tampered with.
For your convenience, RB App Checker Lite also publishes a Service (right-click on any application in the Finder) and has a fast-select menu for all running applications.
RB App Checker Lite will also work for Xcode archives, iOS .ipa app bundles, frameworks, command-line executables, and most other bundles containing executable code.
The results will be shown as a text report, with pop-up buttons explaining details.
It does not use the codesign tool or any developer-exclusive software.
The Direct Download version (only) will show the Gatekeeper assessment via spctl.
Verify / Check validity of Mac OS X Applications and Packages (.pkj) Digital Signatures
How to verify the authenticity of manually downloaded Apple software updates
( https://web.archive.org/web/*/https://support.apple.com/en-us/HT202369 )
Verifying that a Package is Signed
( https://web.archive.org/web/20150719094756/https://jamfnation.jamfsoftware.com/article.html?id=299 )
Code Signing Tasks
( https://web.archive.org/web/*/https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html )
OS X Code Signing In Depth
( https://web.archive.org/web/*/https://developer.apple.com/library/mac/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG211 )
( https://web.archive.org/web/*/https://support.apple.com/en-us/HT202369 )
Verifying that a Package is Signed
( https://web.archive.org/web/20150719094756/https://jamfnation.jamfsoftware.com/article.html?id=299 )
Code Signing Tasks
( https://web.archive.org/web/*/https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html )
OS X Code Signing In Depth
( https://web.archive.org/web/*/https://developer.apple.com/library/mac/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG211 )
Uninstall / Install Microsoft Office 2016 for Mac
Install Office 2016 for Mac with your Office 365 Home, Personal, or University account
( https://web.archive.org/web/20150719091923/https://support.office.com/en-us/article/Install-Office-2016-for-Mac-with-your-Office-365-Home-Personal-or-University-account-299c3f95-3551-4e60-a9cf-7380457d8e37?ui=en-US&rs=en-US&ad=US )
Uninstall Office 2016 for Mac
( https://web.archive.org/web/20150719092215/https://support.office.com/en-us/article/Uninstall-Office-2016-for-Mac-eefa1199-5b58-43af-8a3d-b73dc1a8cae3?ui=en-US&rs=en-US&ad=US )
Troubleshoot Office 2016 for Mac issues by completely uninstalling before you reinstall
( https://web.archive.org/web/20150719092414/https://support.office.com/en-us/article/Troubleshoot-Office-2016-for-Mac-issues-by-completely-uninstalling-before-you-reinstall-ec3aa66e-6a76-451f-9d35-cba2e14e94c0 )
Uninstall Office 2011 from a Mac
( https://web.archive.org/web/20150719092538/https://support.office.com/en-gb/article/Uninstall-Office-2011-from-a-Mac-ba8d8d13-0015-4eea-b60b-7719c2cedd17 )
Office 2016 for Mac – July 9, 2015 update
( https://web.archive.org/web/20150719091923/https://support.office.com/en-us/article/Install-Office-2016-for-Mac-with-your-Office-365-Home-Personal-or-University-account-299c3f95-3551-4e60-a9cf-7380457d8e37?ui=en-US&rs=en-US&ad=US )
Uninstall Office 2016 for Mac
( https://web.archive.org/web/20150719092215/https://support.office.com/en-us/article/Uninstall-Office-2016-for-Mac-eefa1199-5b58-43af-8a3d-b73dc1a8cae3?ui=en-US&rs=en-US&ad=US )
Troubleshoot Office 2016 for Mac issues by completely uninstalling before you reinstall
( https://web.archive.org/web/20150719092414/https://support.office.com/en-us/article/Troubleshoot-Office-2016-for-Mac-issues-by-completely-uninstalling-before-you-reinstall-ec3aa66e-6a76-451f-9d35-cba2e14e94c0 )
Uninstall Office 2011 from a Mac
( https://web.archive.org/web/20150719092538/https://support.office.com/en-gb/article/Uninstall-Office-2011-from-a-Mac-ba8d8d13-0015-4eea-b60b-7719c2cedd17 )
Office 2016 for Mac – July 9, 2015 update
Tuesday, November 18, 2014
Wednesday, November 5, 2014
Microsoft Bluetooth Mouse connections problems in Windows 7 - it loses Bluetooth connectivity
http://sherylcanter.com/wordpress/2010/01/bluetooth-mouse-losing-connection-no-more/
http://web.archive.org/web/20140914185158/http://sherylcanter.com/wordpress/2010/01/bluetooth-mouse-losing-connection-no-more/
http://support.microsoft.com/kb/2758967
http://web.archive.org/web/20130723022311/http://support.microsoft.com/kb/2758967
Monday, November 3, 2014
Bodensee region
http://statistik-bodensee.org/tl_files/statistik/downloads/publikationen/Die%20internationale%20Bodenseeregion%20in%20Zahlen/Die_internationale_Bodenseeregion_in_Zahlen.pdf
https://web.archive.org/web/20140728221457/http://statistik-bodensee.org/tl_files/statistik/downloads/publikationen/Die%20internationale%20Bodenseeregion%20in%20Zahlen/Die_internationale_Bodenseeregion_in_Zahlen.pdf
https://web.archive.org/web/20140728221457/http://statistik-bodensee.org/tl_files/statistik/downloads/publikationen/Die%20internationale%20Bodenseeregion%20in%20Zahlen/Die_internationale_Bodenseeregion_in_Zahlen.pdf
Saturday, November 1, 2014
Convert a Microsoft Hyper-V virtual hard disk file in the new VHDX format to the old VHD format using VirtualBox Manager
http://devhacksandgoodies.wordpress.com/2014/08/07/vhdx-to-vhd-on-windows-7-using-virtualbox-manager/
http://superuser.com/questions/751954/how-to-convert-a-vhdx-file-to-vhd
http://serverfault.com/questions/567283/convert-hyper-v-vhdx-file-for-import-into-vhd-file-for-xenserver-import
http://needs-be.blogspot.de/2014/10/virtualizing-windows-on-physical.html
C:\Program Files\Oracle\VirtualBox\VBoxManage.exe clonehd --format VHD ubuntu-test.vhdx ubuntu-test.vhd
VBoxManage.exe clonehd "PATH_TO_YOUR_FILE.VHDX" --format VHD "PATH_TO_CONVERTED_FILE.vhd"
vboxmanage clonehd filename.vhdx filename.vhd -format vhd
vboxmanage clonehd MYDATAFILE.VHDX --format VHD mydatafile.vhd
vboxmanage clonehd d:\path\MYDATAFILE.VHDX --format VHD e:\path\mydatafile.vhd
http://superuser.com/questions/751954/how-to-convert-a-vhdx-file-to-vhd
http://serverfault.com/questions/567283/convert-hyper-v-vhdx-file-for-import-into-vhd-file-for-xenserver-import
http://needs-be.blogspot.de/2014/10/virtualizing-windows-on-physical.html
C:\Program Files\Oracle\VirtualBox\VBoxManage.exe clonehd --format VHD ubuntu-test.vhdx ubuntu-test.vhd
VBoxManage.exe clonehd "PATH_TO_YOUR_FILE.VHDX" --format VHD "PATH_TO_CONVERTED_FILE.vhd"
vboxmanage clonehd filename.vhdx filename.vhd -format vhd
vboxmanage clonehd MYDATAFILE.VHDX --format VHD mydatafile.vhd
vboxmanage clonehd d:\path\MYDATAFILE.VHDX --format VHD e:\path\mydatafile.vhd
Sunday, October 26, 2014
Shopping centers around Lake Constance
http://www.thelabelfinder.com/st.-gallen/shopping-centers/CH/2658822
http://web.archive.org/web/20141025224939/http://www.thelabelfinder.com/st.-gallen/shopping-centers/CH/2658822
http://multiplottr.com/?map_id=61643
http://web.archive.org/web/20141025225158/http://multiplottr.com/?map_id=61643
http://web.archive.org/web/20141025224939/http://www.thelabelfinder.com/st.-gallen/shopping-centers/CH/2658822
http://multiplottr.com/?map_id=61643
http://web.archive.org/web/20141025225158/http://multiplottr.com/?map_id=61643
Friday, October 24, 2014
Mac OS X File System monitoring
http://www.sans.org/reading-room/whitepapers/forensics/mac-os-malware-analysis-33178
web.archive.org/web/20131109083313/http://www.sans.org/reading-room/whitepapers/forensics/mac-os-malware-analysis-33178?
http://hints.macworld.com/article.php?story=20091223115101622
web.archive.org/web/20130517065706/http://hints.macworld.com/article.php?story=20091223115101622
http://www.fernlightning.com/doku.php?id=software:fseventer:start
web.archive.org/web/20141010113945/http://www.fernlightning.com/doku.php?id=software:fseventer:start
http://hints.macworld.com/article.php?story=20091223115101622
http://web.archive.org/web/20130517065706/http://hints.macworld.com/article.php?story=20091223115101622
http://hints.macworld.com/article.php?story=20080707071246118
http://web.archive.org/web/20141010105454/http://hints.macworld.com/article.php?story=20080707071246118
http://www.codez4mac.com/forum/viewtopic.php?f=92&t=18337&hilit=post+box&sid=093d29e3e989cb178dc5b7fc3f5b4a02
http://web.archive.org/web/20141025084343/http://www.codez4mac.com/forum/viewtopic.php?f=92&t=18337&hilit=post+box&sid=093d29e3e989cb178dc5b7fc3f5b4a02
http://hints.macworld.com/article.php?story=20091223115101622
web.archive.org/web/20130517065706/http://hints.macworld.com/article.php?story=20091223115101622
http://www.fernlightning.com/doku.php?id=software:fseventer:start
web.archive.org/web/20141010113945/http://www.fernlightning.com/doku.php?id=software:fseventer:start
http://hints.macworld.com/article.php?story=20091223115101622
http://web.archive.org/web/20130517065706/http://hints.macworld.com/article.php?story=20091223115101622
http://hints.macworld.com/article.php?story=20080707071246118
http://web.archive.org/web/20141010105454/http://hints.macworld.com/article.php?story=20080707071246118
http://www.codez4mac.com/forum/viewtopic.php?f=92&t=18337&hilit=post+box&sid=093d29e3e989cb178dc5b7fc3f5b4a02
http://web.archive.org/web/20141025084343/http://www.codez4mac.com/forum/viewtopic.php?f=92&t=18337&hilit=post+box&sid=093d29e3e989cb178dc5b7fc3f5b4a02
Wednesday, October 8, 2014
Convert a physical Mac OS X installation to a virtual machine running as a guest in VMware Fusion
http://fortysomethinggeek.blogspot.de/2013/03/convert-physical-mac-into-vm-guest.html
https://web.archive.org/web/20141008004656/http://fortysomethinggeek.blogspot.de/2013/03/convert-physical-mac-into-vm-guest.html
https://web.archive.org/web/20141008004656/http://fortysomethinggeek.blogspot.de/2013/03/convert-physical-mac-into-vm-guest.html
Monday, October 6, 2014
Friday, October 3, 2014
Tuesday, August 19, 2014
MacEnterprise: Packaging for System Administrators
http://www.mactech.com/articles/mactech/Vol.25/25.03/2503MacEnterprise-PackagingforSystemAdministrators/index.html
Find files created or modified by an installer in Mac OS X
http://hints.macworld.com/article.php?story=20091223115101622
Saturday, October 19, 2013
Absolute Manage InstallEase / http://www3.absolute.com/products/InstallEase
http://www3.absolute.com/products/InstallEase
InstallEase
InstallEase allows you to create customized installer software packages for Windows and Mac OS X. The wizard-based program takes all the confusion out of custom package creation for a fast, efficient process - freeing up IT resources to focus on the more critical management tasks.
Control the files to be installed with InstallEase and then deploy the package using Absolute Manage for a fully automated and coordinated process.
InstallEase is available for Absolute Manage customers and prospects. Anyone who is using or evaluating our technology will benefit. Read the Info Sheet for more information or download InstallEase free of charge (registration required).
InstallEase Features:
- Automated Snapshots - Before / After
- Manual Package Creation
- Home Folder File Installation
- Exclusion Filters
- Uninstaller PKG's
- Graphical User Interface
- Output to mutiple formats
http://www3.absolute.com/products/InstallEase
MacEnterprise: Packaging for Distribution / Building Installer packages for software distribution
http://www.mactech.com/articles/mactech/Vol.25/25.01/2501MacEnterprise-PackagingforDistribution/index.html
by Greg Neagle, MacEnterprise.org
Packing things up
Previously in MacTech, we looked at modifying Firefox in order to implement custom default preferences. This involved modifying several files inside the application bundle. If you made similar modifications for your environment, you'd then be faced with the next task: distributing the modified application to all your managed machines.
There are many ways to distribute software to Mac OS X machines, but most commercial products - Apple's and third-parties' - rely on Apple Installer packages to install and update software. This can be a convenient approach when the software you want to distribute is already packaged in that format, but you'll find there are several situations in which you need to create your own Installer packages:
1. The software is not distributed in Apple package format by the vendor, and your software distribution mechanism does not support the alternate format.
2. The vendor uses the Apple package format but the package will not install without user input - or, stated a different way, the package cannot be installed "silently".
3. You need to make changes in the files that are distributed, or distribute additional files.
4. You have internally-developed software that must be distributed. If you're lucky, your internal developer will package it for you. If you're not lucky, or you are the developer, then you need to do it.
Therefore, packaging software for distribution is a common task for OS X administrators. Fortunately, there are a lot of available tools to help you with this task.
Packaging Tools
A partial and by no means complete list of packaging and related tools for OS X in no particular order:
PackageMaker
This is Apple's utility for creating packages. It is available as part of the Xcode Tools, and also included with the Server Admin Tools. It can create every package format supported by Apple: old-style bundle packages, new-style flat packages, metapackages, distribution packages, and hybrid packages that work on multiple OS versions. The link above is for the 10.5.5 release of the Server Admin Tools; there may well be a newer release by the time this article reaches print.
Pros: PackageMaker is a supported Apple tool and is free. Many of the other tools rely on PackageMaker for at least some of their functionality.
Cons: It's hard to use, and had a history of buggy releases.
Iceberg
Iceberg is freeware by Stéphan Sudre, licensed with a BSD-style license. Capable and well-documented, Iceberg is very popular among Mac OS X administrators. It can create packages and metapackages, but not the newer distribution packages and flat packages.
Pros: Easy to use and free. It supports creation of packages from filesystem snapshots, as well as manual assembly of package contents.
Cons: Iceberg's installer installs a StartupItem that launches an always-on background task. This makes some admins uncomfortable.
LANrev InstallEase
LANrev, the maker of a cross-platform system management tool, recently made their InstallEase package creation utility freely available.
Pros: Ease of use, the ability to export Iceberg project files, and the creation of "uninstall" packages - packages that will uninstall software installed by another package. Creation of packages from filesystem snapshots.
Cons: It does not work standalone. To actually create packages, you must have Apple's PackageMaker and/or Iceberg installed as well.
Casper Composer SE
Composer is a $100 utility from JAMF Software. Part of the Casper Suite of OS X client management tools, Composer is also available separately. Casper Composer creates packages based on filesystem snapshots. When used with the Casper suite, it can create installation packages with extra abilities such as installing default preferences into users' home directories.
Pros: Easy to use. Good documentation.
Cons: It's not free. Casper Composer requires Apple's PackageMaker to build standard Apple packages. Composer's special package features work only with other tools in the Casper Suite.
Helpful tools:
logGen
logGen is freeware from the University of Michigan, by Phil Holland and Dave Pugh. It is a command-line utility for finding filesystem changes. You could use it as part of a package creation workflow together with pkgGen (described below) and PackageMaker.
pkgGen
This is a script by Zack Smith that parses the output of logGen and creates a "fauxroot" directory containing all the files and directories found by logGen. This fauxroot directory can then be used by PackageMaker or Iceberg to create an Installer package. The workflow would look something like:
- Run logGen to create a "before" snapshot.
- Install and configure software.
- Run logGen to create an "after" snapshot and differences list.
- Edit the differences list to remove unwanted items.
- Run pkgGen with the edited difference list to create a fauxroot directory with copies of all needed files and directories.
- Run PackageMaker and use the fauxroot directory to create your package.
Example Packaging Workflow
Let's use one of the tools to build an installation package for our modified Firefox. I'll use LANrev InstallEase for this example.
We'll start by assuming you already have an appropriately modified version of Firefox on your system, and have downloaded and activated a copy of InstallEase from LANrev's website.
Launch InstallEase.
Wednesday, April 10, 2013
How activate Windows 8 with KMS Server?
http://hackwindows8.blogspot.com/2012/10/how-activate-windows-8-through-publicly.html
For Windows 8 Enterprise: slmgr /skms
slmgr.vbs -ato
For Windows 8 Professional:
slmgr.vbs -ipk NG4HW-VH26C-733KW-K6F98-J8CK4
slmgr /skms
slmgr.vbs -ato
For Windows 8 Enterprise: slmgr /skms
Sunday, November 4, 2012
Mac OS X shell scripts / Automating Terminal Commands in Mac OS X with Bash
http://jonlandrum.com/2012/01/28/automating-terminal-commands-in-mac-os-x-with-bash/
Coming from the Linux world, Mac was somewhat familiar to me, yet somewhat foreign. One such example is the system hides most of the files and directories I was accustomed to seeing and using as a Linux user. Also, the terminal commands to show and re-hide these directories don’t follow standard Unix terminal syntax. So I had to do some researching to find what the commands even are, and then I could put them in a Bashscript that could be run with a single click. But first, the commands:
defaults write com.apple.finder AppleShowAllFiles TRUEkillall Finderkillall Terminal |
The first line is the business end, the second one restarts Finder with the new setting, and the last makes sure Terminal closes afterward. And you can type these in a Terminal window right now and get the desired results. But what about automating this? Instead of typing all this out — and possibly misspelling it a time or two (ask me how I know) — let’s make a shell script that contains the commands, and keep it in our user directory for easy access:
1
2
3
4
| #!/bin/bashdefaults write com.apple.finder AppleShowAllFiles TRUEkillall Finderkillall Terminal |
The only difference this time is the new first line. That specifies which shell we’re using, in this case Bash. It’s called the shebang line, and it tells Terminal which program to use to interpret the commands. Copy and paste those three lines into TextEdit or your favorite text editor, and save it as
show.sh or something similar. Then change the “TRUE” to “FALSE” at the end of the second line, like this:
1
2
3
4
| #!/bin/bashdefaults write com.apple.finder AppleShowAllFiles FALSEkillall Finderkillall Terminal |
and save that as
hide.sh or something similar. Put these two files in your user root directory, in the same place where your Documents, Desktop, Music, and Pictures folders are.
An example directory layout. Put show.sh and hide.sh in your user root like this.
Next we have to make them executable. Open Terminal (it will already be
cd’d to your user root directory) and enter this command:$ chmod +x show.sh && chmod +x hide.sh |
This will make our two files executable. Now give them a whirl:
$ ./show.sh$ ./hide.sh |
The
./ tells Terminal to run that program. This should open your Finder window with hidden files and directories showing, but faded to show you the difference. And when you run hide.sh Finder will close and reopen, with those files and directories hidden. If that’s what you got, then continue to the final step to make them clickable. If not, go back through this tutorial and start from scratch. Make sure you’ve typed everything correctly.
The last step is open a Finder window and select
show.sh, then type Command-i to bring up the information menu. Under the “Open with:” dropdown, select “Other…”, and in the window that pops up, scroll to the bottom to the “Utilities” directory, open that, and then scroll to Terminal and select it.
You may have to change the “Enable:” menu from “Recommended Applications” to “All Applications” in order to select it. Tick the “Always Open With” checkbox, and click “Add”. Repeat this last step for
hide.sh.
Double-click
show.sh and confirm it works, then do the same for hide.sh. If everything works as expected, you’re all set! You can access these programs from the command line or from Finder the way you’ve done just now.
If you have other commands you’d like to automate, you can simply replace what’s in either of these scripts with that command, save it as a new
.sh file, make it executable, set it to open with Terminal, and you’re golden. For timed automation, you can even have these programs run with cron so that they’re executed for you on a regular schedule. How’s that for automation?
~Jonathan
Subscribe to:
Posts (Atom)