Skip to content

Instantly share code, notes, and snippets.

View freestream's full-sized avatar

Anton Samuelsson freestream

View GitHub Profile
#!/usr/bin/env bash
set -eu
declare -a file_patterns=('app/code/core' 'app/Mage.php$' '^index.php$')
exit_status=0
while read x file; do
for file_pattern in ${file_patterns[@]}; do
if [[ $file =~ $file_pattern ]]; then
@freestream
freestream / site.conf
Last active August 31, 2015 10:19
Octorber CMS lighttpd config
$HTTP["host"] =~ "example.domain.com" {
server.document-root = "/var/www/example/"
setenv.add-environment = (
"LARAVEL_ENV" => "dev"
)
url.rewrite-once = (
"^/(plugins|modules/(system|backend|cms))/(([\w-]+/)+|/|)assets/([\w-]+/)+[-\w^&'@{}[\],$=!#().%+~/ ]+\.(jpg|jpeg|gif|png|svg|swf|avi|mpg|mpeg|mp3|flv|ico|css|map|js|woff|ttf|eot)(\?.*|)$" => "$0",
"^/(system|themes/[\w-]+)/assets/([\w-]+/)+[-\w^&'@{}[\],$=!#().%+~/ ]+\.(jpg|jpeg|gif|png|svg|swf|avi|mpg|mpeg|mp3|flv|ico|css|js|woff|ttf|eot)(\?.*|)$" => "$0",
@freestream
freestream / toggle-hhvm
Last active August 29, 2015 14:20
Lighttpd bash script to toggle between HHVM and php in a Ubuntu system.
#!/bin/bash
#
# Lighttpd bash script to toggle between HHVM and PHP.
#
# Place the file in a shared bin directory so the file can be executed as root
# ex. /usr/local/bin/toggle-hhvm
#
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
@freestream
freestream / magento2-install-sample-data
Last active September 7, 2015 06:30
Install Magento2 Sample Data
Update composer.json and add following:
{
...
"require": {
"magento/framework": "~1.0.0-beta",
"magento/sample-data": "1.0.0-beta",
"magento/sample-data-media": "~0.42.0-beta2"
},
"repositories": [
@freestream
freestream / magento2.conf
Created September 5, 2015 10:36
Magento 2 lighttpd config
##
# Magento 2
##
$HTTP["host"] == "example.com" {
server.document-root = "/var/www/example/"
setenv.add-environment = (
# default Disables static file caching, provides verbose logging,
# automatic code compilation, enhanced debugging.
#
@freestream
freestream / magento2-bootstrap.php
Last active April 28, 2020 11:27
Bootstrap Magento 2
<?php
/**
*
* This script will load the Magento 2 Object Manager, after which you
* can execute anything you want. "One time" scripts, just to fool
* around with Magento's functionality or to debug stuff.
*
* Place this file in the root folder of the Magento instance and execute:
* php magento2-bootstrap.php