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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"log" | |
"net/http" | |
"net/http/httputil" | |
"regexp" | |
) |
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
double deg2rad(def deg) { | |
return deg * (Math.PI/180) | |
} | |
double getDistanceFromLatLonInKm(def lat1,def lon1,def lat2,def lon2) { | |
def R = 6371; // Radius of the earth in km | |
def dLat = deg2rad(lat2-lat1); // deg2rad below | |
def dLon = deg2rad(lon2-lon1); | |
def a = | |
Math.sin(dLat/2) * Math.sin(dLat/2) + |
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
{ | |
"index_patterns": [ | |
"winlogbeat-7.10.1-*" | |
], | |
"mappings": { | |
"_meta": { | |
"beat": "winlogbeat", | |
"version": "7.10.1" | |
}, | |
"date_detection": false, |
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
#!/bin/bash | |
INSTANCE_PREFIX="asjad" | |
read -r -p "Stop all instances with prefix $INSTANCE_PREFIX? [y/N] " response | |
response=`echo "print('$response'.lower())" | python` | |
if [[ "$response" =~ ^(yes|y)$ ]] | |
then | |
for i in `gcloud compute instances list --filter $INSTANCE_PREFIX | awk '{print $1}' | sed 1,1d`; do gcloud compute instances stop "$i"; done |
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
docker stop $(docker ps -a -q) | |
docker rm $(docker ps -a -q) |
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
#!/bin/bash | |
#removes secrets manifest file if already available | |
rm secrets.yaml | |
echo " | |
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: metricbeat-secrets |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "VisualEditor0", | |
"Effect": "Allow", | |
"Action": [ | |
"ec2:DescribeRegions", | |
"cloudwatch:GetMetricData", |
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
{ | |
"Right Option Key Sends" : 0, | |
"Tags" : [ | |
], | |
"Ansi 12 Color" : { | |
"Red Component" : 0.44313725829124451, | |
"Color Space" : "sRGB", | |
"Blue Component" : 0.94901961088180542, | |
"Alpha Component" : 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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
const ( | |
TOLERANCE=0.00001 | |
) |