Skip to content

Instantly share code, notes, and snippets.

@moisesnarvaez
moisesnarvaez / deploy_failure.sh
Created June 22, 2023 15:37
Logs Deploy to Staging
Running with gitlab-runner 16.1.0~beta.59.g83c66823 (83c66823)
on blue-2.shared.runners-manager.gitlab.com/default XxUrkriX, system ID: s_90897a2659b5
feature flags: FF_USE_IMPROVED_URL_MASKING:true
Resolving secrets
00:00
Preparing the "docker+machine" executor
Using Docker executor with image amazon/aws-cli ...
Starting service postgres:9.6.15-alpine ...
Pulling docker image postgres:9.6.15-alpine ...
Using docker image sha256:081f7129326442032531804733cb9d86ff2621a50d77d2241437f7dfb0d972ce for postgres:9.6.15-alpine with digest postgres@sha256:a8d36bd2f4af670c856f33790964ffd74066a8436391c6056f6d0deb7bd71cdb ...
openssl req -x509 -out localhost.crt -keyout localhost.key -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' -extensions EXT -config <(printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
mkdir ~/certs/
mv localhost.crt ~/certs/
mv localhost.key ~/certs/

bin/rails s -b "ssl://127.0.0.1:3000?key=$HOME/certs/localhost.key&cert=$HOME/certs/localhost.crt"

Kubernetes

CRUD Deployments

kubectl create deployment [name] --image=[Image from Docker] = Creates a deployment, with the default Blueprint

kubectl edit deployment [name] = Edits the deployment blueprint

kubectl get all = Lists all the components in the Cluster

@moisesnarvaez
moisesnarvaez / cloudSettings
Last active October 1, 2021 21:36
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-04-01T02:28:13.368Z","extensionVersion":"v3.4.3"}
@moisesnarvaez
moisesnarvaez / tables_size.sql
Created April 25, 2019 15:31
PostgreSQL tables size
SELECT
schema_name,
relname,
pg_size_pretty(table_size) AS size,
table_size
FROM (
SELECT
pg_catalog.pg_namespace.nspname AS schema_name,
relname,
@moisesnarvaez
moisesnarvaez / config_files
Created June 25, 2018 19:41
Sublime Configuration
Key Bindings
================
{ "keys": ["super+shift+r"], "command": "reveal_in_side_bar" }
User Preferences
================
{
"ignored_packages":
Pre-requisites:
- adb
- fastboot
1. Install Custom Recovery Image
- Download "TWRP Recovery", once downloaded, rename the file to "recovery.img"
- Run in Console:
adb devices
@moisesnarvaez
moisesnarvaez / email_finder.rb
Last active October 11, 2016 21:36
Finds a valid email giving a Fullname and a URL. Example: e = EmailFinder.new("Moises Narvaez", "www.koombea.com"); e.valid_email
class EmailFinder
# TODO: para TopSpeed: Buscar si hay una "@" en el author, si es así...
# Buscar si en el texto de author hay algún texto extre paréntesis "()"
# si ese texto es un email, quitarlo (con los parentesis), sino cogerlo como nombre
def initialize(full_name, url)
@full_name = I18n.transliterate(full_name.downcase)
@url = url
@words = @full_name.split(' ')
end
# Git
alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias go='git checkout '
alias gk='gitk --all&'
alias gx='gitx --all'
# More Git