Estimated time: 10 minutes
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
| $ eksctl create cluster -v 4 --name=dev3 --nodes-min=2 --nodes-max=10 | |
| 2018-12-21T16:54:51Z [ℹ] using region us-west-2 | |
| 2018-12-21T16:54:52Z [▶] role ARN for the current session is "arn:aws:iam::797098425712:user/vojtech" | |
| 2018-12-21T16:54:52Z [▶] determining availability zones | |
| 2018-12-21T16:54:52Z [ℹ] setting availability zones to [us-west-2c us-west-2a us-west-2b] | |
| 2018-12-21T16:54:52Z [▶] VPC CIDR (192.168.0.0/16) was divided into 8 subnets [192.168.0.0/19 192.168.32.0/19 192.168.64.0/19 192.168.96.0/19 192.168.128.0/19 192.168.160.0/19 192.168.192.0/19 192.168.224.0/19] | |
| 2018-12-21T16:54:52Z [ℹ] subnets for us-west-2c - public:192.168.0.0/19 private:192.168.96.0/19 | |
| 2018-12-21T16:54:52Z [ℹ] subnets for us-west-2a - public:192.168.32.0/19 private:192.168.128.0/19 | |
| 2018-12-21T16:54:52Z [ℹ] subnets for us-west-2b - public:192.168.64.0/19 private:192.168.160.0/19 | |
| 2018-12-21T16:54:52Z [▶] resolving AMI using StaticGPUResolver for region us-west-2, instanceType m5.large and imageFamily AmazonLinux2 |
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
| {"AWSTemplateFormatVersion":"2010-09-09","Description":"EKS cluster (dedicated VPC: true, dedicated IAM: true) [created and managed by eksctl]","Resources":{"ControlPlane":{"Type":"AWS::EKS::Cluster","Properties":{"Name":"dev3","ResourcesVpcConfig":{"SecurityGroupIds":[{"Ref":"ControlPlaneSecurityGroup"}],"SubnetIds":[{"Ref":"SubnetPublicUSWEST2C"},{"Ref":"SubnetPublicUSWEST2A"},{"Ref":"SubnetPublicUSWEST2B"},{"Ref":"SubnetPrivateUSWEST2C"},{"Ref":"SubnetPrivateUSWEST2A"},{"Ref":"SubnetPrivateUSWEST2B"}]},"RoleArn":{"Fn::GetAtt":"ServiceRole.Arn"},"Version":"1.11"}},"ControlPlaneSecurityGroup":{"Type":"AWS::EC2::SecurityGroup","Properties":{"GroupDescription":"Communication between the control plane and worker node groups","Tags":[{"Key":"Name","Value":{"Fn::Sub":"${AWS::StackName}/ControlPlaneSecurityGroup"}}],"VpcId":{"Ref":"VPC"}}},"InternetGateway":{"Type":"AWS::EC2::InternetGateway","Properties":{"Tags":[{"Key":"Name","Value":{"Fn::Sub":"${AWS::StackName}/InternetGateway"}}]}},"NATGateway":{"Type":"AWS:: |
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
| func CopyFile(src, dst string) (err error) { | |
| defer fmt.HandleErrorf(&err, "copy %s %s: %v", src, dst, err) | |
| r := try(os.Open(src)) | |
| defer r.Close() | |
| w := try(os.Create(dst)) | |
| defer func() { | |
| w.Close() | |
| if err != nil { |
+ TOML v0.4.0
+ MIT license
- doesn't preserve comments
- no tree structure available for recursion
- data is burried in multi-level tree of map[string]interface{}
+ preserves order in the metadata.Keys() [][]string, not very intuitive to use the metadata properly (TODO: link to example)^ the best pkg out there, even though it's not perfect
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
| #!/usr/bin/env bash | |
| # Usage: bash uninstall_vmware.bash | |
| remove() { | |
| entry="$1" | |
| echo -ne "Removing \e[1;34m$entry\e[0m... " | |
| sudo rm -rf "$entry" &> /tmp/uninstall-vmware.log | |
| if [[ ! -e "$entry" ]]; then | |
| echo -e "\e[1;32mOK\e[0m" |
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
| #!/usr/bin/env bash | |
| # Usage: bash uninstall_vmware.bash | |
| remove() { | |
| entry="$1" | |
| echo -ne "Removing \e[1;34m$entry\e[0m... " | |
| sudo rm -rf "$entry" &> /tmp/uninstall-vmware.log | |
| if [[ ! -e "$entry" ]]; then | |
| echo -e "\e[1;32mOK\e[0m" |
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
| # Remove every file except "./somefile.txt" and the directory "./somedir". | |
| # --prune-empty to remove empty commits. | |
| git filter-branch --tree-filter "find . -not -path './.git' -not -path './.git/*' -not -path './somefile.txt' -not -path './somedir/*' -not -path './somedir' -delete" --prune-empty |
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
| curl -v -X OPTIONS -H 'Access-Control-Request-Method: GET' -H 'Access-Control-Request-Headers: Origin, Accept, Content-Type' -H 'Origin: https://origin-host.example.com' https://target-host.example.com/ping |
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 | |
| # Based on https://stackoverflow.com/questions/20762575/explanation-of-convertor-of-cidr-to-netmask-in-linux-shell-netmask2cdir-and-cdir | |
| mask2cdr () | |
| { | |
| local mask=$1 | |
| # In RFC 4632 netmasks there's no "255." after a non-255 byte in the mask | |
| local left_stripped_mask=${mask##*255.} | |
| local len_mask=${#mask} |