Skip to content

Instantly share code, notes, and snippets.

View stovak's full-sized avatar
😀

Tom Stovall stovak

😀
View GitHub Profile
@stovak
stovak / gist:5570795
Last active December 17, 2015 07:09
basic virtual host
<VirtualHost *:80>
DocumentRoot /disk2/www/mktg-dev.apigee.com
ServerName mktg-dev.apigee.com
CustomLog "/var/log/httpd/mktg.log" combined
ErrorLog "/var/log/httpd/mktg.log"
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /disk2/www/mktg-dev.apigee.com
@stovak
stovak / gist:5272769
Created March 29, 2013 18:47
download the latest release RPM certs to a new install of red hat
#!/bin/sh
cd /tmp
curl http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/repodata/primary.sqlite.bz2 | bzip2 -dc > primary.sqlite
sqlite3 ./primary.sqlite "select url,location_href from packages where name like '%release%' order by name;"
## to do Take product of the third operation and replace "|" (pipe) with "/stable/Redhat/6/x86_64/" and pipe the result to:
# rpm -ivh $1
#!/bin/sh
export LOGFILE="/tmp/apigee-drupal-install.log"
export DRUPAL_WEBAPP="/var/www/html"
export DOCS_DB_SOURCE="/tmp/apigee-drupal/db/docs_r20_2013-03-13.sql"
export DOCS_HOSTNAME="docs.local"
export PORTAL_DB_SOURCE="/tmp/apigee-drupal/db/portal_r20_2013-03-13.sql"
export PORTAL_HOSTNAME="portal.local"
#!/bin/bash
echo "Downloading Cert from fedoraproject...\n"
rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm >> /tmp/apigee-drupal-install.log
echo "Installing Packages from various repos (this may take a few minutes)...\n"
sudo yum install -y httpd mysql mysql-server git php php-mysql php-xml gd gd-devel php-gd php-pear ImageMagick ImageMagick-devel >> /tmp/apigee-drupal-install.log
echo "Restarting Apache...\n"
sudo service httpd start >> /tmp/apigee-drupal-install.log
The file /etc/hosts controls the "known" hosts to your mac. You can hijack a website and tell it to use a specific server by defining a websites IP address in your /etc/hosts.
Open a terminal session on your mac and type:
`sudo nano /etc/hosts`
Hit the down arrow until you get to the end of the file.
Entries in /etc/hosts take the following syntax
<?php
echo php_uname('s');/* Operating system name */
echo "<br />";
echo php_uname('n');/* Host name */
echo "<br />";
echo php_uname('r');/* Release name */
echo "<br />";
echo php_uname('v');/* Version information */
echo "<br />";
@stovak
stovak / gist:4068794
Created November 13, 2012 22:14
Test Solr Server Creation.
public function testCreateDestroy() {
$ssh = new \Apigee\Shiva\SolrProvisioner();
$server = $ssh->getServer("dit");
for($x=0; $x < 10 ; $x++) {
$name = "Unit-Test-".$this->randomName(8);
$ssh->create("dit", $name);
$response = $this->curlIt("http://".$server->hostname);
$this->assertTrue((strlen(response['raw']) > 0 && strpos($response['raw'], $name)), "Solr should list org the newly-created organization in its list.");
$ssh->destroy("dit", $name);
$response = $this->curlIt("http://".$server->hostname);
@stovak
stovak / example.make
Created October 9, 2012 22:02
generate-makefile example.make
; This file was auto-generated by drush make
core = 7.x
api = 2
projects[drupal][version] = "7.x"
; Modules
projects[accordion_menu][subdir] = "contrib"
projects[accordion_menu][version] = "1.1"
@stovak
stovak / pre_post_less.patch
Created April 25, 2012 02:35
patch drupal less module with pre and post process hooks
diff --git a/less.module b/less.module
index 20c27317ba2be24b139a0a193dcaa4cad6694ff2..5c269ed4405c66171eb526048cdded2727d0f236 100644
--- a/less.module
+++ b/less.module
@@ -107,7 +107,21 @@ function _less_pre_render($styles) {
$data = preg_replace_callback('/url\(\s*[\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\s*\)/i', '_drupal_build_css_path', $contents);
try {
- $output_data = $less->parse($data);
+ $mods = module_implements("less_css_preprocess");