Skip to content

Instantly share code, notes, and snippets.

View houstondapaz's full-sized avatar

Houston da Paz houstondapaz

View GitHub Profile
@houstondapaz
houstondapaz / gist:abf5d52a8dab62df8797e38940dd9273
Created March 6, 2023 21:02
Update mongodb nested object arrays
// schema
// {
// "EnvironmentSettings": [
// {
// "ProductName": "Product",
// "Settings": [
// {
// "Key": "key1",
// "Value": "value1"
// }
@houstondapaz
houstondapaz / curltime.sh
Created June 7, 2022 17:38
execute curl and show times
#!/bin/bash
curl -w @- -o /dev/null -s "$@" <<'EOF'
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
----------\n
@houstondapaz
houstondapaz / org_branchs.sh
Created November 26, 2021 20:41
get all org repos and main branch
#!/bin/bash
GITHUB_USERNAME=
GIT_TOKEN=
GITHUB_ORG_NAME=
declare repositories=(`
for ((i=0; ; i++)); do
current_repositories=$(curl -u ${GITHUB_USERNAME}:${GIT_TOKEN} https://api.github.com/orgs/${GITHUB_ORG_NAME}/repos\?page\=$i\&per_page\=100\&type\=private | jq -c 'map( { "name": .name , "main_branch": .default_branch } )')
length=$(jq length <<< $current_repositories)
@houstondapaz
houstondapaz / reset_branch.sh
Created October 13, 2021 17:47
Recreate branch at all owner repos
#!/usr/bin/env bash
RESET_BRANCH=development
GITHUB_USER_NAME=houstondapaz
GITHUB_OWNER=houstondapaz
GITHUB_TOKEN=
declare repositories=(`
for ((i=0; ; i++)); do
current_repositories=$(curl -u $GITHUB_USER_NAME:$GITHUB_TOKEN https://api.github.com/orgs/$GITHUB_OWNER/repos\?page\=$i\&per_page\=100\&type\=private | jq -c 'map( { "name": .name , "main_branch": .default_branch } )')

In Helm 2, changing the release status to deployed lets you bypass the issue:

kubectl -n kube-system patch configmap [release name].[release version] --type=merge -p '{"metadata":{"labels":{"STATUS":"DEPLOYED"}}}'

Where:

  • release name is the name of the release you want to update.
  • release version is the current version of your release.

Note: Keep in mind that the solution above only serves to bypass the issue. You still need to make manual adjustments to add the missing resources.

@houstondapaz
houstondapaz / ingres.yaml
Created June 19, 2020 13:55
ingress nginx configuration snippet
nginx.ingress.kubernetes.io/configuration-snippet: |
more_set_headers "Server:SEU_SERVER";
more_set_headers "cache-Control: no-cache, no-store";
more_set_headers "pragma: no-cache";
if ($request_uri ~* \.(?:ico|css|js|gif|jpe?g|png|svg|woff2|woff|ttf|eo|mp3)$) {
more_set_headers "cache-control: public, must-revalidate, proxy-revalidate";
more_set_headers "pragma: public";
expires max;
}
rewrite ^/SUB_PATH(/?)(.*)$ /$2 break;
@houstondapaz
houstondapaz / .bash_aliases
Last active February 8, 2021 16:26
my bash files
alias g="git"
alias gs="git status"
alias gp="git pull"
alias gch="git checkout"
alias gpu="git push"
alias gpu-nv="git push --no-verify"
alias gc="git commit"
alias ga="git add"
alias gm="git merge"
alias gcleartags="git tag -l | xargs git tag -d && git fetch -p && git pull origin master"
@houstondapaz
houstondapaz / install.bash
Created June 17, 2020 17:23
install just redis-cli
cd /tmp
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
cp src/redis-cli /usr/local/bin/
chmod 755 /usr/local/bin/redis-cli
@houstondapaz
houstondapaz / usefull_comands
Last active March 15, 2022 19:56
usefull comands
- REDIS
-- Del keys by pattern
EVAL "return redis.call('del', unpack(redis.call('keys', ARGV[1])))" 0 KEY_PATTERN*
or
EVAL "for _,k in ipairs(redis.call('keys','KEY_PATTERN*')) do redis.call('del',k) end" 0
- AWK
-- Get all node process id