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
require 'find' | |
dir_to_scan = '.' | |
dir_to_scan = ARGV[0] if ARGV.count == 1 | |
dirs = [] | |
# First collect all directories, but ignore anything with .svn in it | |
Find.find( dir_to_scan ) do |entry| | |
next if entry =~ /\.svn/ |
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
cd /home/git | |
#clone gitlite repo | |
sudo -H -u git git clone git://github.com/sitaramc/gitolite /home/git/gitolite | |
sudo -H -u git mkdir /home/git/bin | |
sudo -u git -H sh -c "/home/git/gitolite/install -ln" | |
sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub | |
sudo chmod 777 /home/git/gitlab.pub |
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 | |
echo -e "\nbenchmark.sh -n<number of requests> -c<number of concurrency> <URL1> <URL2> ..." | |
echo -e "\nEx: benchmark.sh -n100 -c10 http://www.google.com/ http://www.bing.com/ \n" | |
## Gnuplot settings | |
echo "set terminal png | |
set output 'benchmark_${1}_${2}.png' | |
set title 'Benchmark: ${1} ${2}' |
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
ad |
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 | |
set -o errexit | |
# Author: David Underhill, | |
# Script to permanently delete files/folders from your git repository. To use | |
# it, cd to your repository's root and then run the script with a list of paths | |
# you want to delete, e.g., git-delete-history path1 path2 | |
if [ $# -eq 0 ]; then | |
exit 0 |
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 | |
additional_strace_args="$1" | |
MASTER_PID=$(ps auwx | grep php-fpm | grep -v grep | grep 'master process' | cut -d ' ' -f 6) | |
while read -r pid; | |
do | |
if [[ $pid != $MASTER_PID ]]; then | |
nohup strace -r -p "$pid" $additional_strace_args >"$pid.trc" 2>&1 & |
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 | |
echo 'Current script owner: ' . get_current_user(); | |
$processUser = posix_getpwuid(posix_geteuid()); | |
echo '<br/>Current process owner: ' . $processUser['name']; | |
phpinfo(); | |
?> |
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 | |
$repos['my-repo'] = array ( | |
"path" => "/var/www/example.com/htdocs/wp-content/plugins/my-repo" , | |
"branch" => "master" | |
); | |
$repos['theme-repo'] = array ( | |
"path" => "/var/www/example.com/htdocs/wp-content/plugins/theme-repo" , | |
"branch" => "stable" |
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
// construct XML | |
$xml = ''; | |
$xml .= '<Invoices>'; | |
$xml .= '<Invoice>'; | |
$xml .= '<Type>ACCREC</Type>'; | |
$xml .= '<Contact>'; | |
if( $order->billing_first_name == ""){ | |
$order->billing_first_name = get_usermeta($order->user_id,'first_name'); | |
} |
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
#!/usr/bin/perl -w | |
# | |
# splitmysqldump - split mysqldump file into per-database dump files. | |
use strict; | |
use warnings; | |
my $dbfile; | |
my $dbname = q{}; | |
my $header = q{}; | |
while (<>) { |
OlderNewer