## Section
Lorem ipsum dolor sit amet.
![alt text](assets/image.png)
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 kube-state-metrics on the cluster | |
kubectl port-forward service/kube-state-metrics 8080:8080 -n kube-system & | |
# Hit the metrics endpoint | |
curl localhost:8080/metrics |
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
# Check what $GOPATH and $GOBIN are currently | |
echo "GOPATH = ${GOPATH}\nGOBIN = ${GOBIN}" | |
# Set them relative to your home directory | |
export GOPATH=$HOME && export GOBIN=$GOPATH/bin | |
echo "GOPATH = ${GOPATH}\nGOBIN = ${GOBIN}" |
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 a Pod | |
kubectl port-forward elasticsearch-0 9200:9200 | |
# Port forward to a Service | |
kubectl port-forward service/elasticsearch 9200:9200 |
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
HOSTNAME=example.com && \ | |
echo | openssl s_client -showcerts \ | |
-servername $HOSTNAME \ # Required for SNI | |
-connect $HOSTNAME:443 2>/dev/null | \ | |
openssl x509 -inform pem -noout -text | \ | |
grep Validity -A 2 |
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
import os, sys, logging | |
logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO")) | |
try: | |
number = 1 / 0 | |
except ZeroDivisionError as exception: | |
exception_message = str(exception) | |
exception_type, exception_object, exception_traceback = sys.exc_info() | |
filename = os.path.split(exception_traceback.tb_frame.f_code.co_filename)[1] |
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
resource "aws_route" "transit_gateway_private_subnet_route" { | |
count = length(data.aws_route_tables.private_subnet.ids) | |
route_table_id = tolist(data.aws_route_tables.private_subnet.ids)[count.index] | |
destination_cidr_block = var.destination_cidr_block | |
transit_gateway_id = var.transit_gateway_id | |
} | |
data "aws_route_tables" "private_subnet" { | |
vpc_id = var.vpc_id | |
tags = { |
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
<?php | |
/** | |
* @AfterStep | |
*/ | |
public function takeScreenshotAfterFailedStep($event) | |
{ | |
if ($event->getTestResult()->getResultCode() === \Behat\Testwork\Tester\Result\TestResult::FAILED) { | |
$driver = $this->getSession()->getDriver(); | |
if ($driver instanceof \Behat\Mink\Driver\Selenium2Driver) { |
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
# Fetch the VPC as a Data Source | |
data "aws_vpc" "vpc" { | |
filter { | |
name = "tag:Name" | |
values = ["vpc-name"] | |
} | |
} | |
# Fetch the Subnet IDs from the VPC | |
data "aws_subnet_ids" "public" { |
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
# This will upgrade PIP 7.1 to PIP 10.x, which will break PIP | |
#sudo pip install --upgrade pip | |
# This is the last version of PIP that will work with CentOS/RHEL 6 | |
sudo pip install pip==9.0.3 | |
# Installing collected packages: pip | |
# Found existing installation: pip 7.1.0 | |
# Uninstalling pip-7.1.0: | |
# Successfully uninstalled pip-7.1.0 |