Skip to content

Instantly share code, notes, and snippets.

View archmangler's full-sized avatar
🌴
On vacation

Traiano Welcome archmangler

🌴
On vacation
View GitHub Profile
@archmangler
archmangler / gist:0aad76e3b019eb16e7607cac001e66c8
Last active May 9, 2023 06:29
NGINX Plus JWT Authentication Flow Example
#NGINX+ Configuration:
```
upstream api_server {
server 10.42.0.63;
}
#access log custom formatting example
@archmangler
archmangler / gist:91898a65f5e66eac90f42e484196d55a
Created September 24, 2022 15:53
Error: resource with the ID ... "..." Please see the resource documentation for "azurerm_policy_definition" for more information.
╷
│ Error: A resource with the ID "/providers/Microsoft.Authorization/roleDefinitions/32363e0b-9cc6-5e3d-a263-4d021d5a8d8a|/providers/Microsoft.Management/managementGroups/engeneon" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_role_definition" for more information.
│ 
│  with azurerm_role_definition.enterprise_scale["/providers/Microsoft.Authorization/roleDefinitions/32363e0b-9cc6-5e3d-a263-4d021d5a8d8a"],
│  on resources.role_definitions.tf line 1, in resource "azurerm_role_definition" "enterprise_scale":
│  1: resource "azurerm_role_definition" "enterprise_scale" {
│ 
╵
╷
@archmangler
archmangler / gist:da0de1be87b825c0c7834df3772c9b5d
Created September 24, 2022 15:47
Terraform Plan for Azure CAF (v2.3.1)
This file has been truncated, but you can view the full file.
Note: Objects have changed outside of Terraform
Terraform detected the following changes made outside of Terraform since the
last "terraform apply" which may have affected this plan:
 # module.enterprise_scale.azurerm_management_group.level_3["/providers/Microsoft.Management/managementGroups/engeneon-management"] has changed
 ~ resource "azurerm_management_group" "level_3" {
id = "/providers/Microsoft.Management/managementGroups/engeneon-management"
name = "engeneon-management"
~ subscription_ids = [
@archmangler
archmangler / gist:002776037cc4e56b215468c476953b21
Created September 9, 2022 13:59
AD Group Management Example: The "for_each" value depends on resource attributes that cannot be determined until apply

Step #1: add a new user

(base) welcome@Traianos-MacBook-Pro azure-ad-management % cat users.csv 
first_name,last_name,department,job_title
Joe,Blogs,Contracting,Engineer
Tom,Jones,Contracting,Manager
Wukong,Sun,Contracting,Manager
Wu,Tzu,Contracting,Manager
Musashi,Miyamoto,Contracting,Manager
@archmangler
archmangler / gist:f8d040e641f377d99f86fc584ffaf3db
Last active May 7, 2022 07:51
Jenkins CasC: Snippets and Resources
# References
- Examples: https://github.com/jenkinsci/configuration-as-code-plugin/tree/master/demos
```
pipelineJob("ragnarok") {
definition {
cps {
sandbox(true)
```
------------------------------------------------------------------------
This plan was saved to: lol-nprd-nsc.tfplan
To perform exactly these actions, run the following command to apply:
@archmangler
archmangler / practical-labs-june-2020.md
Last active July 26, 2020 15:44
A list of Practical Hands On Labs (June 2020)
[] AKS with Terraform 0.12 in hub and spoke architecture: https://medium.com/@paveltuzov/create-a-fully-private-aks-infrastructure-with-terraform-e92358f0bf65
[] kubernetes autoscaling on AWS EKS: https://medium.com/better-programming/build-kubernetes-autoscaling-for-cluster-nodes-and-application-pods-bb7f2d716b07
[] fluentd basics: https://medium.com/swlh/fluentd-simplified-eb5f19416e37
[] HPA on GKE: https://medium.com/better-programming/how-to-scale-kubernetes-applications-using-custom-metrics-6cf02571c5e4
[] NSPs: https://medium.com/better-programming/how-to-secure-kubernetes-using-network-policies-bbb940909364
[] Cert-Automation on Kubernetes: https://medium.com/hashicorp-engineering/securing-k8s-ingress-traffic-with-hashicorp-vault-pkiaas-and-jetstack-cert-manager-cb46195742ca
[] Kaniko container builds + FluxCD: https://medium.com/better-programming/how-to-build-containers-in-a-kubernetes-cluster-with-kaniko-2d01cd3242a7
[] Calico (VPN client connection to pod) https://medium.com/flant-com/calico-f
@archmangler
archmangler / esp32-interrupt-motion-detection.md
Last active June 13, 2020 17:16
ESP32 Motion Detection With Interrupts (4-channel input , 4 channel output)
  • Processinng code for an ESP32-based obstacle detection system with 4 channel input and 4 channel output
/*********
  Traiano Welcome
  Copied heavily from 
  Rui Santos
  Complete project details at https://randomnerdtutorials.com  
*********/
@archmangler
archmangler / basic-impact-detection.md
Created June 11, 2020 12:41
Basic Impact Detection for Motor Drive

int LEDs[] = {23,22,19,18};

#define Button1 32 #define Button2 33 #define Button3 34 #define Button4 35

#define UP 0 #define DOWN 1

@archmangler
archmangler / Terraform azurerm azure fw debug output
Created May 24, 2020 14:44
terraform azurerm azure fw debug output
- After terraform destroy, we attempt to run terraform plan again but get the following errors:
```
3 error(s) occurred:
* module.firewall_outbound_region2.azurerm_firewall_application_rule_collection.outbound[1]: 1 error(s) occurred:
* azurerm_firewall_application_rule_collection.outbound.1 Error creating/updating Application Rule Collection "rule-lolcorp-dev-mydept-02" in Firewall
"afw-lolcorp-hub-region2-out" (Resource Group: "rsg-lolcorp-hub-region2-networkfrontend"): network.AzureFirewallsClient#CreateorUpdate: Failure sending request:
StatusCode=400 -- Original Error: Code="InvalidRequestFormat" Message="Cannot parse the request." Details = [{"code","DuplicateResourceName"},"message",