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
#update list of repositories | |
sudo apt-get update | |
#install jre and jdk | |
sudo apt-get install openjdk-8-jre | |
sudo apt-get install openjdk-8-jdk | |
#set export variables for java | |
export JAVA_HOME='/usr/lib/jvm/jre-1.8.0-openjdk' | |
export JRE_HOME='/usr/lib/jvm/java-8-openjdk-amd64/jre' |
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
#update list of repositories | |
sudo yum update | |
sudo reboot | |
#install jdk | |
sudo yum install java-1.8.0-openjdk.x86_64 | |
#set export variables for java | |
export JAVA_HOME='/usr/lib/jvm/jre-1.8.0-openjdk' | |
export JRE_HOME='/usr/lib/jvm/java-8-openjdk-amd64/jre' |
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
#function starts here | |
function New-RandomPassword() | |
{ | |
#specifies the default maximum no of characters to be generated for password | |
#can be override by passing parameter values while calling function | |
param( | |
[int]$maxChars=8 | |
) |
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 the public repository GPG keys | |
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - | |
# Register the Microsoft Ubuntu repository | |
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list | |
# Update apt-get | |
sudo apt-get update | |
# Install PowerShell |
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
# Enter superuser mode | |
sudo su | |
# Register the Microsoft RedHat repository | |
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/microsoft.repo | |
# Exit superuser mode | |
exit | |
# Install PowerShell |
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 command configure firewall to accept incoming tcp connections on port 80 | |
firewall-cmd --zone=public --permanent --add-port=80/tcp | |
firewall-cmd --reload |
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 gist is related to blog post https://mohitgoyal.co/2017/02/08/securing-your-jenkins-environment-and-configure-for-auditing/ | |
# Generate certificate csr | |
openssl req -new > new.ssl.csr | |
# Create a key file for generating certificate | |
openssl rsa -in privkey.pem -out new.cert.key | |
# Create a csr file using the key file for 635 days | |
openssl x509 -in new.ssl.csr -out new.cert.cert -req -signkey new.cert.key -days 365 |
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 script is used in a blog post on the https://mohitgoyal.co/2017/04/16/read-multi-line-input-from-users-in-powershell/. Please | |
# read the blog post for more information | |
function Read-MultiLineInputBoxDialog([string]$Message, [string]$WindowTitle, [string]$DefaultText) | |
{ | |
Add-Type -AssemblyName System.Drawing | |
Add-Type -AssemblyName System.Windows.Forms | |
# Create the Label. | |
$label = New-Object System.Windows.Forms.Label |
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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"firstArray": { | |
"type": "array", | |
"defaultValue": [ | |
"1-1", | |
"1-2", | |
"1-3" |
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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.1.0", | |
"parameters": { | |
"firstArray": { | |
"type": "array", | |
"defaultValue": "1-1 1-2 1-3" | |
}, | |
"secondArray": { | |
"type": "array", |