Ben Hamilton

Author Archives: Ben Hamilton

fdsdfsdf

How long running are those queries?

At the MySQL commandline, you can enter show processlist; and see what processes are running. If you’re tracking down some problematic code and you’ve got a query (or set of queries) that don’t end, consume CPU cycles and generally bog everything down to a crawl, it can be helpful to know what time you’ve run […]

Posted in *nix, SQL | Tagged , | Comments Off on How long running are those queries?
fdsdfsdf

Hotkey for New Day One entry from selection

I use Day One to journal. There is a service that creates a new Day One entry from the selection, but it didn’t have a hotkey associated with it. So I’ve set one up. First (optional) step is to use to make your CAPS LOCK key useful. Big thanks to Brett Terpstra for that, I […]

Posted in Productivity | Tagged , | Comments Off on Hotkey for New Day One entry from selection
fdsdfsdf

Encrypt and decrypt .zip files on Mac OS X

I just needed to compress and encrypt some files on Mac OS X. The following command does that: zip -ejr TARGET SOURCEFOLDER This will ask for a password (twice to confirm it), encrypt and compress the sourcefolder and put it into a file named target (and auto add the .zip extension). To unzip it do […]

Posted in *nix | Tagged , , | Comments Off on Encrypt and decrypt .zip files on Mac OS X
fdsdfsdf

VPS Hosting Deal 20% off

This is a time limited deal, if you go to Cloudatcost.com and sign up, use the coupon code ‘benhamilton’ to get 20% off your order. I have a VPS hosted with Cloudatcost myself and I know a few others that do as well, so I can vouch for their service.

Posted in Recommendation | Tagged , , , | Comments Off on VPS Hosting Deal 20% off
fdsdfsdf

How to get Hazel to run rules in subfolders

This article here describes how to get Hazel to run rules in sub folders, very handy. I’m using this to move any screenshots taken on the iPhone out of the photo folder into a separate folder.

Posted in How to | Tagged , , | Comments Off on How to get Hazel to run rules in subfolders
fdsdfsdf

Advanced Bash-Scripting Guide

Advanced Bash-Scripting Guide. The name says it all.

Posted in *nix | Tagged , , | Comments Off on Advanced Bash-Scripting Guide
fdsdfsdf

Allow a Checkbox to be Mass Update-able in SugarCRM

Here’s how to enable a checkbox to be updated enmasse. First create a new extvardef.php file containing the following: Then put that file into at the following location /var/www/html/custom/Extension/modules/Module_Name/Ext/Vardefs/ Of course, you’d want to check any existing files in the folder to make sure none of them already deal with that field.

Posted in How to, SugarCRM | Tagged , , , | Comments Off on Allow a Checkbox to be Mass Update-able in SugarCRM
fdsdfsdf

How to backup SugarCRM from the command line

From the linux command line, these commands let you backup and restore a SugarCRM database. Update 2016-04-26: Just saw this SugarCRM KB Providing a Backup Without Sensitive Data which is really useful. Thanks Jared. Firstly, for a proper back up of SugarCRM you’ll need two files, one containing the application files, one containing the SQL database. […]

Posted in *nix, SQL | Tagged , , , , | Comments Off on How to backup SugarCRM from the command line
fdsdfsdf

Linux Load Averages

For when you’re trying to explain what the load average figure means (which you get from running either top or w from the linux command line) this link will help explain it easily. Easier than spending 10 minutes talking about it.

Posted in *nix, How to | Tagged , | Comments Off on Linux Load Averages
fdsdfsdf

Faster Numbering of OmniFocus Tasks

I wrote up how I’m numbering tasks in OmniFocus, but I’ve now modified the Keyboard Maestro recipe so it’s just a touch faster. Here’s a screenshot: I’ve also since created a separate recipe in Keyboard Maestro for each key Project I have in OmniFocus, each with it’s own .txt file that it refers to. This […]

Posted in Productivity | Tagged , , , , | 1 Comment
fdsdfsdf

Numbering tasks in OmniFocus 2 for Mac OS X

I’m using OmniFocus 2 on my MacBook Pro and wanting to ‘number’ tasks because at the end of each week, I print a PDF of the tasks completed and outstanding for a particular client. Task numbers make it much easier for the client to reconcile the work I’ve done with the lists they use. The problem […]

Posted in How to, Productivity | Tagged , , , | 1 Comment
fdsdfsdf

Find Duplicate Contacts in SugarCRM

Find duplicate contact records, by contact name, in SugarCRM using MySQL.

Posted in SQL | Tagged , , | Comments Off on Find Duplicate Contacts in SugarCRM
fdsdfsdf

SQL Query ORDER BY last_name, then first_name

This snippet of MySQL code shows how to concatenate two fields into one column, also shows how to reverse the concatenation and order by last name then first name.

Posted in SQL | Tagged , | Comments Off on SQL Query ORDER BY last_name, then first_name
fdsdfsdf

MySQL – Counting how many rows have a particular value

Working on a SugarCRM dashboard today, and I needed to count how many records had one value and how many records had a second value. I then wanted to know what percentage the first value was of the total. So there’s a bit of MySQL code that helps make this easy to do. SELECT SUM(IF(field_name = […]

Posted in SugarCRM | Tagged , , , | Comments Off on MySQL – Counting how many rows have a particular value
fdsdfsdf

Show hidden files/folders in the File Open dialog box on Mac OSX

I was needing to navigate to a file that was in a ‘hidden’ folder, but the File Open dialog box won’t show the hidden folder. The answer was found here: Press Command, Shift, Period keys together, the hidden folders/files will appear.

Posted in How to | Tagged , , | Comments Off on Show hidden files/folders in the File Open dialog box on Mac OSX
fdsdfsdf

HTML Emails – How to do them well

Great article over at A List Apart: Can Email Be Responsive. If you do HTML email newsletters, you should go read this.

Posted in How to | Tagged , , | Comments Off on HTML Emails – How to do them well
fdsdfsdf

Securely delete files from the command line

Just discovered the srm command on *nix systems. srm will securely delete files, dependant on the switches you give it either one overwrite with random data, 7 passes, or 35 passes. Hat tip to practicallyefficient.com.

Posted in *nix, How to | Tagged , | Comments Off on Securely delete files from the command line
fdsdfsdf

Short list of software I’m using

Just a quick post of some software that I use, that I’ve just discussed with Seth (he knows who he is). ClarifyIT – Create quick screenshot based documents and email them easily. Byword – Markdown text editor. OmniOutliner – Easiest outliner I’ve found. Nozbe – great GTD task manager. 1Password – simplify your password management. Timebar – focused working… :) […]

Posted in How to | Tagged , | Comments Off on Short list of software I’m using
fdsdfsdf

Truth, Justice and Coffee

We all want to achieve. We want the truth, we want justice. But above all, we want our coffee. Coffee is the fuel that powers our quest for truth and justice. Let the world know that you are in pursuit of truth, justice and coffee by ordering your own tshirt by clicking here to order […]

Posted in tshirt | Tagged , | Comments Off on Truth, Justice and Coffee
fdsdfsdf

The Expert

The Expert is a short youtube clip that illustrates what being billed as the “the expert” can feel like sometimes. Fortunately it’s not a common occurrence.

Posted in General | Tagged , | Comments Off on The Expert