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
Function Get-LastPassword($username) { | |
$a = Get-Module activedirectory | |
if($a) { | |
Import-Module activedirectory -force | |
} | |
$props = "PasswordExpired", "PasswordLastSet", "LockedOut", "lockoutTime", "LastLogonDate" | |
$u = get-aduser -Filter {samaccountname -eq $username} -properties $props | |
write-host "`nPassword Expired: " $u.PasswordExpired | |
write-host "Account Locked: " $u.LockedOut | |
if($u.LockedOut) { |
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
import java.util.*; | |
public class CryptRot13 { | |
public static void main(String args[]) { | |
Scanner scan = new Scanner(System.in); | |
String value = ""; | |
String rotValue = ""; | |
CryptRot13 crypt = new CryptRot13(); | |
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
Function Make-Config($obj) { | |
$gm = $obj|Get-Member -MemberType Property | |
$config = "<?xml version='1.0'?> | |
<config> | |
<include> | |
</include> | |
<exclude> | |
" | |
foreach($prop in $gm) { | |
$config += "`t`t<add property='" + $prop.name + "' />`n" |
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
$cred = Get-Credential #Read credentials | |
$username = $cred.username | |
$password = $cred.GetNetworkCredential().password | |
$server = "" + ":389" | |
# Get current domain using logged-on user's credentials | |
$CurrentDomain = "LDAP://$server" + ([ADSI]"").distinguishedName | |
$domain = New-Object System.DirectoryServices.DirectoryEntry($CurrentDomain,$UserName,$Password) | |
if ($domain.name -eq $null) | |
{ |
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
Function ResetPassword() { | |
$a = Get-Module activedirectory | |
if($a) { | |
Import-Module activedirectory -force | |
} | |
$server = "" | |
$ProgressPreference = "SilentlyContinue" | |
import-module activedirectory | |
$ProgressPreference = "Continue" | |
$username = Read-Host "What is your username: " |
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 className: | |
def __init__(self): | |
pass | |
def method1(self): | |
pass | |
def method2(self): | |
pass | |
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
strComputer = "." | |
Set objWMIService = GetObject("winmgmts:" _ | |
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") | |
Set colNicConfigs = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True") | |
For Each obj in colNicConfigs | |
obj.SetDNSServerSearchOrder(null) | |
if not obj.DHCPEnabled Then | |
obj.EnableDHCP |
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 | |
####### | |
# Change for actual use | |
####### | |
USER="example" | |
FINAL_LOCATION = "/tmp" | |
PREFIX = "junk/" | |
####### |
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
import py_compile, sys | |
py_compile.compile(sys.argv[1]) |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
int main() | |
{ | |
setuid( 0 ); | |
system( "/path/to/script.sh" ); |
OlderNewer