-
Always start the script with a shebang line
#!/bin/bash
-
Always run the script directly
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/sh | |
# This should result in very different completion times for the 2 runs. | |
# This script is useful to be sure that ionice works on your kernel since it's possible to have the | |
# ionice command yet using it has no effect | |
# you can check your scheduler with something like | |
# cat /sys/block/sda1/queue/scheduler | |
# NOTE: I wrote this to help me figure out if ionice was working on my system. It doesn't seem to be, since the | |
# output of this script indicates that the priorities, while adjusted, don't get reflected in the real world timings. | |
# I don't know if my script is wrong or if my server is mis-configured. |
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
# debug performance stuff | |
SetEnvIf Request_URI ^/panel panel-request | |
LogFormat "%h %l %u %t %T \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" debug_performance | |
CustomLog /Users/alanpinstein/dev/sandbox/virtualtour/log/debug_performance_log debug_performance env=panel-request |
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 | |
# RESULTS, feel free to repro yourself | |
# | |
# noLock FAIL | |
# accessShare FAIL | |
# rowShare FAIL | |
# rowExclusive FAIL | |
# shareUpdateExclusive SUCCESS | |
# share FAIL+DEADLOCKS | |
# shareRowExclusive SUCCESS |
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
$ export USE_ZEND_ALLOC=0; valgrind --tool=memcheck --num-callers=30 --leak-check=full --show-reachable=yes [rets php script] |
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 'this is stdout' && this_is_stderr) | |
(echo 'this is stdout' && this_is_stderr) 1> /dev/null | |
(echo 'this is stdout' && this_is_stderr) 2> /dev/null | |
(echo 'this is stdout' && this_is_stderr) > /dev/null 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
#!/bin/sh | |
echo ">> STDOUT and STDERR" | |
(echo 'this is stdout' && this_is_stderr) | |
echo ">> STDERR only" | |
(echo 'this is stdout' && this_is_stderr) 1> /dev/null | |
echo ">> STDOUT only" | |
(echo 'this is stdout' && this_is_stderr) 2> /dev/null | |
echo ">> NOTHING" | |
(echo 'this is stdout' && this_is_stderr) > /dev/null 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 | |
manifest(array( | |
"pear", "apinstein.pearfarm.org/mp", "1.0.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
<?php | |
$fromBranch = 'master'; | |
$toBranch = 'videoClips-integration'; | |
// find common ancestor | |
$commonAncestor = commonAncestor($fromBranch, $toBranch); | |
print "Common ancestor of {$fromBranch}..{$toBranch} is {$commonAncestor}\n"; |
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
# Custom ImageMagick build for Heroku via Vulcan | |
vulcan create vulcan-builder | |
curl -O http://www.imagemagick.org/download/legacy/ImageMagick-6.7.4-10.tar.gz | |
tar zxvf ImageMagick-6.7.4-10.tar.gz | |
vulcan build -v -s ./ImageMagick-6.7.4-10 -c "./configure --prefix /app/vendor/ImageMagick-6.7.4-10 '--disable-shared' '--with-quantum-depth=8' '--with-lcms' '--with-gslib' --'with-fontconfig' && make install" -p /app/vendor/ImageMagick-6.7.4-10 | |
# ==> downloads output to /tmp/ImageMagick-6.7.tgz | |
cd /path/to/project |