First let's install Homebrew.
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#!/bin/sh | |
#Deploy | |
git --work-tree=/path/to/webroot --git-dir=/path/to/repo.git checkout -f <branch> | |
#Run composer and dev/build | |
cd /path/to/webroot | |
composer install --no-dev --prefer-dist | |
php ./framework/cli-script.php dev/build flush=1 |
#/bin/sh | |
# Requires: git, composer, sspak, php | |
echo "Taking a backup" | |
d=$(date +%Y%m%d%H%M%S) | |
sspak save /home/bitnami/htdocs ~/backup/$d.sspak | |
cd ~/htdocs | |
git fetch | |
echo "Deploying production release branch" |
git log --left-right --cherry-pick --oneline --pretty=format:"%h: %s (%an)" branch1...branch2 |
if (Director::isDev()) { | |
if (isset($_GET['db']) && $db = $_GET['db']) { | |
if ($db == 'sqlite3') { | |
$databaseConfig['type'] = 'SQLite3Database'; | |
$databaseConfig['memory'] = true; | |
} | |
} |
<?php | |
class GoogleAnalyticsExtension extends DataExtension { | |
private static $db = array( | |
'GoogleAnalyticsTrackingID' => 'Varchar(11)', | |
); | |
public function updateCMSFields(FieldList $fields) | |
{ | |
$fields->addFieldToTab('Root.GoogleAnalytics', TextField::create('GoogleAnalyticsTrackingID')->setDescription('e.g. UA-XXXXX-XX')); |
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"id": "https://project-open-data.cio.gov/v1.1/schema/catalog.json#", | |
"title": "Project Open Data Catalog", | |
"description": "Validates an entire collection of Project Open Data metadata JSON objects. Agencies produce said collections in the form of Data.json files.", | |
"type": "object", | |
"dependencies": { | |
"@type": [ | |
"@context" | |
] |
#!/bin/bash | |
## | |
# File: | |
# nginx_modsite | |
# Description: | |
# Provides a basic script to automate enabling and disabling websites found | |
# in the default configuration directories: | |
# /etc/nginx/sites-available and /etc/nginx/sites-enabled | |
# For easy access to this script, copy it into the directory: |
Lots of stack traces and error messages for CKAN, followed by a comment about how I fixed it (that time). | |
NB don't email me privately for help - ask on StackOverflow #ckan instead. | |
David | |
File "/vagrant/src/ckan/ckan/templates/home/snippets/search.html", line 1, in top-level template code | |
{% set tags = h.get_facet_items_dict('tags', limit=3) %} | |
File "/vagrant/src/ckan/ckan/lib/helpers.py", line 949, in get_facet_items_dict | |
if not c.search_facets or \ | |
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/werkzeug/local.py", line 347, in __getattr__ | |
return getattr(self._get_current_object(), name) |
The command line, in short…
wget -k -K -E -r -l 10 -p -N -F --restrict-file-names=windows -nH http://website.com/
…and the options explained