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 | |
| # Polls imap server, searches for a string in an unread email's subject, and downloads its attachment. | |
| # | |
| # Use case: | |
| # Someone refuses or does not know how to save an attachment to a webserver so he/she sends | |
| # it via email and so the imap server has to be polled, the email has to be found, and then the attachment | |
| # can be downloaded | |
| # | |
| # Todo: Finish class | |
| # Todo: Commandline arguments |
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
| @echo off | |
| :: upgrade pip, setuptools, pip packages, and all choco packages | |
| :: upgrade pip | |
| pip install -U pip | |
| :: upgrade setuptools | |
| pip install setuptools --no-use-wheel --upgrade | |
| :: upgrade all pip packages |
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
| :: 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 |
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
| #!/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 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 | |
| # 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 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 | |
| # 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 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
| #!/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 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
| # 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 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
| # 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 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
| #!/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) |