This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#backup all databases on server every day to a backups folder | |
PATH=/usr/sbin:/usr/bin:/sbin:/bin | |
# Timestamp (sortable AND readable) | |
stamp=`date +"%s-%A_%d_%B_%Y@%H_%M"` | |
# List all the databases | |
databases=`mysql -u {{user}} -p{{password}} -e "SHOW DATABASES;" | tr -d "| " | grep -v "\(Database\|performance_schema\|information_schema\|mysql\|test\)"` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PATH=/usr/sbin:/usr/bin:/sbin:/bin | |
stamp=`date +"%s-%A_%d_%B_%Y@%H_%M"` | |
name="${stamp}_backup.tgz"; | |
#tar filesystem | |
tar cvpzf /backups/file/${name} --exclude=/backups/file --exclude=/lost+found --exclude=/proc/* --exclude=/sys/* --exclude=/mnt/* --exclude=/media/* --exclude=/tmp/* --exclude=/var/run/* --exclude=/var/lock/* --exclude=/var/cache/apt/archives/* --exclude=/home/*/.gvfs --exclude=/run --exclude=/dev / |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//The model could be used both server and browser side, | |
//not much more than a plain object with some simple getters and setters. | |
let User = Model.extend({ | |
first_name: String, | |
last_name: String, | |
full_name: function(){ | |
return this.first_name + ' ' + this.last_name; | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//stop nginx | |
sudo service nginx stop | |
//backup config | |
sudo cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.backup | |
//add apt repo | |
sudo add-apt-repository ppa:nginx/development && sudo apt-get update | |
//remove then upgrade nginx - choose N to prevent config overwrite (even though we made a backup) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /opt/letsencrypt | |
./letsencrypt-auto certonly -a webroot --webroot-path=/path/to/site -d example.com -d www.example.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 2 * * 1 /opt/letsencrypt/letsencrypt-auto renew >> /var/log/le-renew.log | |
35 2 * * 1 /etc/init.d/nginx reload |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Welcome to the new blog ;-) | |
echo 'Hello World'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('LARAVEL_START', microtime(true)); | |
/* | |
|-------------------------------------------------------------------------- | |
| Register The Composer Auto Loader | |
|-------------------------------------------------------------------------- | |
| | |
| Composer provides a convenient, automatically generated class loader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('LARAVEL_START', microtime(true)); | |
/* | |
|-------------------------------------------------------------------------- | |
| Register The Composer Auto Loader | |
|-------------------------------------------------------------------------- | |
| | |
| Composer provides a convenient, automatically generated class loader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Fluent Demo - force direct | |
Plugin URI: # | |
Description: Forces wp to think it has direct filesystem access during ajax and admin requests. | |
Author: No Half Pixels Ltd | |
Version: 1.0.0 | |
Author URI: http://nohalfpixels.com | |
*/ | |
add_filter( 'filesystem_method', function($method){ |