LAMP server setup on Linode Ubuntu 14.04.1 LTS
-
Update system
- apt-get update
- apt-get upgrade
- Check Unattended upgrades package
/** | |
* Remove array key prefixes | |
* | |
*/ | |
function remove_prefix($array, $prefix) | |
{ | |
return array_combine( | |
array_map( | |
function($k,$prefix){ | |
return preg_replace("/^$prefix/", '', $k); |
public function humanizeDateDifference($now,$otherDate=null,$offset=null) | |
{ | |
if($otherDate != null){ | |
$offset = $now - $otherDate; | |
} | |
if ($offset == 0) | |
{ | |
$otherDate =$otherDate + 1; | |
$offset = $now - $otherDate; | |
} |
<Macro VHost $name $domain $db_host $db_name $db_user $db_pw> | |
<VirtualHost *:80> | |
# The ServerName directive sets the request scheme, hostname and port that | |
# the server uses to identify itself. This is used when creating | |
# redirection URLs. In the context of virtual hosts, the ServerName | |
# specifies what hostname must appear in the request's Host: header to | |
# match this virtual host. For the default virtual host (this file) this | |
# value is not decisive as it is used as a last resort host regardless. | |
# However, you must set it for any further virtual host explicitly. |
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use App\Http\Requests; | |
use Carbon\Carbon; |
LAMP server setup on Linode Ubuntu 14.04.1 LTS
Update system
<?php | |
if (strstr($slug, '/')) { | |
$segments = explode('/', $slug); | |
$parent_id = null; | |
foreach ($segments as $key => $segment) { | |
$params['slug'] = $segment; | |
if ($parent_id) { |
https://wiki.apache.org/httpd/PHP-FPM
Steps
add-apt-repository multiverse
apt-get update
<?php | |
namespace App\Models; | |
class Agreement extends BaseModel | |
{ | |
const CREATED_AT = 'CreatedOn'; | |
const UPDATED_AT = 'LastUpdateOn'; | |
/** |
# Bitbucket Pipelines Configuration file | |
# https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html | |
# options: | |
# size: 2x | |
# max-time: 60 | |
pipelines: | |
default: | |
- step: | |
script: | |
- echo "This script runs on all branches that don't have any specific pipeline assigned in 'branches'." |
# Bitbucket Pipelines Configuration file | |
# https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html | |
# options: | |
# size: 2x | |
# max-time: 60 | |
pipelines: | |
default: | |
- step: | |
script: | |
- echo "This script runs on all branches that don't have any specific pipeline assigned in 'branches'." |