krypted.com

Tiny Deathstars of Foulness

I’ve been underwhelmed (if that’s a word) by the list of common ports used on the Apple platform recently, so I started my own. It’s available at http://krypted.com/guides/common-apple-ports/ if you’re interested. It’s also under the Tools menu of the site. And yes, I’m aware that I can cat /etc/services; this includes some rudimentary notes.

August 17th, 2015

Posted In: Mac OS X, Mac OS X Server, Mac Security

Tags: , , , , , , , , ,

Leave a Comment

Recently, I had a bit of a problem with some code I was sending back and forth through Messages. This was caused by smart quotes, which replace single and double quotation marks with directional quotation marks. This can cause a lot of problems. To disable smart quotes:

defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false

August 16th, 2015

Posted In: Mac OS X, Mac OS X Server, Mac Security, Mass Deployment

Tags: , , , , ,

Leave a Comment

We tend to use a lot of commands in the Terminal app. That is, after all, what it’s there fore. And there’s a nice history of what we do. There are also a number of ways to view and manage the bash history. The simplest of which is the history command, which will show the previous commands run. Here, we’ll simply run it:

history

Keep in mind that this shows the history based on context, so if you sudo bash, you’ll potentially see a different history. You can also use the bash built-in fc command, which has the additional awesomeness of being able to edit and re-run commands from the history. To start, we’ll simply look at showing the last 16 commands using the -l option:

fc -l

You can also constraint entries in the output by specific line numbers. For example, to see lines 12 through 18, simply use them as the first two positions of the command after fc:

fc 12 18

You can load the history into an editor and remove or add entries using fc without any options:

fc

To exit the editor, hit control-z. I’ve written in the past about using substitution. For example, sudo !! to run the last command. fc can do some basic substitution as well. For example, use the -s to start substation and then enter a string, which will append whatever you like before a command. So the following would put sudo in front and re-run the previous command:

fc -s sudo

And let’s say that you were doing a find for a string of krypted. To then swap that string with charles:

fc -s krypted=charles

Overall, the bash history can be incredibly useful. I frequently pipe the output of a series of lines into a new file with a .sh at the end as a starting point for scripts and use these substitution options to save myself a bunch of time not retyping longer commands. Enjoy.

August 14th, 2015

Posted In: Mac OS X, Mac OS X Server, Mac Security, Mass Deployment, Ubuntu, Unix

Tags: , , , , , , , ,

I missed posting this one back in November. I’m slow… It’s from an interview I did a little while back. http://tech.mn/news/2014/11/04/jamf-software-bushel-apple-device-management/

Screen Shot 2015-08-11 at 11.15.17 AM

Mostly, these are placeholders so I can find interviews I’ve done easily… #bushel

August 11th, 2015

Posted In: Bushel, Interviewing, Mac OS X, Mac OS X Server, Mac Security, Mass Deployment

Tags: , , , , , ,

There’s a quick and easy IT Business Edge slideshow at http://www.itbusinessedge.com/slideshows/the-5-mobile-apps-you-really-need-for-smb-success.html that I helped with about 5 Mobile Apps You Really Need for SMB Success.

Screen Shot 2015-08-10 at 2.55.35 PM

Hope you enjoy!

August 10th, 2015

Posted In: Bushel, iPhone, Mac OS X, Mac OS X Server, Mac Security, Mass Deployment, Network Infrastructure

Tags: , , , ,

Little article I/Bushel contributed to from Tech Republic covering considerations for small businesses looking to move to the Apple platform. It’s available at http://www.techrepublic.com/article/5-considerations-for-smbs-that-want-to-move-to-apple/#ftag=RSS56d97e7.

Screen Shot 2015-08-10 at 3.01.19 PM

August 9th, 2015

Posted In: Articles and Books, Interviewing, iPhone, Mac OS X, Mac OS X Server, Mac Security, Mass Deployment

Tags: , , , , ,

I’ve always found the easiest way to script the volume of an OS X computer (and when I say volume I mean sound level, not a logical volume created from partitioning a hard drive – but I have articles for scripting those as well) is using the osascript command to invoke an Applescript command that sets the volume to zero. To put some syntax around this:

osascript -e "set volume 0"

August 6th, 2015

Posted In: Mac OS X, Mac OS X Server, Mac Security, Mass Deployment

Tags: , , , , ,

You can query whether a process is running by name. You can do this with ps and pipe the output to grep. It’s not hard, but you can do this more quickly with pgrep. You can also kill that process with pkill. Which includes the ability to send a signal.

So, let’s look at closing down iTunes with pkill:

pkill iTunes

Or we can send it with a signal (9):

pkill -9 iTunes

Or you could just grab the pid of a process by name:

pgrep Safari

It might display:

797

And that’s it. Easy Peasy.

August 2nd, 2015

Posted In: Mac OS X, Mac OS X Server, Mac Security, Mass Deployment

Tags: , , , ,

Safari has a bookmarks bar. Some people want to hide it. A lot of people used to do stuff like this by modifying the default user template in OS X. Not something we’ll be doing much in the future. So to do so with a script:

defaults write com.apple.Safari ShowFavoritesBar -bool false

To turn it back on:

defaults write com.apple.Safari ShowFavoritesBar -bool true

July 31st, 2015

Posted In: Mac OS X, Mac OS X Server, Mac Security, Mass Deployment

Tags: , , , , ,

You can easily accept user provided input in bash by using the read command in bash for Linux and OS X. Here, we’ll echo out a choice to a user in a script, read the output into a variable called yn and then echo out the response:

echo "Please enter y or n: "
read yn
echo "You chose wrong: $yn"

Here, we used echo to simply write out what was chosen in the input. But we could also take this a little further and leverage a case statement to then run an action based on the choice selected:

read -p "Should the file extension change warning be disabled (y/n)? " yn
case ${yn:0:1} in
y|Y )
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
echo "The warning has been disabled"
;;
* )
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool true
echo "The warning has been enabled"
;;
esac

The options when scripting are pretty much infinite and chances are, if you’ve written any scripts, you’ll know of a better way to do this than how I’ve always done it. One of the great things about scripting is the fact that there’s always a better way. So feel free to throw any of your examples into the comments!

July 28th, 2015

Posted In: Mac OS X, Mac OS X Server, Mac Security, Ubuntu, Unix

Tags: , , , , , , , ,

Next Page »