The nc (or netcat) binary is useful for a variety of TCP or UDP operations. You can open a listener, proxy connections, open a connection to another device, and port scan a device. And you can do it all through TCP and/or UDP, define ports, and scripting with nc is pretty easy. So in the below code we’ll start a while loop and then execute an echo of a header so a browser knows how to interpret what we’re sharing, which is a cat of our file. Then we’ll pipe that into netcat with a -l option so we can define the port and end the loop. while TRUE; do…
-
-
Jamf After Dark Podcast: Conditionally Accessing All The Things
- Mac OS X, Mac OS X Server, Mac Security, MacAdmins Podcast, The History Of Computing, The History Of Computing Podcast
The Origin Of The Blue Meanies
-
Episode 136 of MacAdmins Podcast, Bare Metal with Chris Chapman
-
Episode 128 of the MacAdmins Podcast: Apple’s Been Busy, with Jeremy Butcher of Apple
-
Episode 126 of the MacAdmins Podcast: WWDC After Action Report
-
Pull TeamID and BundleID from KextPolicy in scripts
This type of thing is usually done interactively, but when I’m piping output that doesn’t work. So here’s a quick one-liner in bash for pulling the TeamID and BundleID from kexts out of the KextPolicy sqlite database: sqlite3 /var/db/SystemPolicyConfiguration/KextPolicy "SELECT * from kext_policy;" ".exit"
-
MacAdmins: “Walk Softly But Carry A Mac Deploy Stick” with Tim Perfitt
-
Pull iTunes App Categories via Bash
I love bash one-liners. Here’s one it took me a bit to get just right that will pull the Category of an app based on the URL of the app. curl -s 'https://itunes.apple.com/us/app/self-service-mobile/id718509958?mt=8' | grep -Eo '"applicationCategory":.*?[^\\]",' If you don’t already have the URL for an app, it can be obtained via a lookup using curl https://itunes.apple.com/lookup?id=718509958 If you’ll be performing these kinds of operations en masse from within server-side scripting, Apple has a number of programs, including the Affiliate Program, which allow you to do so more gracefully. But as a quick and dirty part of a script, this could solve a need. More importantly, hey, parse some json…
-
NFS. Not… Dead… Yet…
NFS may just never die. I’ve seen many an xsan covert to NFS-based storage with dedicated pipes and less infrastructure requirements. I’m rarely concerned about debating the merits of technology but usually interested in mapping out a nice workflow despite said merits. So in the beginning… there is rpc. Why? Because before we establish a connection to an nfs share, we first want to check that we can talk to the system hosting it. Do so with rpcinfo: rpcinfo server.pretendco.com Now that we’ve established that we can actually communicate with the system, let’s use the mount command (for more on creating mounts see `man exports`). Here, we’ll mount -t nfs…