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
| NEW_USER= | |
| sudo useradd $NEW_USER | |
| sudo mkdir /home/$NEW_USER/.ssh | |
| sudo chown $NEW_USER:$NEW_USER /home/$NEW_USER/.ssh | |
| sudo chmod 700 /home/$NEW_USER/.ssh | |
| sudo touch /home/$NEW_USER/.ssh/authorized_keys | |
| sudo chown $NEW_USER:$NEW_USER /home/$NEW_USER/.ssh/authorized_keys | |
| sudo chmod 600 /home/$NEW_USER/.ssh/authorized_keys |
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
| # first enable telnet, and connect | |
| # then you will get a '>' prompt where you want to run the following commands | |
| sh | |
| pidstat -l -C pppd | |
| # see -u (username) and -p (password) in the output |
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-ChildItem -Recurse CERT:\LocalMachine\MY |
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
| Set-StrictMode -Version Latest | |
| trap | |
| { | |
| Write-Error $_.Exception | |
| Write-Error $_.Exception.GetBaseException() | |
| } | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") |
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
| & sqlcmd -S 'tcp:hostname,1433' -Q 'SELECT 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
| Install git | |
| https://git-for-windows.github.io/ | |
| Add the following to the system PATH variable (requires jenkins service restart): | |
| C:\Program Files\Git\bin | |
| Set proxy for git globally: | |
| git config --system http.proxy http://proxy.com:8080 | |
| git config --system https.proxy http://proxy.com:8080 |
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
| import-module activedirectory | |
| Get-ADPrincipalGroupMembership [user] | Select name |
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
| import-module activedirectory | |
| Get-ADGroupMember [group] | Select name |
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
| public class Fibinocci | |
| { | |
| public readonly int N; | |
| public Fibinocci(int n) | |
| { | |
| if (n < 0) | |
| { | |
| throw new Exception("n must be >= 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
| Get-WmiObject win32_operatingsystem | select csname, @{LABEL=’LastBootUpTime’;EXPRESSION={$_.ConverttoDateTime($_.lastbootuptime)}} |