The xxd is a bash command in Linux and macOS that is used to take a hexdump (convert a string to hex), or convert hex back to a string. To use xxd, just call it with a couple of options. Below, we’ll use the -p option to export into plain hexdump, and we’ll quote it and the <<< is to take input rather than a file name to convert (the default behavior), as follows: xxd -p <<< "hey it's a string" The output would be a hex string, as follows: 6865792069742773206120737472696e670a Then use the -r option to revert your hex back to text. Since xxd doesn’t allow for a positional…
-
-
MacADUK Videos Now Available
The videos from the MacADUK sessions are now available on the Internets! Including such great sessions as “What’s New With Managing macOS and iOS” from Marko Jung, “Something something commercial, something something open source” from Graham Gilbert, “Desired State Management Through Automation with Jamf Pro” from John Kitzmiller, “Advanced Mac Software Deployment and Configuration – Just Make it Work” from Tim Sutton, “Securing the Managed Environment – you, me, and everybody” from Pepijn Bruienne, “Munki and Patch. A Comparison” from Ben Toms & James Ridsdale, “Locking down macOS without Locking Up Users (The Sequel)” from Samuel Keeley. Totes fun! Watch them at https://online-training.amsys.co.uk/courses/macaduk-2017
-
Episode 26 Of The MacAdmins Podcast :: Public Speaking With Nadyne and John Welch
-
Programmatically Grab Active DNS Servers On macOS
One of my favorite things about grabbing things with scripts is just how many ways (and sometimes how needfully or needlessly convoluted you can make them) to grab the same pieces of information. For example, something as simple as what hosts you use to resolve names on a Mac. There are a number of ways to grab what DNS server a device is using in macOS. So when you’re running a script you might choose to grab DNS information one way or another, according to what you’re after. Some of this might seem more complicated than it should be. And that’s correct… resolv.conf The /etc/resolv.conf file is updated automatically to…
-
Basic Bash Functions
According to @johnkitzmiller, you can’t spell function without fun. So let’s have some fun! What’s a function? Think of it as a script inside a script. Define functions at the beginning of the script instead of making repeated calls to the same task within a script. The other nice thing about functions is that the act of compartmentalization makes them simple to insert into a number of different scripts. For example, if you do a lot of curl commands to pull down something in a lot of different scripts, having the grabbing of the data as a function, then the parsing of it into an array as a function and…
-
Cookie Management With Curl
To tell curl that you can read and write cookies, first we’ll start the engine using an empty cookie jar, using the -b option, which always reads cookies into memory: curl -b newcookiejar https://krypted.com If your site can set cookies you can then read them with the -L option curl -L -b newcookiejar https://krypted.com The response should be similar to the following: Reading cookies from file Curl also supports reading cookies in from the Netscape cookie format, used by defining a cookies.txt file instead: curl -L -b cookies.txt https://krypted.com If the server updates the cookies in a response, curl would update that cookie in memory but unless you write something…
-
Backup Filewave Databases
You can quickly and easily back up your Filewave databases using the fwcontrol command to stop a Filewave server (thus preserving the integrity of the data you are backing up) and then backing up the database using the /fwxserver directory. To get started, we’ll first down the server. This is done using the fwcontrol command along with the server option and the stop verb, as follows: sudo fwcontrol server stop Now that there won’t be data trying to commit into the database, let’s make a backup of the database directory using the cp command: cp -rp /fwxserver/DB ~/Desktop/Databasebak To start the database, use the decontrol command with the server option…
-
My Slides On MDM From MacAD.UK
As promised, here’s the slide deck from my talk at MacAD.UK in London. Enjoy! MacADUK_MDM_2017
-
Decrease Time Delays When Scripting Safari
When you’re regression testing, you frequently just don’t want any delays for scripts unless you intentionally sleep your scripts. By default Safari has an internal delay that I’d totally forgotten about. So if your GUI scripts (yes, I know, yuck) are taking too long to run, check this out and see if it helps: defaults write com.apple.Safari WebKitInitialTimedLayoutDelay 0 With a script I was recently working on, this made the thing take about an hour less. Might help for your stuffs, might not. If not, to undo: defaults delete com.apple.Safari WebKitInitialTimedLayoutDelay Enjoy.
-
App Translocation Services In OS X 10.12
The “What’s New in macOS” page for Sierra (10.12) lays out a little known change that a colleague at Jamf was working on the other day (hat tip to Brock): Starting in macOS 10.12, you can no longer provide external code or data alongside your code-signed app in a zip archive or unsigned disk image. An app distributed outside the Mac App Store runs from a randomized path when it is launched and so cannot access such external resources. To provide secure execution, code sign your disk image itself using the codesign tool, or distribute your app through the Mac App Store. For more information, see the updated revision to…