Skip to content

Instantly share code, notes, and snippets.

View lvnilesh's full-sized avatar
💭
🏆 Vibranium Status Level

LV Nilesh lvnilesh

💭
🏆 Vibranium Status Level
View GitHub Profile
<?php
add_filter('tribe_events_eb_request', 'tribe_fix_eb_organizer_website', 10, 3);
function tribe_fix_eb_organizer_website( $request, $action, $params ){
if ( strpos( $action, 'organizer' ) !== false ) {
$params_array = array();
parse_str( $params, $params_array );
if ( $params_array['name'] == 'My Organizer' ) { // replace 'My Organizer' with the name of your organizer
$params_array['description'] = 'Put what you want in the organizer description here'; // customize this text
}
@lvnilesh
lvnilesh / s.php
Last active August 29, 2015 13:58
s.php
<?php
/**
*
* Safe Search and Replace on Database with Serialized Data v2.2.0
*
* This script is to solve the problem of doing database search and replace when
* some data is stored within PHP serialized arrays or objects.
*
* For more information, see
* http://interconnectit.com/124/search-and-replace-for-wordpress-databases/
Thanks.
Because of a change introduced in nginx cookbook 2.0, I needed to change the vagrant.json like this .
{
"nginx": {
"version": "1.4.0",
"default_site_enabled": true,
"source":
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}
# config.ru for Pow + Wordpress, based on http://stuff-things.net/2011/05/16/legacy-development-with-pow/
# added hackery to work around wordpress issues - Patrick Anderson (patrick@trinity-ai.com)
# clearly this could be cleaner, but it does work
require 'rack'
require 'rack-legacy'
require 'rack-rewrite'
# patch Php from rack-legacy to substitute the original request so
# WP's redirect_canonical doesn't do an infinite redirect of /
@lvnilesh
lvnilesh / config.ru
Last active August 29, 2015 14:04 — forked from brookr/config.ru
wordpress in pow
# config.ru for Pow + Wordpress, based on http://stuff-things.net/2011/05/16/legacy-development-with-pow/
# added hackery to work around wordpress issues - Patrick Anderson (patrick@trinity-ai.com)
# clearly this could be cleaner, but it does work
require 'rack'
require 'rack-legacy'
require 'rack-rewrite'
# patch Php from rack-legacy to substitute the original request so
# WP's redirect_canonical doesn't do an infinite redirect of /
@lvnilesh
lvnilesh / uninstall.sh
Created October 16, 2014 00:51
uninstall gems
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}
knife digital_ocean droplet create --server-name boeing123123 \
--image 6918990 \
--location 3 \
--size 66 \
--ssh-keys 421554 \
--bootstrap \
--identity-file "~/.ssh/id_rsa"
knife node run_list add boeing123123 'role[base]'
knife ec2 server create \
-N b787 \
-S ec2-oregon \
-i ~/.ssh/ec2-oregon.pem \
-x ubuntu \
-I ami-6ac2a85a \
-f t1.micro \
-d chef-full \
--ssh-port 22

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where: