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 python | |
from gevent import monkey | |
monkey.patch_all() # Patch everything | |
import gevent | |
import time | |
class Hub(object): | |
"""A simple reactor hub... In async!""" |
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
from fabric.api import * | |
# you've got to love them decorators :) | |
@parallel # dont have to be parallel , but might as well use it , wouldnt hurt with only 2 threads :) | |
@hosts('192.168.3.118', '192.168.6.142') | |
def pwd(): | |
run('pwd') |
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 'rye' | |
rbox = Rye::Box.new('my-server.com', | |
:user => 'user', | |
:password => 'asdA23') | |
puts rbox.pwd | |
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
[sole@solebox][~]% cat fabfile.py | |
#python code starts here | |
from fabric.api import run | |
def pwd(): | |
run('pwd') | |
#this code must be ran from the commandline using the following command: | |
# fab pwd |
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 Rob | |
{ | |
private int _lolcat; | |
public static void main(String[] arg){ | |
Rob bob = new Rob(12); | |
} | |
public Rob(int num){ | |
_lolcat = num; | |
} |
NewerOlder