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
| ### Reboot is required before changes will take effect | |
| # Disable Hyper-V | |
| ## Required to use VirutalBox | |
| bcdedit /set hypervisorlaunchtype off | |
| # Enable Hyper-V | |
| ## Required to use Docker for Windows | |
| bcdedit /set hypervisorlaunchtype auto |
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
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
| ### Source: https://www.morgantechspace.com/2015/06/powershell-find-machine-name-from-ip-address.html | |
| ## Get Computer Name from IP | |
| # Set the known IP Address (variable not required) | |
| # NOTE: MUST be enclosed in quotes | |
| $ipAddress= "192.168.1.54" | |
| [System.Net.Dns]::GetHostByAddress($ipAddress).Hostname | |
| ## Get IP from Computer Name | |
| # Set the known computer name (variable not required) | |
| # NOTE: MUST be enclosed in quotes |
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
| -- Get Column Name from a table | |
| SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = @table; | |
| -- Get total number of Columns | |
| SELECT COUNT(*) FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = @table; | |
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
| EXEC sys.sp_linkedservers | |
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
| openssl x509 -in CERT_NAME -text -noout |
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 * FROM @table | |
| WHERE | |
| @column IN ( | |
| SELECT @column FROM @table | |
| GROUP BY @column HAVING COUNT(*) > 1) | |
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
| LEFT(@column, IIF(CHARINDEX('@needle', @column) > 0, CHARINDEX(@needle, @column) - 1, LEN(@column))) | |
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 | |
| ROW_NUMBER() OVER (ORDER BY @id) AS num | |
| [, columns] | |
| FROM @table | |
| WHERE | |
| @id BETWEEN @start AND @end | |
| ORDER BY @id | |
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
| <?php | |
| // Multi-dimensional Array to search through | |
| $a = [ | |
| [ | |
| 'item' => 1, | |
| 'code' => 100 | |
| ], | |
| [ | |
| 'item' => 2, | |
| 'code' => 200 |