Skip to content

Instantly share code, notes, and snippets.

View paulsheldrake's full-sized avatar

Paul Sheldrake paulsheldrake

  • Vancouver, Canada
View GitHub Profile
#!/user/bin
# install node/npm
sudo curl --silent --location https://rpm.nodesource.com/setup | bash -
sudo yum -y install nodejs
# install gems/packages needed for theme
sudo gem install bundler
sudo npm install -g bower grunt-cli
#!/user/bin
sudo yum update -y
sudo yum wget -y
# install latest version of ruby
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash -s stable --ruby
wget https://gist.githubusercontent.com/paulsheldrake/7c3c70b25e8c652034c2/raw/install_theming_tools_part2.sh
@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
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 ~/

Keybase proof

I hereby claim:

  • I am paulsheldrake on github.
  • I am paulsheldrake (https://keybase.io/paulsheldrake) on keybase.
  • I have a public key whose fingerprint is BD1A 7A5C FB5B 990A 0512 6693 D1A1 6778 5609 D984

To claim this, I am signing this object:

@paulsheldrake
paulsheldrake / create_new_drupal_db.sh
Last active August 29, 2015 14:11
Create a new empty db for Drupal
#!/bin/bash
echo "Create drupal user"
mysql -u root --password="root" -e "CREATE USER 'drupal'@'localhost' IDENTIFIED BY 'drupal';"
mysql -u root --password="root" -e "GRANT ALL ON *.* TO 'drupal'@'localhost';"
mysql -u root --password="root" -e "flush privileges;"
echo "Create drupal db"
mysqladmin -u root --password="root" create drupal
@paulsheldrake
paulsheldrake / setup_codesniffer.sh
Last active August 29, 2015 14:11
Setup codesniffer on Fluxus Ubuntu machine
#!/bin/bash
cd /var/www/html
drush pm-download coder --destination=$HOME/.drush -y
drush cache-clear drush
sudo pear install PHP_CodeSniffer
sudo cp -R $HOME/.drush/coder/coder_sniffer/Drupal/ /usr/share/pear/PHP/CodeSniffer/Standards/
echo "Setup complete"
echo ""
echo "Example command. Will scan all custom modules"
echo "phpcs --standard=Drupal /vagrant/docroot/sites/all/modules/custom/"
#!/bin/bash
PHANTOM_JS="phantomjs-1.9.8-linux-x86_64"
sudo apt-get install -y build-essential chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev
cd ~
wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS.tar.bz2 /usr/local/share/
cd /usr/local/share/
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/share/phantomjs
@paulsheldrake
paulsheldrake / phantomjs_compile.sh
Last active August 29, 2015 14:13
Compile PhantomJS on Centos/Red Hat. This can be compiled on AWS T2.Medium instance before you run out of the default credits. I've picked a specific commit to build from but you can delete that line and build from master if you like.
sudo yum -y update
sudo yum -y install "Development tools"
sudo yum -y install gcc gcc-c++ make flex bison gperf ruby openssl-devel freetype-devel fontconfig-devel libicu-devel sqlite-devel libpng-devel libjpeg-devel git
cd ~
git clone https://github.com/ariya/phantomjs.git
cd phantomjs
git checkout 05d7e3e77d78904d504bd20e61c2bb3c41cd8a0d
chmod 777 build.sh
./build.sh --confirm
@paulsheldrake
paulsheldrake / compile_phantomjs_ubuntu.sh
Last active August 29, 2015 14:13
Compile PhantomJS on Ubuntu
#!/bin/bash
sudo apt-get upgrade -y
sudo apt-get install build-essential -y
sudo apt-get install g++ flex bison gperf ruby perl libsqlite3-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev libpng-dev libjpeg-dev git -y
cd ~
git clone https://github.com/ariya/phantomjs.git
cd phantomjs
git checkout 2.0
chmod 777 build.sh