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 | |
import sys | |
from os import path | |
import logging | |
# needed to remove warnings from scapy, even on import | |
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) | |
from scapy.all import * |
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
from math import ceil, floor | |
# inputs | |
quantity = (int(raw_input("Minions left: "))) | |
roll = (int(raw_input("Roll: "))) | |
target = (int(raw_input("Target AC: "))) | |
# minion attack details | |
bonus = 15 | |
damage = 10 |
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
$user = Get-WMIObject Win32_UserAccount -Filter "Name='$oldName'" | |
$result = $user.Rename($newName) | |
if ($result.ReturnValue -eq 0) { | |
return $user | |
# you may just print a message here | |
} |
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
SELECT TOP 10 * | |
FROM Table | |
ORDER BY NEWID() |
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
$comps = @("comp2", "comp1") | |
$comps | Foreach { | |
if(Test-Connection $_ -q -count 1){ | |
$user = Get-WMIObject Win32_UserAccount -computername $_ -Filter "Name='@oldname'" | |
$result = $user.Rename('@newname') | |
if ($result.ReturnValue -eq 0) { | |
return Get-WMIObject Win32_UserAccount -computername $_ -Filter "Name='@newname'" | |
} | |
} |
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
foo = "john@example.com" | |
foo.split('@')[0] |
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
class Foo(object): | |
def __init__(self): | |
self.__baz = 42 | |
def foo(self): | |
print self.__baz | |
class Bar(Foo): | |
def __init__(self): | |
super(Bar, self).__init__() | |
self.__baz = 21 |
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
#Exchange 2010 | |
Set-CASMailbox -Identity <user> -OwaEnabled $false | |
Set-CASMailbox -Identity <user> -EwsEnabled $false | |
Set-CASMailbox -Identity <user> -EcpEnabled $false | |
Set-CASMailbox -Identity <user> -MapiEnabled $false | |
Set-CASMailbox -Identity <user> -MapiBlockOutlookRpcHttp $true | |
Set-CASMailbox -Identity <user> -EwsAllowOutlook $false |
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
# From "A simple unix/linux daemon in Python" by Sander Marechal | |
# See http://stackoverflow.com/a/473702/1422096 | |
# | |
# Modified to add quit() that allows to run some code before closing the daemon | |
# See http://stackoverflow.com/a/40423758/1422096 | |
# | |
# Joseph Ernest, 2016/11/12 | |
import sys, os, time, atexit | |
from signal import signal, SIGTERM |
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
# Packet Grenade | |
# Feb 13, 2015 | |
# Lists of targets | |
set pinglist [list www.google.com www.facebook.com] | |
set httplist [list www.google.com www.facebook.com] | |
set httpslist [list www.google.com www.facebook.com] | |
set ftplist [list] | |
set sshlist [list alt.org thebes.openshells.net] |
OlderNewer