Skip to content

Instantly share code, notes, and snippets.

View jjam3774's full-sized avatar

Jeffrey James jjam3774

View GitHub Profile
@jjam3774
jjam3774 / remote.rb
Last active November 16, 2018 21:43
A script that will deploy changes to multiple servers. This is just a brief example of what can be done if you need to make quick changes on multiple servers when time is hitting close to the deadline.
#!/usr/bin/ruby
require 'rubygems'
require 'net/ssh'
class Remote
attr_accessor :hostfile, :user, :pass, :commands
def initialize(hostfile,user, pass, commands)
@hostfile = hostfile
@user = user
@jjam3774
jjam3774 / remote.py
Last active November 16, 2018 21:43
A python version of the ruby script that allows you to execute the same command on multiple servers.
#!/usr/bin/python
import paramiko
import getpass
class Remote():
def __init__(self, hostfile, username, commands):
self.hostfile = hostfile
self.username = username
@jjam3774
jjam3774 / pro1.py
Last active December 20, 2015 16:38
Basic Example of what Jython can do with Swing
#!/usr/bin/jython
from java.awt.event import ActionListener
from java.awt import *
from java.lang import Runnable
from javax.swing import *
import os
class mainWindow(Runnable):
def __init__(self):
self.frame = JFrame("Tools", defaultCloseOperation = JFrame.EXIT_ON_CLOSE)
@jjam3774
jjam3774 / jgui.py
Last active December 20, 2015 17:49
Another sketch of what Jython can do with Swing.. No threading done.
#!/usr/bin/jython
import javax.swing as swing
from java.awt import BorderLayout, GridLayout
import java
import os
class jGUI(swing.JFrame):
def __init__(self):
swing.JFrame.__init__(self, title="Server Specs", size=(350, 400), defaultCloseOperation = swing.JFrame.EXIT_ON_CLOSE)
@jjam3774
jjam3774 / url_count.py
Created November 2, 2013 05:20
Url Count
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
def main():
command = "cat foo.txt| rev | cut -d\. -f1,2 | rev | sort | uniq -c"
print("________________________Results_____________________________")
@jjam3774
jjam3774 / SSHKeyUtil.rb
Last active July 29, 2020 23:13
A Utility that will allow you to create and copy authentication keys to your remote servers.
#!/usr/bin/ruby
require 'rubygems'
require 'pty'
require 'expect'
require 'highline/import'
module SSHKeyUtil
$expect_verbose = true
$VERBOSE=true
@jjam3774
jjam3774 / SSHKeyComplete.rb
Created January 2, 2014 07:13
A more complete version of the previous script
#!/usr/bin/ruby2.0 -v
require 'rubygems'
require 'pty'
require 'expect'
require 'highline/import'
$expect_verbose = true #To see the output of the session
#VERBOSE=nil
def create_key
@jjam3774
jjam3774 / auto_keygen.py
Created January 2, 2014 16:48
Another Version of the Automated Keygen Python Script..
#!/usr/bin/python
import time
import pexpect
import getpass
def create_key():
gen = pexpect.spawn('ssh-keygen -t rsa', timeout=None)
gen.expect('Enter file in')
gen.sendline('')
gen.expect('Enter passphrase')
@jjam3774
jjam3774 / testload.py
Created February 17, 2014 17:26
Test Load a page...
#!/usr/bin/python
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
from httplib import HTTPConnection
import time
import re
import random
@jjam3774
jjam3774 / loadakamai.py
Created February 17, 2014 17:27
load with akamai
#!/usr/bin/python
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
from httplib import HTTPConnection
import time
import re