This file contains hidden or 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/env bash | |
| if [ $# -eq 0 ] ; then | |
| printf "%s\n" "no args given, exiting" | |
| exit 1 | |
| fi | |
| export TMP_GEM_PATH=/tmp/$1 | |
| mkdir -p | |
| GEM_HOME=$TMP_GEM_PATH GEM_PATH=$TMP_GEM_PATH gem install $1 | |
| GEM_HOME=$TMP_GEM_PATH GEM_PATH=$TMP_GEM_PATH gem list \ | |
| | cut -d\ -f1 \ |
This file contains hidden or 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
| BOX_NAME=vagrant-build | |
| BASE_DIR="`pwd`/machines" | |
| BOX_DIR="${BASE_DIR}/${BOX_NAME}" | |
| mkdir -p ${BASE_DIR} | |
| VBoxManage createvm --name "${BOX_NAME}" --ostype RedHat_64 --basefolder ${BASE_DIR} | |
| VBoxManage registervm "${BOX_DIR}/${BOX_NAME}.vbox" | |
| mkdir -p tmp |
This file contains hidden or 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
| # Update, upgrade and install development tools: | |
| apt-get update | |
| apt-get -y upgrade | |
| apt-get -y install build-essential git-core curl libssl-dev \ | |
| libreadline5 libreadline5-dev \ | |
| zlib1g zlib1g-dev \ | |
| libmysqlclient-dev \ | |
| libcurl4-openssl-dev \ | |
| libxslt-dev libxml2-dev |
This file contains hidden or 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 | |
| # CentOS rbenv system wide installation script | |
| # Forked from https://gist.github.com/1237417 | |
| # Installs rbenv system wide on CentOS 5/6, also allows single user installs. | |
| # Install pre-requirements | |
| yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \ | |
| make bzip2 autoconf automake libtool bison iconv-devel git-core |
This file contains hidden or 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
| # Update, upgrade and install development tools: | |
| apt-get update | |
| apt-get -y upgrade | |
| apt-get -y install build-essential | |
| apt-get -y install git-core | |
| # Install rbenv | |
| git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv | |
| # Add rbenv to the path: |
This file contains hidden or 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
| before_filter :track | |
| ... | |
| private | |
| def track | |
| headers = request.headers | |
| query = {"h" => {}} | |
| query["h"]["site_id"]=Settings.gauges_site_id | |
| query["h"]["resource"]="http://#{headers['HTTP_HOST']}/#{headers['REQUEST_PATH']}" # REQUEST_URI seems to be incorrect |
This file contains hidden or 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
| --- a/source3/lib/system.c 2012-02-22 22:46:14.000000000 -0200 | |
| +++ b/source3/lib/system.c 2012-02-22 22:47:51.000000000 -0200 | |
| @@ -1161,7 +1161,14 @@ | |
| int groups_max(void) | |
| { | |
| -#if defined(SYSCONF_SC_NGROUPS_MAX) | |
| +#if defined(DARWINOS) | |
| + /* On OS X, sysconf(_SC_NGROUPS_MAX) returns 16 | |
| + * due to OS X's group nesting and getgrouplist |
This file contains hidden or 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/env ruby | |
| require 'fileutils' | |
| require 'tempfile' | |
| def replace_in_file(filename,oldvalue,newvalue) | |
| temp_file = Tempfile.new(File.basename(filename)) | |
| contents = File.read(filename) | |
| changed_contents = contents.gsub(oldvalue,newvalue).gsub(oldvalue.downcase,newvalue.downcase) | |
| temp_file.print(changed_contents) |
This file contains hidden or 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
| begin | |
| descriptors = [] | |
| files = [] | |
| ARGV.each do |filename| | |
| io = IO.sysopen(filename, 'r') | |
| descriptors << io | |
| i = IO.open(io) | |
| i.seek(0, IO::SEEK_END) # TODO: go back a few lines so we have context | |
| files << i |
This file contains hidden or 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
| import org.eclipse.swt.widgets.Display; | |
| import org.eclipse.swt.widgets.Shell; | |
| public class HelloWindows { | |
| public static void main(String[] args) { | |
| Display display = new Display(); | |
| Shell shell = new Shell(display); | |
| shell.setText("Hello, world!"); |