##How to persist hostname in AWS http://www.scalingbits.com/aws/sap/suse/hostname
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
aws ec2 describe-instances --query 'Reservations[].Instances[].{Name:Tags[?Key==`Name`]|[0].Value,InstanceID:InstanceId,PrivateIP:PrivateIpAddress}' --output table --profile | |
# Add filter base on tagging | |
aws ec2 describe-instances --query 'Reservations[].Instances[].{Name:Tags[?Key==`Name`]|[0].Value,InstanceID:InstanceId,PrivateIP:PrivateIpAddress}' --filter "Name=tag:Environment,Values=tst" --output json --profile |
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 | |
sudo zypper ref | |
sudo zypper install salt-minion -y | |
sudo systemctl start salt-minion.service | |
sudo systemctl enable salt-minion.service |
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
$cfpath = "C:\ProgramData\Amazon\AmazonCloudWatchAgent\common-config.toml" | |
$cfbackup = "C:\ProgramData\Amazon\AmazonCloudWatchAgent\common-config.toml_backup" | |
Copy-Item -Path $cfpath -Destination $cfbackup | |
$ProxyInfoToFile = @" | |
[proxy] | |
http_proxy = "myproxy" | |
https_proxy = "myproxy" |
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
Function Show-DatabasesOnServer | |
{ | |
[CmdletBinding()] | |
param ( | |
# Server Name or array of Server Names - Defaults to $ENV:COMPUTERNAME | |
[Parameter(Mandatory = $false, | |
ValueFromPipeline = $true, | |
ValueFromPipelineByPropertyName = $true, | |
Position = 0)] | |
$Servers = $Env:COMPUTERNAME, |
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
@ECHO OFF | |
:: Initialize the variables | |
SET S3BUCKET="smajidupload" | |
SET COPYPATH="C:\Users\Administrator\Downloads" | |
aws s3 cp %COPYPATH% s3://%S3BUCKET% --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --recursive |
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
# Port forward to local from Kubernetes pod port 80 to localhost port 8080 | |
kubectl port-forward [pod name] 8080:80 . | |
# To check type of QoS for pods [ Guaranteed , Burstable , BestEffor] | |
kubectl get pod/nginx-pod -o jsonpath={.status.qosClass} | |
# To watch changes on pod | |
kubectl get pod -w | |
# The --record flag will track changes made through each revision |
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
Mapping Pin to GPIO | |
static const uint8_t D0 = 16; | |
static const uint8_t D1 = 5; | |
static const uint8_t D2 = 4; | |
static const uint8_t D3 = 0; | |
static const uint8_t D4 = 2; | |
static const uint8_t D5 = 14; | |
static const uint8_t D6 = 12; | |
static const uint8_t D7 = 13; |
NewerOlder