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 Slack(url, msg string) (err error) { | |
| buf := bytes.NewBufferString(fmt.Sprintf(`{"text":"%s"}`, msg)) | |
| if _, err := http.Post(url, "application/json", buf); err != nil { | |
| fmt.Println("Failed posting to slack:", err) | |
| } | |
| return | |
| } | 
  
    
      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 | |
| NC='\033[0m' | |
| red() { echo -e "\033[0;31m$@${NC}";} | |
| blue() { echo -e "\033[0;96m$@${NC}";} | |
| green() { echo -e "\033[1;32m$@${NC}";} | |
| yellow(){ echo -e "\033[0;33m$@${NC}";} | |
| help() { | |
| red "Usage: | 
  
    
      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: ./update-all.sh $GOPATH/src/github.com/rms1000watt | |
| B='\033[0;34m' | |
| NC='\033[0m' | |
| MAIN_DIR=$1 | |
| if [ -z $MAIN_DIR ]; then | |
| echo "No directory to walk and update" | 
  
    
      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 | |
| set -e | |
| rm -rf bin ||: | |
| mkdir bin ||: | |
| PROJECT=$(basename $(git rev-parse --show-toplevel)) | |
| VERSION=$(cat version.txt) | |
| export CGO_ENABLED=0 | 
  
    
      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 | |
| kubectl create -f https://k8s.io/examples/application/shell-demo.yaml | |
| kubectl get pod shell-demo | |
| kubectl exec -it shell-demo -- /bin/bash | 
  
    
      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
    
  
  
    
  | echo "supersede domain-name-servers 8.8.8.8, 9.9.9.9;" | sudo tee -a /etc/dhcp/dhclient.conf &> /dev/null | |
| sudo ifdown eth0 && sudo ifup eth0 | |
  
    
      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
    
  
  
    
  | # https://stackoverflow.com/a/19770395/2330648 | |
| # sed: RE error: illegal byte sequence | |
| export LC_CTYPE=C | |
| export LANG=C | |
| sed 's|`testing`|`pizza`|g' < in.txt > out.txt | 
  
    
      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 unittest | |
| class RyanTest(unittest.TestCase): | |
| def test_hello_world(self): | |
| print("hello world") | |
| def test_failure(self): | |
| self.assertEqual(1, 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
    
  
  
    
  | #!/usr/bin/env bash | |
| if [[ ! -f /bin/consul ]]; then | |
| CONSUL_VERSION=1.4.0 | |
| apt update -y | |
| apt install -y curl unzip | |
| curl -L -o consul_${CONSUL_VERSION}_linux_amd64.zip https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip | |
| unzip -d /bin consul_${CONSUL_VERSION}_linux_amd64.zip | 
  
    
      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
    
  
  
    
  | - hosts: 127.0.0.1 | |
| tasks: | |
| - shell: cat hello.txt | |
| register: hello_world | |
| changed_when: false | |
| - debug: | |
| var: hello_world.stdout | |
| - debug: |