The setup installs the following software:
- Nginx
- MySQL
- PHP
- Node
- Composer
// Copy big file from somewhere else | |
$src_filepath = 'http://example.com/all_the_things.txt'; $src = fopen($src_filepath, 'r'); | |
$tmp_filepath = '...'; $tmp = fopen($tmp_filepath, 'w'); | |
$buffer_size = 1024; | |
while (!feof($src)) { | |
$buffer = fread($src, $buffer_size); // Read big file/data source/etc. in small chunks | |
fwrite($tmp, $buffer); // Write in small chunks | |
} |
## Install packages | |
sudo yum install wget curl vim epel-release | |
sudo yum install daemonize.x86_64 | |
## Install mailhog | |
wget https://github.com/mailhog/MailHog/releases/download/v0.2.0/MailHog_linux_amd64 | |
sudo chmod +x MailHog_linux_amd64 | |
sudo chown root:root MailHog_linux_amd64 | |
sudo mv MailHog_linux_amd64 /usr/sbin/mailhog |
<?php | |
namespace Eder\Jobs; | |
use Eder\Jobs\Job; | |
use Illuminate\Contracts\Mail\Mailer; | |
use Illuminate\Queue\SerializesModels; | |
use Illuminate\Queue\InteractsWithQueue; | |
use Illuminate\Contracts\Bus\SelfHandling; | |
use Illuminate\Contracts\Queue\ShouldQueue; |
<?php | |
namespace Eder\Jobs; | |
use Eder\Jobs\Job; | |
use Illuminate\Contracts\Mail\Mailer; | |
use Illuminate\Queue\SerializesModels; | |
use Illuminate\Queue\InteractsWithQueue; | |
use Illuminate\Contracts\Bus\SelfHandling; | |
use Illuminate\Contracts\Queue\ShouldQueue; |
"use strict"; | |
var MAILTRAP_API = "xxxxxxxxxxxxxxxxxxxxxxx"; | |
var MAILTRAP_INBOX = 12345; | |
var _ = require("lodash"); | |
var request = require('request'); | |
var baseURL = "https://mailtrap.io/api/v1/"; | |
var headers = { |
#! /bin/sh | |
# A script to monitor uptime of websites, | |
# and notify by email if a website is down. | |
SITES="ADD COMMA-SEPARATED WEBSITES HERE" | |
EMAILS="ADD COMMA-SEPARATED EMAILS HERE" | |
for SITE in $(echo $SITES | tr "," " "); do | |
if [ ! -z "${SITE}" ]; then | |
RESPONSE=$(curl -s --head $SITE) | |
if echo $RESPONSE | grep "200 OK" > /dev/null |
/*! | |
* Copyright 2012, Chris Wanstrath | |
* Released under the MIT License | |
* https://github.com/defunkt/jquery-pjax | |
*/ | |
(function($){ | |
// When called on a container with a selector, fetches the href with | |
// ajax into the container or with the data-pjax attribute on the link |
List of PHP 7 Packages: https://launchpad.net/ubuntu/+source/php7.0 | |
Disclaimer: I get unreliable results when I don't run these commands seperately and in order. | |
vagrant ssh | |
sudo apt-get update | |
sudo add-apt-repository ppa:ondrej/php | |
sudo apt-get install php7.0 | |
sudo apt-get update |
<?php | |
/** | |
* Dot notation for access multidimensional arrays. | |
* | |
* $dn = new DotNotation(['bar'=>['baz'=>['foo'=>true]]]); | |
* | |
* $value = $dn->get('bar.baz.foo'); // $value == true | |
* | |
* $dn->set('bar.baz.foo', false); // ['foo'=>false] | |
* |