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/python3 | |
#################################################################################### | |
# Name: get_host_net_info.py # | |
# Author: Theodoros Messinis # | |
# Date Created: 20180622 # | |
# Purpose: Obtain IP address from hosts passed by stdin, calculate network of # | |
# each IP for eacho host, and find lowest IP for each network. # | |
#################################################################################### |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDj16c2GaJEplApxhX7QAkU4GeivvxeWXKd4TMXgt/eHDkX/DMMdoLsDHNtpAPdyT5gBr1+HLeCdMreb/fBqFSiQ/8vtvKrBmBhAd4HDVSnQY0Z5sXwaabnM9no9eCnYlYrj+uIQvVdgxYj1G2MHMc+J0ZTltxpb2BEh/y0g82W8rcAj5f52SbuPQi8Zv9VLjgEDitUfiPwrS0FiTsiCgJVRAWpkF63DOtAEhJDNNjhxgEjdf497oYWkJEkLIrK+R65SYOdEsOEwzhSD2l3AzWDsT9AgoR7In8dyWTJHugLNeF8rQU53vH8ZAAacjVV4MsPX17shnQuysb7FnueLACr [email protected] |
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
from getpass import getuser | |
from sys import argv | |
from subprocess import call | |
username = getuser() | |
hosts = [] | |
def multi_ssh_connection(hostnames): | |
cmd = "tmux new-session 'ssh {0}@{1}' \; ".format(username, hostnames[0]) |
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
""" | |
You have N pairs of intervals, say integers. | |
You're required to indentify all intervals that overlap with each other. | |
For example, if you have | |
{1, 3} {12, 14} {2, 4} {13, 15} {5, 10} | |
The answer is {1, 3}, {12, 14}, {2, 4}, {13, 15}. | |
Note that you don't need to group them, so the result can be in any order like in the example. |
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
def compact_spaces(a_string): | |
space_check = [] | |
return_string = '' | |
for char in a_string: | |
if char == ' ' and char not in space_check: | |
space_check.append(char) | |
return_string += char | |
elif char == ' ': | |
continue |
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
import random | |
test_list = [random.randint(0,100) for num in range(random.randint(10,50))] | |
#test_list = [1,1,1] | |
def quick_sort_v2(a_list): | |
if len(a_list) == 2: | |
if a_list[0] > a_list[1]: | |
return [a_list[1], a_list[0]] | |
else: | |
return a_list |
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
# ******************************************************************************** | |
# | |
# Script Name: DangItBobby.ps1 | |
# Version: 1.0.0 | |
# Author: bluesoul <https://bluesoul.me> | |
# Date: 2016-04-06 | |
# Applies to: Domain Environments | |
# | |
# Description: This script searches for a specific, logged on user on all or | |
# specific Computers by checking the process "explorer.exe" and its owner. It |
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
# This is an attempt at creating a caesar cipher using the ord() | |
# function and taking input from the user. | |
import re | |
def caesar_cipher(mode, input_str, key): | |
return_str = '' | |
char_as_num = None | |
num_as_char = None | |
char_after_cipher = None |