Skip to content

Instantly share code, notes, and snippets.

View lucassrg's full-sized avatar

Lucas Gomes lucassrg

View GitHub Profile
@lucassrg
lucassrg / cic-UL_Lock_customization_terms_conditions.js
Created September 22, 2022 16:29
CIC Universal Login Lock Customization to include Terms and Conditions
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Sign In with Auth0</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
</head>
<body>
@lucassrg
lucassrg / docker_on_ubuntu.md
Created March 28, 2022 14:44
Install Docker on Ubuntu 18.04

9 Steps to install Docker on Ubuntu 18.04

1.Remove any Docker files that are running in the system, using the following command:

sudo apt-get remove docker docker-engine docker.io

2. Check if the system is up-to-date:

sudo apt-get update
@lucassrg
lucassrg / gitlab-k8s-connection-oke.sh
Created June 17, 2021 01:50
Creates Service Token for GitLab integration with K8s - OKE Cluster - Oracle Cloud Infrastructure (requires kubectl)
#!/bin/bash
print_gitlab_config() {
separator=-
ca_row="| %-15s| %c\n"
TableWidth=90
printf "%${TableWidth}s\n" | tr ' ' $separator
printf "%${TableWidth}s\n" | tr ' ' $separator
printf "|%60s %26s\n" "GitLab K8s cluster integration - Connect existing cluster"
printf "%${TableWidth}s\n" | tr ' ' $separator
@lucassrg
lucassrg / controller-executor.png
Last active May 21, 2021 18:00
controller-executor
controller-executor.png
@lucassrg
lucassrg / install-gitlab-runner-docker-ol79.sh
Last active April 6, 2021 19:16
Install GitLab Runner on Oracle Linux 7.9 with Docker executor
#!/bin/bash
while getopts s:t: flag
do
case "${flag}" in
s) GITLAB_SERVER_URL=${OPTARG};;
t) GITLAB_SERVER_REGISTRATION_TOKEN=${OPTARG};;
esac
done
@lucassrg
lucassrg / create-iam-policy.json
Last active February 11, 2021 02:58
Create OCI IAM policy for publishing and consuming OCI Stream - oci iam policy create --from-json file://create-iam-policy.json
{
"compartmentId": "<compartment-ocid>",
"description": "Policy to allow publishers/consumers to use a Stream",
"name": "use-streams",
"statements": [
"Allow group <group-name> to use stream-push in compartment id <compartment-ocid> where target.stream.id='<stream-ocid>'",
"Allow group <group-name> to use stream-pull in compartment id <compartment-ocid> where target.stream.id='<stream-ocid>'"
]
}
@lucassrg
lucassrg / disable_iptables.sh
Created September 25, 2020 19:44
disable_iptables
iptables -F
iptables -X
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
@lucassrg
lucassrg / print_policies
Created August 26, 2020 21:22
Print OCI IAM policy statements created for Marketplace
oci iam policy list --compartment-id=$OCI_TENANCY | jq -cr '.data[] | ."statements"|.[] | select(. | test("marketplace";"i"))'
@lucassrg
lucassrg / oci_cleanup_block_storage.py
Last active June 18, 2020 01:48
Clean up orphans boot volumes (dettached) in all compartments and subscribed region of a tenancy
#!/usr/bin/env python3
# coding: utf-8
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# This script clean-up all detached block storage (boot and block volumes)
#
#
#
#
import oci