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 / gist:ca67499cd5b2233d8a381640e606cda6
Created April 7, 2022 20:31
Allow http connection in Firefox
- Open "about:config";
- Search for "security.tls.version.min";
- Set value to 1.
@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 / Add_a_total_row_to_a_R_data_frame.R
Created July 22, 2021 12:32
Add a total row to a R data frame
% Solution 1
original_data_frame <- data.frame(
name = c('John','Paul','Mary'),
age = c(25, 30, 20),
salary = c(90000, 110000,85000)
)
new_df_with_totals <- data.frame(
name = 'Total',
colSums(t(original_data_frame[,-1]))
@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