Skip to content

Instantly share code, notes, and snippets.

<?php
date_default_timezone_set('Europe/London'); // Set this to your local timezone - http://www.php.net/manual/en/timezones.php
/**
* The root directory where the repos live.
*
* @var string
*/
$root_dir = '/your/root/dir/';
@lcherone
lcherone / cloud9-lamp.sh
Last active May 8, 2018 15:11
Cloud9 / C9 SDK - Bash script which installs Cloud9 SDK, with Apache2 (rewrite, headers enabled), PHP7, MariaDB, Git, Composer, nodejs, npm and start on boot crontab.
#!/bin/bash
# Set envioroment, for cloud-init
set -e
export DEBIAN_FRONTEND=noninteractive
export PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin'
export HOME='/root'
# upon launch wait for internet connection
echo "Waiting for network connection."
@lcherone
lcherone / htaccessCRUD.class.php
Last active September 4, 2018 05:20
PHP .htaccess CRUD class
<?php
/**
* .htaccess writer CRUD class
*
* @author Lawrence Cherone
* @version 1.00
*/
class htaccessCRUD
{
public $file;
@CalebEverett
CalebEverett / events-websock.js
Last active March 29, 2023 15:04
Lxd api example: lxc exec and operations websocket via nodejs
const fs = require('fs')
const WebSocket = require('ws');
const wsoptions = {
cert: fs.readFileSync('../../.config/lxc/client.crt'),
key: fs.readFileSync('../../.config/lxc/client.key'),
rejectUnauthorized: false
}
var ws = new WebSocket('wss://127.0.0.1:8443/1.0/events?type=operation', wsoptions);