Skip to content

Instantly share code, notes, and snippets.

View devodla's full-sized avatar
💭
I may be slow to respond.

Reynaldo devodla

💭
I may be slow to respond.
View GitHub Profile
@devodla
devodla / cognito-idtoken-cli.sh
Created May 26, 2022 22:21 — forked from Can-Sahin/cognito-idtoken-cli.sh
Simple shell script to obtain a IdToken from Cognito User Pool. Just like logging in.
#!/bin/bash
username="COGNITO_USER_NAME"
password="PASSWORD"
clientid="APP_CLIENT_ID"
region="eu-west-1"
aws_profile="AWS_CLI_PROFILE"
response_json=""
json_field='IdToken'
@devodla
devodla / lambda-proxy-integration.yml
Created December 6, 2021 14:54 — forked from balintsera/lambda-proxy-integration.yml
Lambda Proxy Integration with Cloudformation tamplate
apiGateway:
Type: "AWS::ApiGateway::RestApi"
Properties:
Name: "example-api-gw"
Description: "Example API"
ProxyResource:
Type: "AWS::ApiGateway::Resource"
Properties:
ParentId: !GetAtt apiGateway.RootResourceId

Use Proxy for Git/GitHub

Generally, the Git proxy configuration depends on the Git Server Protocal you use. And there're two common protocals: SSH and HTTP/HTTPS. Both require a proxy setup already. In the following, I assume a SOCKS5 proxy set up on localhost:1080. But it can also be a HTTP proxy. I'll talk about how to set up a SOCKS5 proxy later.

SSH Protocol

When you do git clone ssh://[user@]server/project.git or git clone [user@]server:project.git, you're using the SSH protocal. You need to configurate your SSH client to use a proxy. Add the following to your SSH config file, say ~/.ssh/config:

ProxyCommand nc -x localhost:1080 %h %p
@devodla
devodla / mongodb-s3-backup.sh
Created September 30, 2020 00:39 — forked from eladnava/mongodb-s3-backup.sh
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x backup.sh
# 7) Test it out via ./backup.sh
@devodla
devodla / mongodb-ssl.sh
Last active September 7, 2020 01:35 — forked from kevinadi/mongodb-ssl.sh
Script to create self-signed CA certificates, server certificates, and client certificates for testing MongoDB with SSL
#!/bin/sh
# Generate self signed root CA cert
openssl req -nodes -x509 -newkey rsa:2048 -keyout ca.key -out ca.crt -subj "/C=BR/ST=SP/L=Sao Paulo/O=Layme Inc/OU=root/CN=`hostname -f`/[email protected]"
# Generate server cert to be signed
openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr -subj "/C=BR/ST=SP/L=Sao Paulo/O=Layme Inc/OU=server/CN=`hostname -f`/[email protected]"
# Sign the server cert
# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
export PATH=$PATH:/Users/reynaldolayme/Library/Android/sdk/platform-tools
export PATH=$PATH:/Users/reynaldolayme/Library/Android/sdk/tools
export ANDROID_HOME=/Users/reynaldolayme/Library/Android/sdk
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/reynaldolayme/.oh-my-zsh"
export PATH=$PATH:/Users/reynaldolayme/Library/Android/sdk/platform-tools
export PATH=$PATH:/Users/reynaldolayme/Library/Android/sdk/tools
export ANDROID_HOME=/Users/reynaldolayme/Library/Android/sdk
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
@devodla
devodla / Config-code
Created July 8, 2020 02:50
Configuracion de Code
{
"git.autofetch": true,
"workbench.sideBar.location": "left",
"git.enableSmartCommit": true,
"workbench.editor.limit.enabled": true,
"workbench.editor.limit.perEditorGroup": true,
"workbench.editor.limit.value": 5,
"terminal.integrated.shell.osx": "/bin/zsh",
"editor.fontSize": 14,
"editor.fontFamily": "Fira Code",
@devodla
devodla / .gitconfig
Last active April 26, 2024 12:06
Config the Git
[user]
email = [email protected]
name = Huillca, Reynaldo
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[hub]
protocol = ssh