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
//DNS Query Program on Linux | |
//Author : Silver Moon (m00n.silv3r@gmail.com) | |
//Dated : 29/4/2009 | |
//Header Files | |
#include<stdio.h> //printf | |
#include<string.h> //strlen | |
#include<stdlib.h> //malloc | |
#include<sys/socket.h> //you know what this is for | |
#include<arpa/inet.h> //inet_addr , inet_ntoa , ntohs etc |
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
# Check for pending reboots before attempting to update | |
reboot { 'pre_patch_reboot': | |
schedule => 'patch_window', | |
when => 'pending', | |
message => 'Reboot pending. Rebooting before attempting updates...', | |
} | |
Reboot['pre_patch_reboot'] -> Reboot['post_patch_reboot'] | |
# Apply allowed/needed updates | |
$updates.each | $kb | { |
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> | |
int main(int argc, char* argv[]) | |
{ | |
FILE *fpt; | |
char byte; | |
long int where,move; | |
if(argc != 2) | |
{ |
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
$PendingReboot = Invoke-Command -ComputerName $Target -ScriptBlock ` | |
{ | |
#Checks if the registry key RebootRequired is present. It is created when Windows Updates are applied and require a reboot to take place | |
$PatchReboot = Get-ChildItem -Path REGISTRY::"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" -ErrorAction SilentlyContinue | |
#Checks if the RebootPending key is present. It is created when changes are made to the component store that require a reboot to take place | |
$ComponentBasedReboot = Get-ChildItem -Path REGISTRY::"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending" -ErrorAction SilentlyContinue | |
#Checks if File rename operations are taking place and require a reboot for the operation to take effect | |
$PendingFileRenameOperations = (Get-ItemProperty -Path REGISTRY::"HKEY_LOCA |
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
$InstalledDrivers = $(pnputil.exe /enum-drivers) | |
$DriversToDelete = @( "netwtw04.inf"; "netwtw06.inf"; "netwtw08.inf" ) | |
$OemInfs = New-Object -TypeName System.Collections.ArrayList -ArgumentList $DriversToDelete.Count | |
for($i = 0; $i -lt $InstalledDrivers.Length ; $i++ ) | |
{ | |
foreach($Driver in $DriversToDelete) | |
{ | |
if($InstalledDrivers[$i] -like "*$Driver") |
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
"{0:N2} MB" -f ((Get-ChildItem -Path '.\SQL Developer\Files' -Recurse | Measure-Object -Property Length -Sum -ErrorAction Stop).Sum / 1MB) |
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
#Get Currently logged in user | |
$ExplorerProcess = gwmi win32_process | where name -Match explorer | |
if($ExplorerProcess.getowner().user.count -gt 1){ | |
$LoggedOnUser = $ExplorerProcess.getowner().user[0] | |
} | |
else{ | |
$LoggedOnUser = $ExplorerProcess.getowner().user | |
} |
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
Add-Type -Namespace Import -Name Win32 -MemberDefinition @' | |
[DllImport("advapi32.dll", SetLastError = true)] | |
public static extern bool LogonUser(string user, string domain, string password, int logonType, int logonProvider, out IntPtr token); | |
[DllImport("kernel32.dll", SetLastError = true)] | |
public static extern bool CloseHandle(IntPtr handle); | |
'@ | |
$Global:ImpersonatedUser = @{} | |
$tokenHandle = 0 |