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/bash | |
# Usage: ./create-war.sh DIRECTORY WARFILE | |
# e.g. ./create-war.sh Siesta Siesta.war | |
DIRECTORY=$1 | |
WARFILE=$2 | |
cd $DIRECTORY/WebContent | |
jar -cf ../../$WARFILE * | |
cd - | |
ls -l $WARFILE |
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
#!/usr/bin/python | |
# addmount.py | |
# | |
# This will add a shared drive using a given password. Only requirement is pexpect which can be downloaded using apt-get or pip | |
# | |
# - password contains $ and ! marks that need to be escaped | |
# - had issues putting these in the -o "password=" param and had issues with the cred file | |
import pexpect | |
password = "$wirleysaysneverquit!!!" |
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 | |
# Usage: | |
# ./clone.sh TESTENV_TO_CLONE_DIR NEW_TEST_ENV_DIR | |
# ./clone.sh TESTENV08-HOST TESTENV03-HOST | |
# The above will clone 08 to 03 and register the vm | |
# | |
# * Do not end the argument directories with a slash! | |
# Date: Mar 10, 2015 | |
DIR_DS=$(pwd) |
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
# Usage: powershell -File SetIP.ps1 -ip "101.54.149.103" | |
# Works on Windows 7 64bit | |
# get params | |
param ( | |
[string]$ip = "101.54.149.106", | |
[string]$gw = "101.54.149.1", | |
[string]$sub = "255.255.255.0", | |
[string]$dns1 = "101.61.241.311", | |
[string]$dns2 = "101.61.251.311" |
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
# Usage: powershell -File SetHostname.ps1 -name "Terminator" | |
# Works on Windows 7 64bit | |
# Requires restart for changes to take effect | |
# get params | |
param ( | |
[string]$name = "Dev" | |
) | |
Write-Host "Server: $name" |
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/bash | |
# Original: http://steve-jansen.github.io/blog/2014/11/20/how-to-use-jenkins-to-monitor-cron-jobs/ | |
# example cron script to post logs to Jenkins | |
# exit on error | |
set -e | |
log=`mktemp tmp.XXX` | |
timer=`date +"%s"` | |
jenkins_job=my_monitoring_job |
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
#!/usr/bin/env python | |
# Edit: curious if netmiko would work with the SSA devices too: https://github.com/ktbyers/netmiko | |
# Edit2: Used netmiko to create a handler for extreme and enterasys switches to make the below code even simpler | |
# https://gist.github.com/nitrocode/ce888d3eb529cf78f4e0 | |
import sys | |
import paramiko | |
import time | |
# seems to work for all switches and ssh enabled devices |
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
#!/usr/bin/env python | |
# This will run an ssh command successfully on an enterasys SSA and so SSH must be enabled on the device(s). | |
# paramiko can be used but netmiko simplifies the code for these switches if you set the device_type to "a10" | |
from netmiko import ConnectHandler | |
#enterasyshandle = {'device_type':'a10', 'ip' : '10.54.116.175', 'username':'admin', 'password':''} | |
enterasyshandle = {'device_type':'enterasys', 'ip' : '10.54.116.175', 'username':'admin', 'password':''} | |
net_connect = ConnectHandler(**enterasyshandle) | |
output = net_connect.send_command('show config policy') |
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/bash | |
# install apt-cyg fork | |
lynx -source https://raw.githubusercontent.com/kou1okada/apt-cyg/master/apt-cyg > apt-cyg | |
install apt-cyg /bin | |
# update | |
apt-cyg update | |
# install everything |
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
:: install choco | |
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin | |
:: use choco to install packages in the following categories: | |
:: - cleaning, commandline, programming, browsers, networking, and dependencies | |
choco install bleachbit ccleaner conemu cygwin ultradefrag notepadplusplus atom visualcplusplusexpress2008 python2 eclipse firefox google-chrome-x64 tightvnc putty wireshark nmap filezilla rdcman dotnet3.5 javaruntime -y |
OlderNewer