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
Downloads the lucid32 box, clones a new virtual machine and starts it. | |
Start the machine by using "vagrant up". | |
Log into the machine by using "vagrant ssh". | |
Shutdown the machine by "vagrant destroy". |
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
Simple multi VM system. | |
* Use "vagrant up" to install 3 vagrant boxes. | |
* Use "Vagrant ssh master|node1|node2" to ssh into the respective VM | |
* Most vagrant commands will need the additional nodename to work ("vagrant reload node1" for example) |
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
Simple multiVM system for 1 puppetmaster and 2 puppet nodes (not configured). | |
Uses a simple site.pp file as a provisioner that sets the /etc/host with the correct IP's of the virtualboxes. |
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
class apache { | |
package { "httpd" : | |
ensure => installed, | |
} | |
service { "httpd" : | |
ensure => running, | |
require => Package["httpd"]; | |
} | |
} |
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/sh | |
_complete_console() { | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
console="${COMP_WORDS[0]}" | |
cmds=` ${console} | tail -n +6 | grep '^ ' | awk '{ print $1 }' ` |
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
namespace eval moin { | |
bind pubm -|- * moin::moin | |
} | |
proc moin::moin { nick host handle chan text } { | |
if {[regexp -nocase -- {(^moin|^mornin)} $text]} { | |
putserv "PRIVMSG $chan :$nick moin" | |
} | |
} |
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
package require http | |
namespace eval twitter { | |
variable status_url "http://api.twitter.com/1/statuses/user_timeline/" | |
bind pub -|- "!twitter" twitter::tweet | |
} | |
proc twitter::tweet {nick uhost hand chan argv} { | |
if {[string length $argv] < 1} { |
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
class saffire { | |
// Returns saffire version (should be tuple major.minor.build) | |
public method version(); | |
// Returns the git revision which was used for building this saffire version | |
public method git_revision(); | |
// Returns the current run_mode: "fastcgi", "repl", "cli" | |
public method run_mode(); |
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
class foo { | |
public method bar(... args) { | |
for (i=0; i!=args.count(); i++) { | |
io.printf("arg %d : %s", i, args[i]); | |
} | |
} | |
public method baz(... args) { | |
self.bar(args); // This would send a list, so bar only has 1 argument | |
self.bar(... args); // maybe something like this, use the ... to tell that we are sending a varlist? |
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
pq = PriorityQueue[5:"foo":10, 5:"bar":2, 10:"baz":0, 1:"wuq":0]; | |
foreach (pq as key:value:prio, meta) { | |
if (meta.first) io.print("This is the first item!\n"); | |
if (meta.last) io.print("This is the last item!\n"); | |
io.print("Key: ",key," Val: ",value," Prio: ", prio); | |
} | |
Output: | |
This is the first item! |