Skip to content

Instantly share code, notes, and snippets.

View chales's full-sized avatar

Chris Hales chales

View GitHub Profile
#!/bin/sh
themes_altered=()
for config in docroot/sites/*/themes/*/config.rb
do
theme_dir=`dirname $config`
git diff --cached --exit-code $theme_dir/sass/*.scss > /dev/null
if [ "$?" -eq 1 ]; then
@fubhy
fubhy / .gitconfig
Last active September 20, 2016 02:51
My personal .gitconfig (mostly stolen from others) :-)
[user]
# Credentials.
name = Foo Bar
email = [email protected]
drupal = $(whoami)
[credential]
# Save passwords in ~/.git-credentials.
helper = store
@MikeRogers0
MikeRogers0 / backup-to-s3.sh
Last active May 19, 2020 15:33
A method of backing up your website to Amazon S3.
#!/bin/bash
## Email Variables
EMAILDATE=`date --date="today" +%y-%m-%d`
EMAIL="[email protected]"
SUBJECT="[servername] Backup Script Started! - "$EMAILDATE
EMAILMESSAGE="/tmp/emailmessage1.txt"
echo "Just to let you know that the backup script has started."> $EMAILMESSAGE
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE
@turboladen
turboladen / gist:5416689
Last active March 2, 2018 14:21
Jenkins Swarm plugin init script
#!/bin/sh
### BEGIN INIT INFO
# Provides: hudsonvmfarm
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: hudsonswarm build slave
@jeetsukumaran
jeetsukumaran / build-gcc.sh
Last active February 27, 2025 22:17
Build and Install GCC Suite from Scratch
#! /bin/bash
GCC_VERSION="5.2.0"
WORKDIR="$HOME/src/"
INSTALLDIR="/platform"
## NOTE: XCode must be installed (through App Store) and the following run to install command-line tools.
## THIS IS IMPORTANT! Among other things, it creates '/usr/include' and installs the system header files.
# xcode-select --install
@kixorz
kixorz / aws_iam_policy.json
Last active April 11, 2022 10:32
Update Route53 DNS records from your EC2 instance using this simple Ruby script. You can call it from rc.local after setting your hostname locally. First parameter is the desired <hostname>.<domain> Domain and other parameters are hardcoded. This script is useful for handling internal DNS changes in your systems after instance changes. Attached …
{
"Statement": [
{
"Action": [
"route53:ChangeResourceRecordSets",
"route53:GetHostedZone",
"route53:ListResourceRecordSets"
],
"Effect": "Allow",
"Resource": [
@dergachev
dergachev / Intro-to-Vagrant-for-Drupal.md
Last active December 12, 2015 02:19
Vagrant Talk (Drupalcamp NJ & Drupalcamp Ottawa)

Vagrant tutorial

  • Slideshow structure
    • About me - Alex Dergachev, co-founder @evolvingweb (follow me gh/twitter: @dergachev)
    • The problem
    • The solution - Chef & Virtualbox & Vagrant
      • Benefits
        • repo + sql dump + cookbooks + ubuntu ISO = Drupal stack
        • prod vs dev consistency
  • sysadmin code reuse
@zanematthew
zanematthew / post-receive.sh
Created January 22, 2013 19:03
This is a git post-receive hook that "deploys" code to your working tree using native git commands, edit as needed.
post-receive#!/bin/sh
###
# This file will deploy code from the repository into the
# specified web-root.
#
# File name: post-receive
#
# Instructions:
# 1. Uncomment and edit the lines below as needed
@chrisl8888
chrisl8888 / gl.drush.inc
Last active October 10, 2015 22:48
drush gl - Use drush to git pull files from the target. Usage `drush gl @mysite.dev`
<?php
/**
* Implementation of hook_drush_command().
*/
function gl_drush_command() {
$items['git-pull'] = array(
'aliases' => array(
'gl'
),
@lavoiesl
lavoiesl / before.rules
Created September 18, 2012 02:24
Rate limit HTTP requests using UFW
### Add those lines after *filter near the beginning of the file
:ufw-http - [0:0]
:ufw-http-logdrop - [0:0]
### Add those lines near the end of the file
### Start HTTP ###