Skip to content

Instantly share code, notes, and snippets.

View AlejandroSilva's full-sized avatar
🐰

Alejandro Silva AlejandroSilva

🐰
View GitHub Profile
@AlejandroSilva
AlejandroSilva / private-docker-regs-with-free-tiers.markdown
Created April 4, 2025 05:35 — forked from JakubOboza/private-docker-regs-with-free-tiers.markdown
Private Docker registry with free tiers for Developers.

List of sites with free tier limits

  • Docker Hub - One private repo/image spot for free
  • Three Scale - Very generous free tier 50GB of space, 500 Pulls a month etc..
  • Canister - 20 private repos with almost no limits on free tier
  • Code Fresh - Free tier for developers

Setup your own private registry

rename local

git checkout <old_name>
git branch -m <new_name>

rename remote

# reset upstream
git push origin -u 
@AlejandroSilva
AlejandroSilva / gist:888870094c2c03ba580bcf4554515f29
Created May 27, 2021 21:25
configuration for github packages and npm
- create a token in https://github.com/settings/tokens
- add in `~/.npmrc` this line `//npm.pkg.github.com/:_authToken=TOKEN`
- login into the registry with `npm login --scope=@OWNER --registry=https://npm.pkg.github.com` (using the token as password)
- check if everithing is right with `npm whoami --registry=https://npm.pkg.github.com``
- ??
- profit!
@AlejandroSilva
AlejandroSilva / shallowMerge.js
Created April 26, 2021 08:34
generic util to shallow merge collections of objects parsed by JSON:API
// shallow merge collection of Entities parsed by JSON:API
const shallowMerge = (col1, col2) => {
const keys = [...Object.keys(col1), ...Object.keys(col2)]
const uniqueKeys = Array.from(new Set(keys))
return uniqueKeys.reduce((obj, uniqueKey) => {
obj[uniqueKey] = Object.assign({}, col1[uniqueKey], col2[uniqueKey])
return obj
}, {})
}
# GIT
## config username
git config --global user.email "alejandro.silva@beetrack.com"
git config --global user.name "AlejandroSilva-bt"
git config --global core.editor "nano"
## generate and add a public key
ssh-keygen -t rsa -b 4096 -C "alejandro.siva@beetrack.com"
ssh-keygen -o
@AlejandroSilva
AlejandroSilva / build-tag-push.sh
Created July 23, 2019 17:47
bash script to build and upload a container to AWS ECS
#!/usr/bin/env bash
set -e # immediately exit if any command [1] has a non-zero exit status
set -u # a reference to any variable you haven't previously defined is an error, and causes the program to immediately exit
set -o pipefail # If any command in a pipeline fails, that return code will be used as the return code of the whole pipeline
# otros operadores
# http://tldp.org/LDP/abs/html/comparison-ops.html
# https://www.imd.guru/sistemas/bash/operadores-de-comparacion.html
# EMOJIS
@AlejandroSilva
AlejandroSilva / gist:c72979c099b049c70776887594e45878
Created June 4, 2019 20:31
script to make http request using 'python3' and 'request' (not well formated)
#!/usr/bin/env python3
import requests
email = "demo@edipro.cl"
password = "THEPASSWORD"
payload = {'email': email, 'password': password}
auth_resp = requests.post('https://demo.edipro.cl/api/v1/sessions', data=payload)
token = auth_resp.json()['session']['token']
print(auth_resp)
print(f"Token: {token}")
@AlejandroSilva
AlejandroSilva / never_gonna_give_you_up.sh
Created May 24, 2019 21:13 — forked from ccnokes/never_gonna_give_you_up.sh
Plays Rick Astley's "Never Gonna Give You Up" in Spotify
#!/bin/bash
osascript <<EOD
tell application "Spotify"
activate
play track "spotify:track:4uLU6hMCjMI75M1A2tKUQC"
play
end tell
EOD

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@AlejandroSilva
AlejandroSilva / gist:720ad6519de7712c22876e35adb64d63
Last active September 18, 2018 06:18
SSH Tunnel - Remote Port Forwarding
-- allow remote hosts to forwarded ports
sudo nano /etc/ssh/sshd_config
# add:
GatewayPorts yes
# restart ssh server
sudo service ssh restart
-- REMOTE port forwarding
# -nNT = dont open a shell
# -R remote port forwarding