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/ruby | |
require 'optparse' | |
options = {:username => nil, :role => nil, :group => nil} | |
parser = OptionParser.new do|opts| | |
opts.banner = "Usage: bl-rest.rb [options]" | |
opts.on('-u', '--username name', 'username') do |username| | |
options[:username] = username; |
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/ruby | |
require 'expect' | |
require 'pty' | |
# PTY without expect can easily automate interactive programs... | |
PTY.spawn('./inter.rb'){|o,i,p| | |
i.puts("yes") | |
o.gets #not needed to work just included it to clean up look on-screen | |
i.puts("yes") |
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/ruby | |
def service_agent | |
e = IO.popen('zenity --height=250 \ | |
--list \ | |
--checklist \ | |
--column "restart" \ | |
--column "service" \ |
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/ruby -w | |
def replace_ref(file, fileindx, &directive) | |
old_stdout = $stdout | |
argf = ARGF.clone | |
argf.argv.replace [file] | |
argf.inplace_mode = fileindx | |
argf.each_line() { |line| | |
yield line |
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/ruby -w | |
def replace_ref(file, fileindx, &directive) | |
old_stdout = $stdout | |
argf = ARGF.clone | |
argf.argv.replace [file] | |
argf.inplace_mode = fileindx | |
argf.each_line() { |line| | |
yield line |
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/python | |
import urllib2 | |
import json | |
import getpass | |
import sys | |
def rest_uptime(password): | |
username = raw_input("Username: ") |
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/python | |
import urllib2 | |
import mechanize | |
import socket | |
import os | |
import platform | |
class HttpdAgent(): | |
def __init__(self): |
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/python | |
# -*- coding: utf-8 -*- | |
import urllib2 | |
import os | |
import time | |
def complete_info(): | |
error_file = open('error_file.txt', 'w') | |
for i in open('linkfile'): |
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/python | |
# -*- coding: utf-8 -*- | |
# <nbformat>3.0</nbformat> | |
# <codecell> | |
from httplib import HTTPConnection | |
import time | |
import re |