Skip to content

Instantly share code, notes, and snippets.

Avatar

Josh Ribakoff joshribakoff

View GitHub Profile
@joshribakoff
joshribakoff / Vagrantfile
Created Oct 11, 2017 — forked from stephenreay/Vagrantfile
Local file override for Memory/CPU limits in Vagrant
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby
if File.exists?('./Vagrantfile.override.rb')
require_relative './Vagrantfile.override.rb'
end
# Defaults for CPU and Memory
CPUS ||= 1
MEMORY ||= 1024
View gist:eec82fdf61209db815b682069110dcec
<!DOCTYPE html>
<?php
if(file_exists(__DIR__.'/config.php')) {
$configuration = require __DIR__ . '/config.php';
} else {
$configuration = require __DIR__ . '/config.dist.php';
}
session_start();
if(isset($configuration['environment']) && $configuration['environment'] == 'dev') {
View gist:8ff470adae1812052dbb033078788a3a
- name: Install apache2 and php etc
apt: name={{ item }} state=present
with_items:
- apache2
notify:
- restart apache
- name: update apache ports.conf
synchronize:
src: ../vagrant-production/apache2/ports.conf
View gist:92185d520caa73b9741bc37e88154d3c
RUNNING HANDLER [restart apache] ***********************************************
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/system/service.py
<default> ESTABLISH LOCAL CONNECTION FOR USER: vagrant
<default> EXEC /bin/sh -c 'echo ~ && sleep 0'
<default> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/vagrant/.ansible/tmp/ansible-tmp-1500439923.22-278690191575535 `" && echo ansible-tmp-1500439923.22-278690191575535="` echo /home/vagrant/.ansible/tmp/ansible-tmp-1500439923.22-278690191575535 `" ) && sleep 0'
<default> PUT /tmp/tmphV7b7H TO /home/vagrant/.ansible/tmp/ansible-tmp-1500439923.22-278690191575535/service.py
<default> EXEC /bin/sh -c 'chmod u+x /home/vagrant/.ansible/tmp/ansible-tmp-1500439923.22-278690191575535/ /home/vagrant/.ansible/tmp/ansible-tmp-1500439923.22-278690191575535/service.py && sleep 0'
<default> EXEC /bin/sh -c '/usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1500439923.22-278690191575535/service.py; rm -rf "/home/vagrant/.ansible/tmp/ansible-tmp-1
View gist:b8aef3a670699a0499ffbf3f2a4f23ab
---
- hosts: all
vars:
http_port: 80
max_clients: 200
tasks:
#- {script: /vagrant/bootstrap.sh, become: yes}
#- {include: roles/common/tasks/common.yml, become: yes}
@joshribakoff
joshribakoff / gist:5689343
Created Jun 1, 2013
phpunit bootstrap /zf2 service manager
View gist:5689343
<?php
use Zend\ServiceManager\ServiceManager;
use Zend\Mvc\Service\ServiceManagerConfig;
class phpunit_bootstrap
{
static $serviceManager;
static function go()
{
/**
@joshribakoff
joshribakoff / gist:6905615
Created Oct 9, 2013
How to test a magento class thru command line for Ozzy
View gist:6905615
<?php
require_once 'app/Mage.php';
Mage::app('admin','store');
// this class is loaded in app/code/local/Paquin/Ozzy.php
$ozzy = new Paquin_Ozzy('json2.json');
var_dump($ozzy->categoryIdsToShow());
View gist:6852699
print_r($this->getReadAdapter()->query('select * from elite_1_definition')->fetchAll());
@joshribakoff
joshribakoff / gist:6852259
Last active Dec 24, 2015
Shorten the docblocks, multi file recursive multi-line find & replace
View gist:6852259
<?php
/** Enable blash globbing, or run with zsh instead of bash */
`ls **/*.php > list.txt`;
$find = "/**
* Vehicle Fits (http://www.vehiclefits.com for more information.)
* @copyright Copyright (c) Vehicle Fits, llc
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/";
@joshribakoff
joshribakoff / gist:6827222
Created Oct 4, 2013
Split 2 magento stores, in an almost atomic operation
View gist:6827222
# Edit your vhosts, and then reload apache immediatly after this script completes.
mysqldump --user=root magento_live > magento_new.sql
rsync -avr path/to/live/ path/to/new
mysql --user=root -e "create database magento_new"
mysql --user=root magento_new < magento_new.sql
You can’t perform that action at this time.