Skip to content

Instantly share code, notes, and snippets.

@jdmedeiros
jdmedeiros / superset_config.py
Created March 5, 2024 12:27
superset_config.py with https://auth0.com/ authentication
from flask_appbuilder.security.manager import AUTH_OAUTH
SECRET_KEY = 'A1B4E2F0C3D7FE98456AC0BD34EF1234'
AUTH_TYPE = AUTH_OAUTH
AUTH_USER_REGISTRATION = True
AUTH_USER_REGISTRATION_ROLE = "Admin"
OAUTH_PROVIDERS = [
{
'name': 'auth0',
@jdmedeiros
jdmedeiros / resdata.txt
Last active February 26, 2024 17:58
Resdata for CCNA 200-301
1: "AC", 2: "A", 3: "C", 4: "DE", 5: "B", 6: "B", 7: "B", 8: "AB", 9: "B", 10: "BD",
11: "D", 12: "D", 13: "AB", 14: "C", 15: "D", 16: "D", 17: "D", 18: "AD", 19: "B", 20: "A",
21: "DE", 22: "D", 23: "C", 24: "C", 25: "D", 26: "C", 27: "C", 28: "A", 29: "D", 30: "D",
31: "BC", 32: "C", 33: "C", 34: "C", 35: "BE", 36: "BC", 37: "B", 38: "B", 39: "B", 40: "D",
41: "D", 42: "D", 43: "D", 44: "DE", 45: "BC", 46: "B", 47: "C", 48: "C", 49: "C", 50: "BC",
51: "B", 52: "D", 53: "B", 54: "D", 55: "B", 56: "D", 57: "A", 58: "C", 59: "D", 60: "C",
61: "D", 62: "B", 63: "C", 64: "AE", 65: "D", 66: "AB", 67: "D", 68: "A", 69: "AD", 70: "DE",
71: "A", 72: "A", 73: "A", 74: "C", 75: "B", 76: "C", 77: "C", 78: "C", 79: "BC", 80: "A",
81: "C", 82: "C", 83: "A", 84: "D", 85: "C", 86: "C", 87: "A", 88: "A", 89: "C", 90: "D",
91: "AE", 92: "D", 93: "C", 94: "C", 95: "BD", 96: "D", 97: "BEF", 98: "AD", 99: "D", 100: "D",
#!/usr/bin/python3
import argparse
import hashlib
import json
import os
import socket
import sys
import time
@jdmedeiros
jdmedeiros / Graphical_User_Interface_On_EC2
Last active February 2, 2023 08:07
Graphical User Interface (GUI) on AWS EC2 Linux-2
Installing a Graphical User Interface (GUI) on AWS EC2 Linux-2
sudo amazon-linux-extras install mate-desktop1.x
sudo amazon-linux-extras install epel
sudo amazon-linux-extras install chromium filezilla
sudo yum -y install xrdp chromium filezilla
sudo systemctl enable --now xrdp
# This will make the graphic interface available to all users
sudo bash -c 'echo PREFERRED=/usr/bin/mate-session > /etc/sysconfig/desktop'
# Make sure to export the instance ID
# export instance_id=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
import boto3
import os
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2', region_name='us-east-1')
volume_info = ec2.describe_volumes(
Filters=[
{
@jdmedeiros
jdmedeiros / postgresql_install.sh
Created November 4, 2022 22:16 — forked from coder4web/postgresql_install.sh
PostgreSQL install and setup
:'SET PASSWORD
sudo -i -u postgres
psql
\password postgres
'
# RHEL / CentOS 8
# https://www.postgresql.org/download/linux/redhat/
# https://www.postgresql.org/docs/current/runtime.html
dnf list installed |grep postgresql
#!/bin/sh
SCRIPT_LOG=logfile.log
# https://serverfault.com/questions/103501/how-can-i-fully-log-all-bash-scripts-actions
exec 3>&1 4>&2
trap 'exec 2>&4 1>&3' 0 1 2 3
exec 1>$SCRIPT_LOG 2>&1
source ./logger.sh
SCRIPTENTRY
@jdmedeiros
jdmedeiros / contracts...5_PicarPonto.sol
Created May 6, 2022 23:51
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.7.0;
pragma abicoder v2;
contract PicarPonto {
struct Agente {
address sender;
string cargo;
string nome;
@jdmedeiros
jdmedeiros / Readme.md
Last active April 25, 2022 13:23
Anaconda environment to setup Jupyter lab on AWS Glue endpoint

On AWS Glue dev endpoint setup Node and npm without sudo [https://www.johnpapa.net/node-and-npm-without-sudo/]

mkdir /mnt/s3/glue && cd /mnt/s3/glue
wget https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.xz
tar xvf node-v16.14.2-linux-x64.tar.xz 
ln -s node-v16.14.2-linux-x64 node

Add node and npm to the path modifying /home/glue/.bash_profile

$ cat /home/glue/.bash_profile
root@fw:/etc/netplan# cat 50-cloud-init.yaml
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
eth0:
dhcp4: true