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 sh | |
export NORMAL=$(tput sgr0) | |
export GREEN=$(tput setaf 2) | |
export YELLOW=$(tput setaf 3) | |
# rename a git branch | |
rename() { | |
old_name=$(git branch --show-current) # Git 2.22 and above: | |
#old_name=$(git rev-parse --abbrev-ref HEAD) # Git 2.22 lower |
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 | |
// Working example: https://goplay.space/#Sa7qCLm6w65 | |
import ( | |
"bytes" | |
"crypto/aes" | |
"crypto/cipher" | |
"encoding/hex" | |
"fmt" |
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/sh | |
set -e | |
## usage | |
# docker-init up -> start the containers | |
# docker-init -> stops the containers | |
# https://24ankitw.medium.com/managing-docker-containers-3d0bcc54405 | |
command_exists() { |
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: '3' | |
services: | |
redis: | |
image: redis:5.0.7-alpine | |
container_name: 'redis' | |
ports: | |
- 6379:6379 | |
volumes: | |
- data:/data | |
networks: |
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
//Exercise: Maps | |
//Implement WordCount. | |
//It should return a map of the counts of each “word” in the string s. | |
//The wc.Test function runs a test suite against the provided function and prints success or failure. | |
package main | |
import ( | |
"strings" |
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
- name: AWS-Docker-Ansible Setup | |
hosts: localhost | |
connection: local | |
gather_facts: False | |
vars_files: | |
- vars/variables.yml | |
tasks: | |
- name: Create security group | |
ec2_group: |
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
[ec2] | |
*instance ip address* ansible_user=ubuntu ansible_python_interpreter=/usr/bin/python3 |