We have moved: https://github.com/magnetikonline/linuxmicrosoftievirtualmachines
Due to the popularity of this Gist, and the work in keeping it updated via a Gist, all future updates will take place at the above location. Thanks!
| #!/bin/bash | |
| if [ -z "$DEBUG" ]; then | |
| DEBUG=0 | |
| fi | |
| LOG_FILE=$( dirname $0 )/$( basename $0 .bash ).$( date +'%Y%m%d' ).log | |
| logger_debug(){ | |
| if [ $DEBUG -eq 1 ]; then |
We have moved: https://github.com/magnetikonline/linuxmicrosoftievirtualmachines
Due to the popularity of this Gist, and the work in keeping it updated via a Gist, all future updates will take place at the above location. Thanks!
| # functions | |
| declare -i OK=0 | |
| declare -i FAIL=1 | |
| [ -n "$LOG_LEVEL" ] || declare -i LOG_LEVEL=3 | |
| [ -n "$DATE_FORMAT" ] || DATE_FORMAT="%x %T" | |
| [ -n "$LOG_FILE" ] || LOG_FILE="progress.log" | |
| logger_fatal() { |
| # replace PAPERTRAIL_HOSTNAME and PAPERTRAIL_PORT | |
| # see http://help.papertrailapp.com/ for additional PHP syslog options | |
| function send_remote_syslog($message, $component = "web", $program = "next_big_thing") { | |
| $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); | |
| foreach(explode("\n", $message) as $line) { | |
| $syslog_message = "<22>" . date('M d H:i:s ') . $program . ' ' . $component . ': ' . $line; | |
| socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, PAPERTRAIL_HOSTNAME, PAPERTRAIL_PORT); | |
| } | |
| socket_close($sock); |
As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!
$ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring
| #!/bin/bash -e | |
| # UDF Documentation: http://www.mysqludf.org/lib_mysqludf_preg/ | |
| yum -y install pcre-devel gcc make automake mysql-devel | |
| wget http://www.mysqludf.org/lib_mysqludf_preg/lib_mysqludf_preg-1.0.1.tar.gz | |
| tar -zxvf lib_mysqludf_preg-1.0.1.tar.gz | |
| cd lib_mysqludf_preg-1.0.1 | |
| ./configure | |
| make install | |
| echo "You'll need to enter your MySQL password a few times to install the UDFs and test them" |
| <?php | |
| /* | |
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |