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
(define (fast-mult a b) | |
(cond ((= b 0) 0) | |
((even? b) (fast-mult (+ a a) (/ b 2))) | |
(else (+ a (fast-mult a (- b 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/bash | |
# Arguments | |
whitelist=$@ | |
# Constants | |
repo_root=/opt/myrepos | |
# Stolen from util | |
function convert_cart_name_to_namespace_id { |
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
diff --git a/stickshift/abstract/abstract/info/lib/util b/stickshift/abstract/abstract/info/lib/util | |
index 86fae75..1e8dcad 100755 | |
--- a/stickshift/abstract/abstract/info/lib/util | |
+++ b/stickshift/abstract/abstract/info/lib/util | |
@@ -33,6 +33,9 @@ function get_stop_order { | |
echo $(get_component_order "tac") | |
} | |
+function get_installed_framework_carts { | |
+ (cd $OPENSHIFT_HOMEDIR; ls -d {diy-0.1,jbossas-7,jbosseap-6.0,jenkins-1.4,nodejs-0.6,perl-5.10,php-5.3,python-2.6,ruby-1.8,ruby-1.9,zend-5.6} 2>/dev/null) |
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/env ruby | |
require '/var/www/openshift/broker/config/environment' | |
CloudUser.find_all(nil).each { |u| | |
u.applications.each { |a| | |
if a.scalable | |
puts a.name | |
a.elaborate_descriptor | |
carts = a.embedded.keys.dup | |
carts << a.framework |
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/env ruby | |
# Usage ./cartgen.rb <cart_name> | |
require 'fileutils' | |
require 'logger' | |
$log = Logger.new(STDERR) | |
cart_name = ARGV[0] | |
cart_short_name = cart_name.upcase |
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
# Base on the Fedora image created by Matthew | |
FROM mattdm/fedora | |
# Install the JBoss Application Server 7 | |
RUN yum install -y nodejs npm | |
ADD . /src | |
RUN cd /src; npm install |
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
[mrunal@localhost nodejs]$ cat package.json | |
{ | |
"name": "docker-fedora-nodejs", | |
"private": true, | |
"version": "0.0.1", | |
"description": "Node.js Hello World app on Fedora using docker", | |
"author": "Mrunal Patel <[email protected]>", | |
"dependencies": { | |
"express": "*" | |
} |
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/env node | |
var WebSocketClient = require('websocket').client; | |
var client = new WebSocketClient(); | |
client.on('connectFailed', function(error) { | |
console.log('Connect Error: ' + error.toString()); | |
}); | |
client.on('connect', function(connection) { |
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 'socket' | |
require 'ipaddr' | |
# From ioctls.h | |
SIOCGIFADDR = 0x8915 | |
def ip_address(iface) | |
sock = UDPSocket.new | |
buf = [iface,""].pack('a16h16') | |
sock.ioctl(SIOCGIFADDR, buf); |
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
package main | |
import ( | |
"log" | |
"os" | |
"syscall" | |
) | |
func main() { | |
syscall.ForkLock.Lock() |
OlderNewer