Emacs (not eMacs) is an open source project, bundled with every version of OS X. And it can’t be altered. I wrote about the Cookies recipe that Richard Stallman bundled with Emacs long ago. He also has some somewhat sexist dating tips and a bunch of other weird rantings that he bundled in there. But perhaps the best contribution is the games that Emacs comes with. These include doctor, dunnet (which would have been a great MMPORG), pong, snake, solitaire, tetris and the ever-so-popular gomoku.
These games are located in the /usr/share/emacs/22.1/lisp/play directory. But you don’t access the games directly. Instead, you use the emacs command. To get started, fire up Terminal, then run the emacs command:
At the M-x prompt, type the name of the game I listed above that you’d like to play.
Here, we’ll type snake.
Press the Enter key and then you will be in the game.
When it’s over, hit escape, then x and then type the name of the next game if you’d like to, such as tetris.
krypted August 20th, 2015
Posted In: Mac OS X
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:
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:
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:
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.
krypted August 14th, 2015
Apple Configurator is a great tool to manage iOS devices. It’s also a pretty decent tool when you need to create profiles for use on Macs. Apple Configurator is easily installed using the Mac App Store. This involves 3 workflows:
However you plan on using Apple Configurator, the first step to use the product is to download it for free and install it on an OS X computer. To install Apple Configurator, first open the App Store and search for Apple Configurator.
When listed, click on Apple Configurator.
Then click on Get, then click on Install App. If prompted for your Apple ID, provide it.
This downloads Apple Configurator to the /Applications directory on your computer. Once installed, open Apple Configurator and click on Prepare to get started with the product. I’ve done a series of articles at http://krypted.com/guides/apple-configurator/ to help guide you through the process of getting comfortable with Apple Configurator.
krypted August 12th, 2015
Posted In: Apple Configurator
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.
krypted August 9th, 2015
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
krypted July 31st, 2015
I mess computers up a lot. And that means I have to reload operating systems a lot. I’ve also been having terrible issues caused by autocorrect. So… Let’s disable it. By sending the NSAutomaticSpellingCorrectionEnabled key as a false boolean into NSGlobalDomain:
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
krypted July 27th, 2015
By default in OS X, when you change an extension for a file, you get a warning. This is somewhat annoying to me, as I do this pretty frequently and have never almost accidentally done so. So to disable, send a FXEnable ExtensionChangeWarning key into com.apple.finder as false:
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
To then undo, simply run with a true key:
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool true
krypted July 22nd, 2015
As of OS X 10.9 (and in many cases more importantly in OS X Server for 10.9 and higher), OS X now performs ARP cache validation when trying to pass traffic over a router. If you are double NAT’d/use redundant gateways then the traffic can be interpreted as network redirection and cause some pretty bad packet loss/latency. You can disable this feature by turning off net.link.ether.net.arp_unicast_lim using sysctl:
sysctl -w net.link.ether.inet.arp_unicast_lim=0
That will only disable unicast arp validation until the next reboot. If it fixes a latency problem you’re having then you can go ahead and make it permanent by adding the following line into /etc/sysctl.conf:
If you’re still having issues with latency, you should turn it back on. To enable it again, repeat, swapping the 0 with a 1.
krypted July 19th, 2015
For a long time, we used the bless command to startup systems to a specific volume in OS X. Back in 2009 I started using the systemsetup command for more and more tasks. These days, I’m being guided to replace all of my bless options in scripts to systemsetup. The easy way to configure your startup volumes using systemsetup is to list the available volumes, set one as the startup volume and then check to see which one is the current volume. The first task is to list the available startup volumes, using the -liststartupdisks option:
sudo systemsetup -liststartupdisks
You can then set the disk as one that was listed by the above command:
sudo systemsetup -setstartupdisk /Volumes/HAVOKMELTDOWN
You can finally check the current startup disk as a sanity check in your script to verify the desired disk is the startup volume using -getstartupdisk
sudo systemsetup -getstartupdisk
krypted July 15th, 2015