CiviCRM Attachments

If you see a message like this: then you have probably tried to save a file where the filename is too long. The file input field is added by /sites/all/modules/CRM/Core/BAO/File.php, e.g. $form->addElement('file', "attachFile_$i", ts('Attach File'), 'size=30 maxlength=60'); The maxlength of the field set on the input field is enforced when the record is saved. While changing maxlength=60 to a higher number is possible it probably isn’t desirable as there may be other unwanted side effects.
Read On →

Add swap file to Linux

Some VPS providers provision their VPS without any swap space. Given that these servers often have a small amount of physical memory even on a moderately used server it is likely that you will see processes being killed to recover memory, e.g. Sep 12 15:01:30 xxxxxx.xxx.xxx kernel: mysqld invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0 When this happens to the mysqld process that is a bad thing as it can potentially lead to data loss, as it may have done in this example:
Read On →

CiviCRM Geocoding

A short note on one way of setting up geocoding in CiviCRM on Drupal for UK contact addresses. Objective is two fold: Display a map for contacts Use latitude/longitude to answer questions like ‘How many volunteers live with X miles of event Y’ For this we will be using: OpenStreetMap as the mapping provider. The OpenStreetMap Search API for geocoding. Freemaptools UK postcode to latitude/longitude cross reference data.
Read On →

Deploy Jekyll site

Assuming that you have SSH installed Password-less connection setup between your local machine and the remote server. Setup is as simple as: $ ssh-keygen -f ~/.ssh/id_rsa -q -P "" # Create RSA key without passphase $ cat ~/.ssh/id_rsa.pub # copy contents of ~/.ssh/id_rsa.pub # append to ~/.ssh/authorized_keys on remote server # test the connection, date should be displayed, should not be promoted for password $ ssh user@remote date Jekyll _config.
Read On →

rclone

Stumbled across rclone today; a command line program to sync files and directories to and from a wide variety of online storage systems including: * OneDrive * Backblaze B2 * Hubic * Amazon Drive Worth noting that OneDrive support does not seem to include OneDrive for Business (i.e. Office365). Currently looking for a work round maybe using oauth2. Install Per the installation guide lm180 ~ # wget http://downloads.rclone.org/rclone-current-linux-amd64.zip --2016-08-27 12:55:02-- http://downloads.
Read On →