How to Deploy Your Repo to a Server Via Pipelines and SSH

There is more to this post but for now. This is a very useful link on how to get SSH working with BitBucket Pipelines.

I have some repos that need to deploy to multiple servers etc…

Make sure to expand the ‘Use multiple SSH keys in your pipeline’ section.

Supporting extFAT and rsync to an exFAT partition in Linux

Ok this was a fairly annoying. exFat isn’t supported in Linux by default. But no fear it can be supported by installing exfat-utils and exfat-fuse packages from the official repos:

Sweet, ok so now rsync should surely work right? Nope, not well anyway. Here’s why:

The above post explains it perfectly but the main problem is that the Linux exFAT does not cope well with the switches, particularly archive -a and spits out loads of chmod permission errors, but you can fix this by running rsync as follows:

[code]rsync -rltDv [SRC] [DESTINATION][/code]


Sort an Object Array in PHP

This gives me a brain ache every time and I always forget what project I used it in last so here it is. Still don’t quite understand why php cant just have a built in more readable function.


//$adverts is our object array

usort($adverts, function($a, $b)
return ($a->price < $b->price);

Amazon SES and PHPList SMTP Send as Root Issue

This is actually quite easy to do but there is one major problem if you are using WHM/cPanel.

You need to make sure you have this option set to off in Home » Server Configuration » Tweak Settings – Mail (Tab)

Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak)

With this on it breaks your outgoing SMTP user so Amazon SES thinks you are not sending from a verified sender.

For more info on setting this up see here:

Bootstrap 3 Destroys Default Andorid Browser Video Controls

Well despite every single link I could find on Google saying this is now fixed in Bootstrap 3 it really isn’t!

So here is the offending code on line 1669 of bootstrap.css v3.1.1!

input[type="range"] {
display: block;
width: 100%;

Basically the video position scrubber bar was just 0px in width causing all buttons to be bunched together and a new volume slider to appear…. pretty damn random!! I hate Android and video by the way, thought I would just get that out there.

Now no matter what combination of display I tried I could not override this setting. The only way to fix this was by editing the core css file and removing display: block; completely.

Am I the only one who tested video in the default Android browser when using Bootstrap 3? Evidently so according to Google… Man what a waste of 3 hours of trial and error!

Twitter Typeahead Search Suggest

This is now the replacement for Bootstrap 2’s typeahead as it is no longer in the docs for Bootstrap 3.

I admit this is better cleaner version but my god the docs are not good! So confusing and took me a while to work it out. Classic case of geeks expecting you to know what they know. Here are some helpful tips.

First things first, I don’t know why they never show an example of ‘on selected do this’ event. That’s the main reason for typehead, you want to redirect to a page mostly upon selecting the suggestion… Anyway after lots of searching found an example. Yay..

Secondly I always use remote dataset but struggled to find an example dataset. In a nut shell this can be a json object like so where value is the default field typehead uses to search with.

name: ‘ad_users’,
valueKey: ‘name’, //this is the field in your data set that typehead searches, if not defined default is ‘value’
limit: 10,
remote: ‘MY_URL/ajax/searchuser/q/%QUERY’ //%QUERY is automatically replaced with whatever you type in the search field

//bind on selected do this
//datum is the json object and username is my field I want to return, in my case I also wanted to return the result in lowercase
$(‘#user-search’).bind(‘typeahead:selected’, function(obj, datum, name) {
document.location = ‘MY_URL/staff/adcompare/ad-id/’+ datum.username.toLowerCase();

Here is an example of my remote data set.

{"name":"Cabrinha (Pryde Group)","username":"Cabrinha"},
{"name":"Class Clendar","username":"Classcalendar"},

Seems so simple but took me ages to get this right as serious lack of examples in the docs 🙁