Skip to content

Instantly share code, notes, and snippets.

View paulsheldrake's full-sized avatar

Paul Sheldrake paulsheldrake

  • Vancouver, Canada
View GitHub Profile
@paulsheldrake
paulsheldrake / nodejs-install.sh
Created July 31, 2013 16:23
Install NodeJS on CentOS 6. In one line...
yum -y update && yum -y groupinstall "Development Tools" && cd /usr/src && wget http://nodejs.org/dist/v0.10.15/node-v0.10.15.tar.gz && tar zxf node-v0.10.15.tar.gz && cd node-v0.10.15 && ./configure && make && sudo make install
@paulsheldrake
paulsheldrake / perf_yslow.sh
Last active December 27, 2015 11:39
This uses PhantomJS and YSlow for PhantomJS so get the min/max/average page load time for a specific url over a number of iterations. This script assumes you have PhantomJS installed and will download yslow if it's not in the correct place.
#!/bin/bash
# Example usage: sh perf_yslow.sh -l 3 -u http://example.com
while getopts "l:u:" opt; do
case $opt in
l)
LOOPS=$OPTARG
;;
u)
@paulsheldrake
paulsheldrake / EVO_1176.useragent_response.patch
Last active December 27, 2015 18:29
EVO-1176 When the monitoring agents from Zeus or OpenNMS ping the server to see if it is still up it causes a full Drupal bootstrap. This checks the user agent and returns a 200 without starting up Drupal.
diff --git a/.htaccess b/.htaccess
index 8eac0e4..5c5b7fc 100644
--- a/.htaccess
+++ b/.htaccess
@@ -105,6 +105,12 @@ DirectoryIndex index.php index.html index.htm
# uncomment the following line:
# RewriteBase /
+ # EVO-1176 - Redirect monitoring requests to status.php
+ # Status.php is added as part of the deployment process
#!/bin/sh
yum -y groupinstall "Development Tools"
wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh epel-release-5*.rpm
rpm -Uvh remi-release-5*.rpm
yum -y install python-devel screen
yum --enablerepo=remi install libcurl-devel -y
mkdir /opt/miner
cd /opt/miner
#!/bin/bash
yum -y groupinstall "Development Tools"
wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh epel-release-5*.rpm
rpm -Uvh remi-release-5*.rpm
yum -y install python-devel screen
yum --enablerepo=remi install libcurl-devel -y
cd ~/
wget http://darkgamex.ch/ufasoft/ufasoft_bitcoin-miner-0.32-x64-portable.tar.xz
@paulsheldrake
paulsheldrake / aws_lamp_drupal_kickstart_pt1.sh
Last active October 22, 2019 21:32
Setup AWS linux to have a LAMP stack. Part 1. After this script is run log in again and then run the second script. These steps are from the AWS Lamp setup tutorial http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html
#!/bin/bash
## update the server and then install the lamp stack
sudo yum update -y
## install PHP 55
## this also installs apache as it's a dependecy in amazons version of php55
sudo yum install -y php55 php55-mysqlnd php55-bcmath php55-gd php55-xml php55-mbstring php55-mcrypt php55-soap php55-xml
## install mysql
sudo yum install -y mysql-server
@paulsheldrake
paulsheldrake / aws_lamp_drupal_kickstart_pt2.sh
Last active January 4, 2016 20:49
Setup AWS linux to have a LAMP stack (folder permissions and drush) Part 2. Once this is done you can clone your drupal code in to /var/www/html, setup your database and you should be ready to go
#!/bin/bash
## fix the folder permissions for the html directory
sudo chown -R root:www /var/www
sudo chmod 2775 /var/www
find /var/www -type d -exec sudo chmod 2775 {} +
find /var/www -type f -exec sudo chmod 0664 {} +
## install drush
sudo pear channel-discover pear.drush.org
sudo pear install drush/drush-5.9.0
@paulsheldrake
paulsheldrake / package_code.sh
Last active August 29, 2015 13:56
sample create package of code
#!/bin/bash
# turn debugging on
set -x
source ./scripts/common.config.sh
# variables
BUILD_DIRECTORY=htdocs
COMPOSER_DIRECTORY=composer
@paulsheldrake
paulsheldrake / cuda_miner_setup.sh
Last active December 13, 2015 02:08
install CudaMiner on aws GPU instance to my altcoins
# update linux and install dev tools
sudo yum -y update
sudo yum -y groupinstall "Development Tools"
sudo yum -y install git libcurl libcurl-devel openssl-devel openssl
# jansson library, installing from epel release library
cd ~/
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/jansson-2.6-1.el6.x86_64.rpm
sudo yum -y install jansson-2.6-1.el6.x86_64.rpm
sudo yum -y update
sudo yum -y groupinstall "Development Tools"
sudo yum -y install libcurl-devel python-devel screen rsync
# install some depenencies for cuda
sudo yum -y install mesa-libGLU-devel-9.0-0.9.19.amzn1.x86_64 libXi-devel-1.6.1-3.7.amzn1.x86_64 libXmu-devel-1.1.1-2.8.amzn1.x86_64 libX11-devel-1.5.0-4.10.amzn1.x86_64 mesa-libGLU-devel-9.0-0.9.19.amzn1.x86_64
# install uthash
wget http://dl.fedoraproject.org/pub/epel/6/i386/uthash-1.9.8-3.el6.noarch.rpm
sudo yum install -y uthash-1.9.8-3.el6.noarch.rpm
cd ~/