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/bash | |
# Updates IP addresses of a SmartOS VM | |
# This script stops the VM, updates the IP address(es), | |
# and starts the VM back up. | |
# | |
# Usage: | |
# vmip.sh <uuid> <ip1> [ip2] [ip3] [...] | |
# | |
# The IP's are applied to NICs of the VM in order. The |
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/sh | |
# | |
# Given a SmartOS VM alias, returns the UUID. | |
# | |
# Usage: | |
# | |
# vmid <alias> | |
# | |
# vmadm get `vmid <alias>` | |
# |
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/bash | |
# Moves a SmartOS VM to a different host | |
# This script stops the VM, sends it to the target host, | |
# imports it on the target host, and starts it on the | |
# target host. It is your responsibility to remove it on | |
# the origin host after confirming the script worked as | |
# expected. | |
# | |
# Usage: |
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/bash | |
# | |
# import-image (https://gist.github.com/jasonpincin/4958050) | |
# | |
# Helper utility for smartos-image-server | |
# https://github.com/nshalman/smartos-image-server | |
# | |
# Global-zone companion script available: | |
# https://gist.github.com/jasonpincin/4958099 | |
# |
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/bash | |
# Creates an image from a VM | |
# WARNING: You should run sm-prepare-image inside the zone | |
# BEFORE running this script! | |
# | |
# This script requires the smartos-image-server to be | |
# equipped with the import-image script: | |
# https://gist.github.com/jasonpincin/4958050 | |
# |
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
if (require.main === module) { | |
var _t = require('jasmine-node').getEnv() | |
_t.addReporter(new (require('jasmine-tapreporter'))(console.log)) | |
process.nextTick(_t.execute.bind(_t)) | |
} | |
describe('something', function () { | |
it('should do something', function () { | |
}) |
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
if (require.main === module) { | |
var _t = require('jasmine-node').getEnv() | |
_t.addReporter(new (require('jasmine-tapreporter'))(console.log)) | |
process.nextTick(_t.execute.bind(_t)) | |
} |
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
var http = require('http') | |
var shoe = require('shoe') | |
var dnode = require('dnode') | |
var static = require('node-static') | |
var content = new static.Server(__dirname+'/static') | |
var server = http.createServer(content.serve.bind(content)) | |
var socket = shoe(function (connection) { | |
// expose two methods: getTime and square | |
var api = dnode({ |
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
var shoe = require('shoe') | |
var dnode = require('dnode') | |
var document = require('global/document') | |
var onTime = function (err, time) { | |
document.getElementById('time').innerHTML = time | |
} | |
var onSquare = function (err, val) { | |
document.getElementById('square').innerHTML = val | |
} |
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
<html> | |
<head> | |
<title>RPC Example</title> | |
<script type="text/javascript" src="bundle.js"></script> | |
</head> | |
<body> | |
<div id="time" /> | |
<div id="square" /> | |
</body> | |
</html> |
OlderNewer