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
using System; | |
using System.Management.Automation; | |
namespace SamplePsModule | |
{ | |
[Cmdlet(VerbsCommon.Get, "Vignesh")] | |
public class SampleGet : Cmdlet //Must inherit Cmdlet | |
{ | |
//Parameters | |
[Parameter(Mandatory = true)] |
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.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
/** | |
* Created by Vignesh on 26-05-2015. | |
*/ | |
public class ContainsTest { | |
public static void main(String[] args) { |
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.io.IOException; | |
import java.net.Socket; | |
import java.net.SocketException; | |
import java.net.UnknownHostException; | |
/** | |
* Created by Vignesh on 26-05-2015. | |
*/ | |
public class PortOpenTest { |
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 com.asvignesh.common.MyException; | |
import com.vmware.vim25.DatastoreHostMount; | |
import com.vmware.vim25.HostScsiDisk; | |
import com.vmware.vim25.VmfsDatastoreExpandSpec; | |
import com.vmware.vim25.VmfsDatastoreOption; | |
import com.vmware.vim25.mo.*; | |
import java.rmi.RemoteException; | |
/** |
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/bash | |
mysql -u <user> -p<Password> -e 'unlock tables;' | |
if [ $? -gt 0 ]; then | |
echo "Failed running mysql unfreeze" | |
exit 1 | |
else | |
echo "success" | |
exit 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
package viewmodel; | |
import play.mvc.QueryStringBindable; | |
import java.util.Map; | |
import java.util.Optional; | |
public class PaginationParams implements QueryStringBindable<PaginationParams> { | |
private int page; | |
private int offset; |
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
public Timestamp getCreatedDate() throws RemoteException { | |
final EventFilterSpec eventFilterSpec = new EventFilterSpec(); | |
eventFilterSpec.setEventTypeId(new String[]{"VmCreatedEvent", "VmBeingDeployedEvent", "VmRegisteredEvent", "VmClonedEvent"}); | |
EventFilterSpecByEntity entity = new EventFilterSpecByEntity(); | |
entity.setEntity(virtualMachine.getMOR()); | |
EventFilterSpecRecursionOption recOption = EventFilterSpecRecursionOption.self; | |
entity.setRecursion(recOption); | |
eventFilterSpec.setEntity(entity); |
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
$vmProp = ""|Select VMname,CreatedTime | |
if ($CollectedEvent=$vm|Get-VMEvents -types 'VmBeingDeployedEvent','VmRegisteredEvent','VmClonedEvent','VmBeingCreatedEvent' -ErrorAction SilentlyContinue) | |
{ | |
if($CollectedEvent.gettype().isArray){$CollectedEvent=$CollectedEvent|?{$_ -is [vmware.vim.VmRegisteredEvent]}} | |
$CollectedEventType=$CollectedEvent.gettype().name | |
$CollectedEventCreationDate=$CollectedEvent.CreatedTime | |
$vmProp.VMname=$CollectedEvent.vm.Name | |
$vmProp.CreatedTime=$CollectedEventCreationDate | |
} |
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-module sqlps | |
$total =2 | |
$volume1 = "E:" | |
$volume2 = "F:" | |
$backupLocation = "C:\Users\asvignesh\Downloads\AdventureWorks2016.bak" | |
$database_prefix = "vignesh-testing" | |
foreach($count in 1..$total) | |
{ |
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
$nodes = @("nim-win1-4.asvigneshad.local","nim-win2-5.asvigneshad.local","nim-win3-3.asvigneshad.local","nim-win4-1.asvigneshad.local","nim-win5-5.asvigneshad.local") | |
$username = "asvigneshad\administrator" | |
$password = "Password" | |
$secstr = New-Object -TypeName System.Security.SecureString | |
$password.ToCharArray() | ForEach-Object {$secstr.AppendChar($_)} | |
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $secstr | |
For ($i=0; $i -lt $nodes.Length; $i++) { | |
$sess = New-PSSession -Credential $cred -ComputerName $nodes[$i] | |
Enter-PSSession $sess | |
$script = "./tmp.dsh" |
OlderNewer