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
import os | |
import paramiko | |
paramiko.util.log_to_file('/tmp/paramiko.log') | |
paramiko.util.load_host_keys(os.path.expanduser('~/.ssh/known_hosts')) | |
host = 'local' | |
port = 22 | |
username = 'user' | |
files = ['file1', 'file2', 'file3', 'file4'] |
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
<?php | |
function conf_to_array($ini_file) { | |
$phpini = file($ini_file); | |
$configuration = array(); | |
foreach($phpini as $line) { | |
if($line[0] == ";") { continue; } | |
if($line[0] == "[") { continue; } | |
if(trim($line) == "") { continue; } | |
$php_var = explode("=", $line); |
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/sh | |
#This goes in your devclass/classnew or devclass/classis directory | |
#To execute it: sh check_cap_versions.sh or ./check_cap_versions.sh, | |
# if you have +x mode | |
STAGES=config/deploy | |
for file in `ls -a $STAGES -I sample.rb -I vagrant.rb -I local.rb -I localhost.rb| grep \.rb$` | |
do |
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
STDOUT.sync=true | |
require 'rubygems' | |
require 'em-websocket' | |
EM.run { | |
EM::WebSocket.run(:host => "0.0.0.0",:port => 8080) do |ws| | |
ws.onopen { |handshake| | |
puts "WebSocket connection open" | |
ws.send "Connected" |