Skip to content

Instantly share code, notes, and snippets.

View juicemia's full-sized avatar

Hugo juicemia

  • Miami
View GitHub Profile
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"time"
@juicemia
juicemia / sample.cs
Created December 9, 2022 18:38
CA certificate verification
var caCert = X509Certificate2.CreateFromPem(options.CaCertificate!);
clientSettings.CreateHttpMessageHandler = () =>
{
var httpSettings = new SocketsHttpHandler()
{
// This is taken from the default implementation.
KeepAlivePingDelay = clientSettings.ConnectivitySettings.KeepAliveInterval,
KeepAlivePingTimeout = clientSettings.ConnectivitySettings.KeepAliveTimeout,
};
@juicemia
juicemia / gist:1ae93e9396e1c7418e071e3be9b473a9
Created July 6, 2022 20:33
ZSH "robbyrussell" theme with Kubernetes context
kubecontext=$(kubectl config current-context)
PROMPT="${kubecontext}
%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT+=' %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@juicemia
juicemia / crash.log
Created January 25, 2022 15:30
Panic output for kubernetes manifest
panic: lists must only contain one type of element, saw tftypes.Object["applyTo":tftypes.String, "match":tftypes.Object["cluster":tftypes.Object["name":tftypes.String, "portNumber":tftypes.Number, "service":tftypes.String, "subset":tftypes.String], "context":tftypes.String, "listener":tftypes.Object["filterChain":tftypes.Object["applicationProtocols":tftypes.String, "destinationPort":tftypes.Number, "filter":tftypes.Object["name":tftypes.String, "subFilter":tftypes.Object["name":tftypes.String]], "name":tftypes.String, "sni":tftypes.String, "transportProtocol":tftypes.String], "name":tftypes.String, "portName":tftypes.String, "portNumber":tftypes.Number], "proxy":tftypes.Object["metadata":tftypes.Map[tftypes.String], "proxyVersion":tftypes.String], "routeConfiguration":tftypes.Object["gateway":tftypes.String, "name":tftypes.String, "portName":tftypes.String, "portNumber":tftypes.Number, "vhost":tftypes.Object["name":tftypes.String, "route":tftypes.Object["action":tftypes.String, "name":tftypes.String]]]], "pa
@juicemia
juicemia / debug.log
Created January 25, 2022 15:29
TF_LOG=debug output for broken kubernetes manifest
2022-01-25T10:28:55.010-0500 [INFO] Terraform version: 1.1.2
2022-01-25T10:28:55.010-0500 [INFO] Go runtime version: go1.17.2
2022-01-25T10:28:55.010-0500 [INFO] CLI args: []string{"terraform", "apply"}
2022-01-25T10:28:55.010-0500 [DEBUG] Attempting to open CLI config file: /Users/hugo.torres/.terraformrc
2022-01-25T10:28:55.010-0500 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2022-01-25T10:28:55.010-0500 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2022-01-25T10:28:55.010-0500 [DEBUG] ignoring non-existing provider search directory /Users/hugo.torres/.terraform.d/plugins
2022-01-25T10:28:55.010-0500 [DEBUG] ignoring non-existing provider search directory /Users/hugo.torres/Library/Application Support/io.terraform/plugins
2022-01-25T10:28:55.010-0500 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2022-01-25T10:28:55.010-0500 [INFO] CLI command args: []string{"apply"}
@juicemia
juicemia / filter.tf
Created January 25, 2022 15:27
Manifest that causes kubernetes provider to break
resource "kubernetes_manifest" "ratelimit_http_filter" {
manifest = {
"apiVersion" = "networking.istio.io/v1alpha3"
"kind" = "EnvoyFilter"
"metadata" = {
"name" = "ratelimit-http"
"namespace" = "namespace"
}
"spec" = {
"configPatches" = [
{
"name": "0.0.0.0_8443",
"error_state": {
"failed_configuration": {
"@type": "type.googleapis.com/envoy.config.listener.v3.Listener",
"name": "0.0.0.0_8443",
"address": {
"socket_address": {
"address": "0.0.0.0",
"port_value": 8443
@juicemia
juicemia / manifests.yml
Created January 7, 2022 16:11
Istio Ratelimit Manifests
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: envoy-limitsvc-redis
component: redis
name: envoy-limitsvc-redis-dep
namespace: istio-system
spec:
replicas: 1
[35m[Appium] Welcome to Appium v1.22.0
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> HEAD /wd/hub/sessions
[HTTP] {}
[debug] [GENERIC] Calling AppiumDriver.getSessions() with args: []
[debug] [GENERIC] Responding to client with driver.getSessions() result: []
[HTTP] <-- HEAD /wd/hub/sessions 200 8 ms - 40
[HTTP] 
[HTTP] --> POST /wd/hub/session
[HTTP] {"capabilities":{"alwaysMatch":{"appium:platformName":"iOS","appium:platformVersion":"15.0","appium:connectHardwareKeyboard":true,"appium:wdaLaunchTimeout":300000,"appium:app":"/Users/runner/work/bukkit-fe/bukkit-fe/bukkit.app","appium:udid":"20927A86-768F-4857-B126-82001235F499","appium:deviceName":"TestIPhone13","appium:showIOSLog":true,"appium:showXcodeLog":true},"firstMatch":[{}]},"desiredCapabilities":{"appium:platfor
@juicemia
juicemia / workflow.yml
Created November 6, 2021 17:39
Workflow for failed end-to-end tests
name: E2E CI
on: [workflow_dispatch]
jobs:
test:
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: Set up Node 16
uses: actions/setup-node@v2
with: