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
SELECT TOP 10 * | |
FROM Table | |
ORDER BY NEWID() |
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
$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 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
$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 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
foo = "[email protected]" | |
foo.split('@')[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
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 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
""" | |
Created on Sep 24, 2013 | |
@author: RandomHardcoreJerks | |
Requires pywin32 | |
original: http://code.activestate.com/recipes/474121/ | |
# HtmlClipboard |
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
#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 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
# 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] |
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 | |
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 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
# LDAP Query | |
# Look for all people. Excludes the DISABLED OU | |
$Searcher = New-Object DirectoryServices.DirectorySearcher | |
$Searcher.SearchRoot = 'LDAP://CN=Users,DC=example,DC=com' | |
$Searcher.Filter = '(&(objectCategory=person))' | |
$res = $Searcher.FindAll() | Sort-Object path | |
foreach ($usrTmp in $res) | |
{ |
OlderNewer