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.
Advanced Bash-Scripting Guide. The name says it all.
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
Of course, you’d want to check any existing files in the folder to make sure none of them already deal with that field.
From the linux command line, these commands let you backup and restore a SugarCRM database.
Firstly, for a proper back up of SugarCRM you’ll need two ﬁles, one containing the application ﬁles, one containing the SQL database.
First up, the backup…
tar -zcvf CRM-BACKUP-FILES.tar.gz FOLDER-TO-BACKUP/
Edit: if you get an error ‘Permission Denied’ you may be trying to write to a folder you don’t have permission for, instead try writing to ~/CRM-BACKUP-FILES.tar.gz and it will likely work.
Backup sql (empty copy of the database):
mysqldump -u USERNAME -p -–no-data DATABASENAME > CRM-BACKUP-SQL.sql
Backup sql (with the data) :
mysqldump -u USERNAME -p DATABASENAME > CRM-BACKUP-SQL.sql
Then you can ‘tar’ the .sql file with
tar -zcvf DATABASENAME-mysql.tar.gz DATABASENAME-mysql.sql
Backup just a single table
mysqldump db_name table_name | gzip > table_name.sql.gz
Then for the restoration…
Restore ﬁles (to current folder):
tar -zxvf CRM-BACKUP-FILES.tar.gz
mysql -u USERNAME -p DATABASENAME < CRM-BACKUP-SQL.sql
Restore just a single table
gunzip < table_name.sql.gz | mysql -u username -p db_name
These SugarCRM Knowledge Base articles may also be of use:
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.
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 lets me do
and it’ll spit out “(Admin #7)” or if I type
it’ll spit out “(CRM #15)”.
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 is that OmniFocus doesn’t have a ‘task number’ function.
Keyboard Maestro and a shell script to the rescue. This allows me to get the next sequential task number. Now all I do is type
and it expands out to the next available task number.
In a nutshell I use the shell script to get a variable from a text file (which is the last task number I used), and increment it. Keyboard Maestro is wrapped around this to both trigger it and make it look pretty.
The shell script itself is quite basic, any improvements you can suggest, please do.
Here is a screenshot of the Keyboard Maestro recipe (edit: I’ve since modified this recipe to be a little faster)
This relies on you having a text file named
in your home folder.
The format of this file is just a single line of text as follows:
Find duplicate contact records, by contact name, in SugarCRM using MySQL.
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.
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 = 'value_one',1,0)) AS 'Value One', SUM(IF(field_name = 'value_two',1,0)) AS 'Value Two' FROM table_name
What this does is counts up how many times
value_two appear in
field_name in the table
You can then take this a step further, if you wanted to, and I did…
you can use a line like this within your query:
This gives you the percentage that
value_one is of (
Hat tip to this stackoverflow answer by eisberg.
Edit: 2014-05-26-21h53m put the final code snippet into a ‘Gist’ on GitHub.
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.
Great article over at A List Apart: Can Email Be Responsive. If you do HTML email newsletters, you should go read this.
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.
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… :)
- Keyboard Maestro – macros for everything.
- BetterSnapTool - setup hot keys to move windows to where you want.
- Battery Health - keep an eye on your Mac’s battery health.
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 yours.
PS. I wanted a tshirt, but couldn’t find what I was looking for, so I’ve made it here. If the goal is reached (50 tshirts) at teespring, then they’ll make ‘em. Go on, I know you want one, order one for yourself and your neighbour. While you’re at it, get one for your neighbours nephew too.
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.
Good clear description on how to create your own public/private keys for ssh.
A client is recording the expiry dates of staff blue cards in their SugarCRM database.
So I used the following sugar logic to show if the blue card has expired or not:
However, the problem here is that when a user of SugarCRM is editing the record, there is a known bug that means it will display “EXPIRED” regardless of if the date is in the past or future.
The workaround for this bug (thanks Anthony) is to wrap the date field in a date(toString($datefield)) bit of code, this transform the original sugar logic into this:
Which works a treat.
How to activate the SMS channel on IFTTT on the Optus network in Australia.
Assuming your mobile number was 0410 123 456.
Drop the leading zero = 410 123 456.
Add the Australian country code 61 to the front = 61 410 123 456.
Add 00 to the front of the number 00 61 410 123 456.
Remove all the spaces = 0061410123456.
Use this number (0061410123456) to active the SMS channel on IFTTT.
Hat tip to @Trail_929 for the pointer.
If this works for you on other networks in Australia, please let me know.
Update 2014-05-12 : I’ve had a few people on Optus Post Paid that haven’t been able to get this to work. It’s worth noting that IFTTT also now has both iOS and Android notification channels available, they may do the trick for you.