Skip to content

Instantly share code, notes, and snippets.

View daltonjorge's full-sized avatar

Dalton Jorge daltonjorge

  • UFCG
  • Brazil - Paraiba - Campina Grande
View GitHub Profile
@daltonjorge
daltonjorge / console-via-role.py
Created November 21, 2022 00:19 — forked from carlosevieira/console-via-role.py
This script generates a federated URL using the credentials obtained via SSRF in the AWS metadata to access the console on AWS
import requests
import datetime
import json
import urllib
session_data = {
'sessionId': '[AWS_ACCESS_KEY_ID]',
'sessionKey': '[AWS_SECRET_ACCESS_KEY]',
'sessionToken': '[AWS_SESSION_TOKEN]'
}
@daltonjorge
daltonjorge / Jest_GitLab_CI.md
Created June 13, 2022 15:11 — forked from rishitells/Jest_GitLab_CI.md
Setting up Jest tests and coverage in GitLab CI

Configuring Jest Tests in GitLab CI

1. Add GitLab CI configuration file in the root

In the root of your project, add .gitlab-ci.yml with the configuration below.

image: node:latest

stages:
@daltonjorge
daltonjorge / Dealing with secrets.md
Last active May 3, 2022 17:03 — forked from maelvls/README.md
Ubuntu, libsecret, git-credential-helper

Dealing with secrets

GNOME comes with libsecret. You can use libsecret to store your git credentials:

sudo apt install libsecret-1-0 libsecret-1-dev libglib2.0-dev
sudo make --directory=/usr/share/doc/git/contrib/credential/libsecret
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
@daltonjorge
daltonjorge / gnome.yml
Created December 27, 2021 20:15 — forked from carlwgeorge/gnome.yml
ansible playbook for my gnome setup
# https://docs.ansible.com/ansible/latest/modules/dconf_module.html
#
# To determine what dconf keys and values to use, you can run `dconf watch /`
# in a terminal as you make changes in settings or tweaks. You can also use
# `dconf read <key>` and `dconf write <key> <value>` to experiment with various
# settings. The dconf-editor application is also useful for exploring various
# keys along with their descriptions.
- hosts: localhost
tasks:
@daltonjorge
daltonjorge / nginxproxy.md
Created November 20, 2021 11:45 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@daltonjorge
daltonjorge / Git push deployment in 7 easy steps.md
Created June 28, 2021 02:19 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@daltonjorge
daltonjorge / RSI_and_StochRSI.py
Created April 6, 2021 02:10 — forked from ultragtx/RSI_and_StochRSI.py
Functions that calculate RSI and StochRSI which give the same value as Trading View. I wrote these functions as RSI and StochRSI functions from TA-Lib give different values as TV.
# calculating RSI (gives the same values as TradingView)
# https://stackoverflow.com/questions/20526414/relative-strength-index-in-python-pandas
def RSI(series, period=14):
delta = series.diff().dropna()
ups = delta * 0
downs = ups.copy()
ups[delta > 0] = delta[delta > 0]
downs[delta < 0] = -delta[delta < 0]
ups[ups.index[period-1]] = np.mean( ups[:period] ) #first value is sum of avg gains
@daltonjorge
daltonjorge / i3-shortcuts-screenshot.md
Created April 1, 2021 00:41 — forked from dianjuar/i3-shortcuts-screenshot.md
My i3 shortcuts to take screenshots

Requirements

  • maim
  • xclip

Set-up

Set this on your i3 config file ~/.i3/config

# Screenshots
@daltonjorge
daltonjorge / System Design.md
Created December 9, 2020 15:46 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?