Concatenate Fields via ODBC Query

Today I wanted to concatenate some fields with some text. We are pulling some data from MYOB for import against a client record in SugarCRM and want to tidy it up as we go.

however, using concat didn’t work.

Thus this Stackoverflow answer came to the rescue with using {fn concat('some text', 'with more text')}

I’ve then nested it a little as this function only takes two arguments.

  {fn concat (TermsOfPayment.Description,  
    {fn concat (' (',  
      {fn concat (Terms.BalanceDueDays, ' days)')}  
  )} as TradingTerms  
  join Terms on Terms.TermsID = Customers.TermsID join  
  TermsOfPayment on TermsOfPayment.TermsOfPaymentID = Terms.TermsOfPaymentID;

Excel DATEVALUE Function

When a Microsoft Excel spread sheet has a column of date data in this format:

Nov 24 1995

Then the Excel function you’ll find useful is DATEVALUE

DATEVALUE function.

This formula here:


Basically grabs the Day, then the Month, then the Year from the column, then converts it to a serial number that Excel recognises as a date. Then format this to display however you want it to.

Find JIRA Issues with Attachments

When you just know you’ve attached a file to a JIRA issue, but can’t find it, this is the search to do in Issues in JIRA

Replace PKEY with your project key.:

project = PKEY AND type != Epic and attachments is not EMPTY ORDER BY Status ASC

SSH and Private Key usage on Mac OS X

It’s very important that your private keys are kept secure and away from prying eyes.

A good place to keep your private keys is in the folder ~/.ssh as this makes it easier to manage (this is a subfolder of your home folder).

You then want to set the permissions of the private key file to 600.

chmod 600 ~/.ssh/privatekeyfile.pem

Then you can ssh to the server from the command line using:

ssh -i ~/.ssh/privatekeyfile.pem.pem root@fqdn -p 22

Olixar Universal Bike Phone Mount

I commute to work every day on my motorcycle, it’s a 52 kilometre trip each way. Wearing my headphones, Waze lets me know of any accidents or hazards ahead but because the phone is in my jacket pocket, I only hear such warnings, I don’t see them. It would be nice to see the Waze screen.

I was talking with the folks over at MobileZap, who said I should try out a Olixar Universal Bike Phone Mount on the bike. So for the last month I’ve been quite happily riding around, able to see the screen with an easy glance. An added side benefit is that when I’ve received a phone call, I can see who it is and decide if I’ll pull over and talk or not. Previously I’d just ignore all phone calls whilst riding.

photo of the Olixar bike phone mount

The holder itself I thought looked a bit flimsy, however it has held up really well while I’ve ridden through both really hot days (34°C) and heavy rain.

After placing the phone between the two grippy holders, simply squeeze them together and the phone is securely held. I’m using an iPhone 6 in an Otterbox Defender case and it accommodates the larger case quite well. There is a small fold-out piece at the bottom if you’re worried about it falling out the bottom, but I’ve found I don’t need it, the phone doesn’t slip or move while in the holder at all.

To release the phone, there is a small button on the lower right hand side, pressing it causes the two holders to release their grip. Although I was concerned initially that it wouldn’t hold my phone securely, it turns out that it does hold it really well, I’m now quite confident that the phone won’t come loose and fall out while I’m riding.

If you’re looking for a phone holder to fit to your road bike, I can happily recommend this one.

Thanks to MobileZap for providing this product for me to test out.

Location of the SugarCRM log file

By default it’s in the same base folder as the SugarCRM application files. But on occasion we’ll move it. Quickly find it’s location by looking in the config.php file. The two relevant lines are:

‘log_dir’ => ‘/var/log/sugarcrm/’,
‘log_file’ => ‘sugarcrm.log’,

If you’re at the command line, then this makes it easy:

grep 'log_dir' config.php