Who Needs Root When You Can Have Simple Finder

Here’s the thing: I’m not very good with computers. So to keep me from hurting myself too badly, I need the simplest interface available that allows me to run multiple applications. But most of the command keys shouldn’t work in this interface and I should only have Finder, file and Help menus. Luckily for my poor MacBook Airs, Apple thought of people like me when they wrote the Finder and invented something called Simple Finder which makes OS X even simpler than it is by default to use. To enable Simple Finder, just go to Parental controls, enable controls for a user and then check the box for Simple Finder. Or, if you have an entire population of users like me, who simply can’t be trusted with a full operating environment, you can send the InterfaceLevel key with the contents of simple (easy to remember for those of us who resemble said key) to com.apple.finder and restart our friendly neighborhood Finder: defaults write com.apple.finder InterfaceLevel simple; killall Finder Come to think of it, maybe I’m not so awful. Let’s say I want to turn that whole Simple Finder thing right back off. Well, all we have to do is delete that key we created and then restart the Finder: defaults delete com.apple.finder InterfaceLevel; killall Finder Actually, I am terrible with these things. So much so that it’s not appropriate for me to use a computer. Therefore, just take it away. I’ll be better off using that Samsung with Windows 8 for awhile. At least there, I won’t be able to get any of my apps open or find any of the administrative tools that could damage the computer!

Can't Undo Deletes in Kerio

When you setup a Kerio server, by default there’s a feature called AutoExpunge. This feature keeps mail clients from showing a message with a strikethrough through it when a message is marked for deletion. Once items are processed the message is moved to deleted and the strikethrough message is removed from the folder it was deleted from. Many users can get confused by this, so Kerio built a feature called AutoExpunge. That AutoExpunge feature instead of striking through messages just tosses them. That causes you to be unable to undo a delete. To disable AutoExpunge, stop Kerio Mail Server and then look for AutoExpungeOnDelete option in /usr/local/Kerio/mailserver/mailserver.cfg (I like to back that file up before making any changes). Then change the value for that from 1 to 0. Then save your changes to the file and start Kerio Connect back up. Once started, test that you can undo a delete and if so, you’re good to go! Note: If you change settings like this when the mail server is running then it can revert the settings back as the daemon is running. If that happens to you, double-check that the service is stopped before editing the file.

Debugging Twitter

I was recently working on a new project developing against Twitter using their JSON interface. Turns out that the Twitter app has an awesome little feature to assist with such a task, a Console. To see the menu for the Console, enable the Develop menu, by putting a true boolean ShowDevelopMenu key into the com.twitter.twitter-mac.plist: defaults write com.twitter.twitter-mac ShowDevelopMenu -bool true Once enabled, use the Develop menu to open Console. Here, you can select various buttons and see the GET, POST, PUT or DELETE sent. as well as the entities sent. To disable the Develop menu: defaults write com.twitter.twitter-mac ShowDevelopMenu -bool false

Subversion Cheat Sheet

I’ve done a few articles in the past on different tasks in svn and git, but I have a little cheat sheet of sorts I’ve been using for awhile for Subversion on Mac OS X and thought I would share it. Before you get started, check your version. I use 2.0 but I seem to remember all of these are about the same as they were previously: svn --version To get started, Subversion uses a repository to store projects. Each client needs a repository and these should be on direct attached drives. The repository hosts a Berkeley database a folder per project you check out, or import. To create a repository in a folder called Repository that lives in your home folder, you can use the following command, which uses the svnadmin command (svnadmin is used for most admin tasks in Subversion and the svn command itself is used for most user operations) and then the create verb, followed by a path: svnadmin create ~/Repository
Note: These commands are mostly the same in Windows, except you use a drive letter rather than a fully qualified path. They are identical in Linux.
Within the Repository directory, each project will have a folder. Within these, you would then create folders for branches, tags and trunk, where trunk is the directories and files you will be working with. Then, we’ll import our first project. To do so we’re going to use the svn command, along with the import verb and then in the second position, we’ll use project to define the type of import. Next, we’ll define the location. The location could be http:// or file:///. In this case we’ll use an existing, mounted AFP file system at /Volumes/myserver/sharedrepo/projectname. Next, we’ll just put a message in there using the -m option, indicating “Initial Import”: svn import project file:///Volumes/myserver/sharedrepo/projectname -m "First Import" That wasn’t so bad. To see a list of the projects stored in a repository, use the svn command along with the list verb. When I do this, I like to use the –verbose option (optional, thus an option). YOu would also provide the path to the repository: svn list --verbose file:///Users/cedge/Repository To update the repository: svn update We now have a local copy of the project we imported earlier (creatively called projectname) and can work on it. Before we start working on it though, we want to check it out. To do so, we’ll use the svn command, along with the checkout verb. We’ll then provide the path to the project and name of the project: svn checkout file:///Users/cedge/Repository/projectname/trunk projectname When you’re done working on things, let’s look at what’s changed using svn’s status verb (btw, a writing point, by making svn possessive there, did I give it a personality? If so, then it’s certainly cranky at times so I suppose that’s fine): svn status You’ll invariably want to add things to a project, which uses the oddly named add verb (bad grammar pun, sry): svn add filename Removing files is a similar process: svn delete filename Adding, deleting and changes all need to be committed once you’re done working on the project. To commit changes, use the commit verb. Here, we’re going to provide a message explaining what we did (Added a method for handling invalid file names and bad grammar puns) and then the path: svn commit -m "Added a method for handling invalid file names and bad grammar puns" file:///Users/cedge/Repository/projectname/trunk I didn’t include tagging, getting releases (list verb), using preshared keys (ssh-keygen, ssh-copy-id, ssh-agent, ssh-add), resolving conflicts (resolved verb), so feel free to add comments with your examples if others read this and would like to add more!

Delete All WordPress Comments

WordPress uses MySQL as a back-end. I’ve seen a number of scenarios where someone was comment spammed. The comments weren’t approved and so never appeared on the site, but they were starting to fill up the MySQL database given that there were about 40,000 in one case and about 55,000 in another. In order to trash them you can use the following query from mysqladmin (once connected to the database of course):
DELETE FROM wp_comments WHERE comment_approved = ‘0’

Keystrokes For Windows/Windows Server Explorer

There’s nothing that makes you faster with navigating around any GUI-based OSen than keystrokes.  Navigate around the system, browse web pages and even swap between command windows at blazing speeds.  You’ll get faster but you’ll seem exponentially faster to those trying to watch you work.  I’ve done posts on Mac OS X and Safari.  Now, here’s one for navigating around Windows with the same speed with which you navigate OS X.  If I skipped something feel free to let me know and I’ll add it; there are a plethora of options and these are the ones off the top of my head…  While I was shooting for Windows Explorer, most of these are globally implemented at the application level. Pressing the Windows key and the E key together will open Windows Explorer.  When you’re viewing a tree of files, you can use the + or right arrow keys to drill down into folders.  You can also use the – or left arrow keys to then collapse those folders.  Pressing the * key when a folder is highlighted will expand all of the folders beneath it.  The backspace key can be used to navigate up within the tree (if you’re root value isn’t listed).  The HOME and END keys will go to the top or bottom of the active selection/screen/window.  Control-A will select all of the items in the list. While an item is highlighted, Control-C, Control-X, Control-V, Control Z and DELETE will cut, copy, paste, undo and delete items respectively.  Shift-DELETE will delete the item permanently, skipping placing items in the trash.  Pressing F2 while an item is highlighted will bring up the rename tool, so you can change the name of the highlighted item.  While in the rename dialog, pressing Control in conjunction with the up, down, right and left arrow keys will move the insertion point for typing (or deleting) to the beginning of the field, the end of the field, the next word or the previous word respectively.  Using the Shift key while pressing the arrows will actually select the text rather than just move the insertion point.  Alt-Enter can be used to bring up the properties page for an item. You can also control how the view displays columns.  Pressing Control-+ will automatically adjust the width of each column to the longest value within the column.  While not much of a keystroke, double-clicking a divider line will go ahead and expand that single column.  F4 will fire up the address bar, which you can then use the tab key to navigate into. Pressing just the Alt key will bring up the menus, which you can then use the arrow keys to navigate within and between.  Alt-Tab will switch to another application.  The F1 key can also be used to bring up the help dialog and the F3 key can be used to invoke a search dialog box.  Control-F4 will close an Explorer window, while Alt-F4 together will go ahead and close Explorer (not that Explorer can ever truly be closed).