View gist:6099219
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################ | |
# Pre commit hook for git | |
# | |
# @package: utilities | |
# @subpackage: utilities\git | |
# @author: Aleksey Korzun <al.ko@webfoundation.net> | |
################################################################ |
View gist:28a610afc223c435a888ac491f3b3b8e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## On production slave (out of rotation) | |
# Create our database dump | |
mysqldump ${DATABASE} > ${DATABASE}-${BUILD_ID}.sql | |
gzip -6 ${DATABASE}-${BUILD_ID}.sql | |
# Transfer it | |
scp ${DATABASE}-${BUILD_ID}.sql.gz jenkins@__STAGING__.__DOMAIN__.com:/tmp/${DATABASE}-${BUILD_ID}.sql.gz | |
# Clean up |
View gist:f2bca06f74257cfae288
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Credit to Paul Moore / @Paul_Reviews: | |
1. Navigate to http://www.roboform.com/have-i-been-hacked | |
2. Replace 'Enter account to test' with following: <script type="text/javascript">$('img').attr('src', 'https://lastpass.com/images/lastpass-logo.png');</script> | |
3. Click on 'Check Now' | |
In action: | |
http://g.recordit.co/oBk26XEv0P.gif |
View gulpfile.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Include gulp and plugins | |
var gulp = require('gulp'), | |
rename = require('gulp-rename'), | |
autoprefixer = require('gulp-autoprefixer'), | |
minifycss = require('gulp-minify-css'), | |
clean = require('gulp-clean'), | |
concat = require('gulp-concat'), | |
browserSync = require('browser-sync'), | |
reload = browserSync.reload, | |
hologram = require('gulp-hologram'), |
View gist:7bef94033c5f5cf3a57e4a900efe3ddc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extract payload | |
mkdir -p /www/site/packages/${BUILD_ID}/ | |
tar -zxf /www/site/packages/package.tar.gz -C /www/site/packages/${BUILD_ID}/ | |
# Maintenance logic | |
IS_MAINTENANCE=true | |
if [ ! -f "/www/site/packages/${BUILD_ID}/www/maintenance.flag" ]; then | |
IS_MAINTENANCE=false | |
touch "/www/site/packages/${BUILD_ID}/www/maintenance.flag" | |
fi |
View gist:c70dc6385b89586fdc6de9c58c80d948
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Creating package structure..." | |
rm -rf package | |
# Purge old tags | |
echo "Tag: jenkins-${JOB_NAME}" | |
git fetch --tags | |
tag_limit=4 | |
tag_current=`git tag -n |grep -i "jenkins-${JOB_NAME}" | wc -l` |
View policy.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE policymap [ | |
<!ELEMENT policymap (policy)+> | |
<!ELEMENT policy (#PCDATA)> | |
<!ATTLIST policy domain (delegate|coder|filter|path|resource) #IMPLIED> | |
<!ATTLIST policy name CDATA #IMPLIED> | |
<!ATTLIST policy rights CDATA #IMPLIED> | |
<!ATTLIST policy pattern CDATA #IMPLIED> | |
<!ATTLIST policy value CDATA #IMPLIED> |
View gist:6444589
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Proof of concept, segmentation fault (spl_array.c/igbinary.c) | |
* when using nested objects. | |
* | |
* PHP 5.3.6, PECL-Memcached 1.x, Igbinary 1.x | |
* | |
* @author Aleksey Korzun | |
*/ |
View tabstospaces
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name *.php ! -type d ! -name _tmp_ -exec sh -c 'expand -t 4 {} > _tmp_ && mv _tmp_ {}' \; |
View update-pingdom-iptables-centos.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Whitelist Pingdom probe-servers in iptables. | |
# | |
# Create a chain called "PINGDOM" and jump to it somewhere before | |
# the final REJECT/DROP, e.g. | |
# | |
# # New chain for Pingdom rules | |
# :PINGDOM - [0:0] | |
# |
NewerOlder