Skip to content

Instantly share code, notes, and snippets.

View bugcy013's full-sized avatar
🪄
Focusing

Dhanasekaran Anbalagan bugcy013

🪄
Focusing
View GitHub Profile
@bugcy013
bugcy013 / brew-without-sudo.md
Created April 18, 2022 16:37
MacOS Homebrew without sudo

Homebrew is a popular framework for quickly installing development tools on MacOS, including Gfortran. MacOS cloud services such as MacInCloud may say they provide Homebrew, but you may not be able to install packages without a sudo/admin account. To install Homebrew without sudo/admin in the user home directory for cloud or physical Mac hardware, follow these steps:

mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew

Edit ~/.profile to include

export PATH=$HOME/homebrew/bin:$PATH
@bugcy013
bugcy013 / Authentication Types.md
Created March 15, 2022 15:05
Authentication Types

Basic Authentication

1 basic

JWT - JSON Web Tokens

2 jwt

OAuth - Open Authorization

3 oauth

Auth Strategies - Session Based Authentication

4 session_based

Single Sign-On - SSO

5 sso

@bugcy013
bugcy013 / Ansible-module-sample-bash.sh
Created March 7, 2022 05:56 — forked from devops-school/Ansible-module-sample-bash.sh
Ansible Module Sample Code using Linux Bash script Example 5
#touch.bash
#!/bin/bash
# import variables from ansible
source $1
state=${state:-present}
if [[ $state == "present" ]]; then
if [ ! -e $file ]; then
touch $file
echo { \"changed\": true }

Supported built-in functions

  • abs(float) - Returns the absolute value of a given float. Example: abs(1) returns 1, and abs(-1) would also return 1, whereas abs(-3.14) would return 3.14. See also the signum function.

  • basename(path) - Returns the last element of a path.

  • base64decode(string) - Given a base64-encoded string, decodes it and returns the original string.

@bugcy013
bugcy013 / tf_functions.tf
Created March 6, 2022 15:04 — forked from carlessanagustin/functions.tf
Terraform functions by example
##--------------------------
## Terraform: Functions ##
##--------------------------
## Open terraform console
terraform console
#######################
## Numeric Functions ##
#######################
import requests
import logging
import pandas as pd
level = "INFO"
logging.basicConfig(level=level, format="%(levelname)-10s| %(asctime)-10s | %(funcName)-10s | %(message)s")
def get_request():
all_items = []
#!/bin/sh
# Launch a Pod ab-using a privileged=true to land on a Kubernetes node cluster as root,
# uses `privileged: true` to then nsenter init mount its (root) namespace,
# hostPID and hostNetwork already set for the Pod.
node=${1}
case "${node}" in
"")
nodeSelector=''
podName=${USER+${USER}-}sudo-any
;;
# This file was autogenerated by the 'packer hcl2_upgrade' command. We
# recommend double checking that everything is correct before going forward. We
# also recommend treating this file as disposable. The HCL2 blocks in this
# file can be moved to other files. For example, the variable blocks could be
# moved to their own 'variables.pkr.hcl' file, etc. Those files need to be
# suffixed with '.pkr.hcl' to be visible to Packer. To use multiple files at
# once they also need to be in the same folder. 'packer inspect folder/'
# will describe to you what is in that folder.
# Avoid mixing go templating calls ( for example ```{{ upper(`string`) }}``` )
@bugcy013
bugcy013 / tf_variable_precedence.md
Created November 7, 2021 12:22
terraform_variable_precedence

tf_variable_precedence

@bugcy013
bugcy013 / SLA Error budget.csv
Created August 10, 2021 09:54
SLA Error budget
SLA Daily Weekly Monthly Quarterly Yearly
99.9999 % 0s 0s 2s 7s 31s
99.999 % 0s 6s 26s 1m 18s 5m 15s
99.99 % 8s 1m 0s 4m 22s 13m 8s 52m 35s
99.9 % 1m 26s 10m 4s 43m 49s 2h 11m 29s 8h 45m 56s
99.8 % 2m 52s 20m 9s 1h 27m 39s 4h 22m 58s 17h 31m 53s
99.7 % 4m 19s 30m 14s 2h 11m 29s 6h 34m 27s 1d 2h 17m 50s
99.6 % 5m 45s 40m 19s 2h 55m 18s 8h 45m 56s 1d 11h 3m 47s
99.5 % 7m 12s 50m 24s 3h 39m 8s 10h 57m 26s 1d 19h 49m 44s
99.4 % 8m 38s 1h 0m 28s 4h 22m 58s 13h 8m 55s 2d 4h 35m 41s