Skip to content

Instantly share code, notes, and snippets.

View robertoporfiro's full-sized avatar
🏠
Working from home

Roberto Porfiro robertoporfiro

🏠
Working from home
View GitHub Profile
@robertoporfiro
robertoporfiro / CORS Filter
Created February 29, 2024 18:00 — forked from wildoctopus/CORS Filter
How to fix the CORS issue on backend side , java Springboot App (Handling Simple CORS requests)
//Contents from https://spring.io/understanding/CORS
In the simplest scenario, cross-origin communications starts with a client making a GET, POST, or HEAD request against a resource on the server.
In this scenario, the content type of a POST request is limited to application/x-www-form-urlencoded, multipart/form-data, or text/plain. The request includes an Origin header that indicates the origin of the client code.
The server will consider the request's Origin and either allow or disallow the request. If the server allows the request, then it will respond with the requested resource and an Access-Control-Allow-Origin header in the response. This header will indicate to the client which client origins will be allowed to access the resource. Assuming that the Access-Control-Allow-Origin header matches the request's Origin, the browser will allow the request.
On the other hand, if Access-Control-Allow-Origin is missing in the response or if it doesn't match the request's Origin, the browser will disallow th
@bhimsur
bhimsur / ArgoCD.md
Last active April 2, 2025 17:22
Installing ArgoCD on Minikube

Installing ArgoCD

  1. We will start with launching minikube cluster.
minikube start --driver=docker
  1. Create a namespace for argocd
kubectl create namespace argocd
  1. Apply ArgoCD manifest installation file from ArgoCD github repository
@eisenreich
eisenreich / wait_for_http_200.sh
Last active July 5, 2024 16:20 — forked from rgl/wait_for_http_200.sh
Wait for HTTP endpoints to return 200 OK with bash, curl and timeout
#!/bin/bash
##############################################################################################
# Wait for URLs until return HTTP 200
#
# - Just pass as many urls as required to the script - the script will wait for each, one by one
#
# Example: ./wait_for_urls.sh "${MY_VARIABLE}" "http://192.168.56.101:8080"
##############################################################################################
@robertoporfiro
robertoporfiro / docker-build.sh
Created November 24, 2021 21:13 — forked from moinsam/docker-build.sh
Bash Script to build and push Docker image into ECR
#!/bin/bash
if [ $# -eq 0 ]; then
echo "No arguments provided"
exit 1
fi
if [[ -z $2 ]]; then
echo ---------------Node-----------------
@robertoporfiro
robertoporfiro / del_branch.sh
Created August 25, 2021 17:40 — forked from skdubey/del_branch.sh
This script will pull all the branches from your Bitbucket repository of all the projects and their repositories, find the merged branches older than 30 days and delete it.
#!/bin/bash
## Get the list of all the projects from Bitbucket account across all the pages
get_total_project_list () {
start=0
total_project_list=()
is_last_page=false
while ! $is_last_page
do
response=$(curl -k -u $u -X GET -H "Content-type: application/json" $bitbucket_url/rest/api/1.0/projects?start=$start) 2>&1
@robertoporfiro
robertoporfiro / jenkins-git-backup.sh
Created July 25, 2021 11:15 — forked from choldrim/jenkins-git-backup.sh
Example of a script for backing up Jenkins config in git.
#!/bin/bash
# Copies certain kinds of known files and directories from a given Jenkins master directory
# into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em.
set -ex
if [ $# -ne 3 ]; then
echo usage: $0 jenkins_home git_repos_url git_repos_name
exit 1
fi
@Mihailoff
Mihailoff / bitbucket-pipelines.yml
Created May 26, 2021 02:11
Bitbucket pipelines - docker login with AWS credentials
image: node:14
pipelines:
branches:
default:
- step:
name: build
script:
- apt-get update
- apt-get install -y python3-pip
@robertoporfiro
robertoporfiro / SSL-certs-OSX.md
Created May 12, 2021 08:54 — forked from croxton/SSL-certs-OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@heoelri
heoelri / azure-vmss-with-cloud-init.tf
Last active May 29, 2021 17:58
Azure VMSS deployed via Terraform with cloud init
resource "azurerm_linux_virtual_machine_scale_set" "deployment" {
name = "buildagent-vmss"
resource_group_name = azurerm_resource_group.deployment.name
location = azurerm_resource_group.deployment.location
sku = "Standard_F8s_v2"
instances = var.numberOfWorkerNodes # number of instances
overprovision = false
single_placement_group = false
@robertoporfiro
robertoporfiro / bitbucket_approve_pull.py
Created April 18, 2021 20:34 — forked from richmilne/bitbucket_approve_pull.py
Approve pull requests on BitBucket Server.
#! /usr/bin/env python3
"""Approve pull requests on BitBucket Server.
If you are trying to approve pull requests on BitBucket from external/3rd-
party tools (like Jenkins) there may be plugins available to do the job
automatically - if you're lucky. The `Bitbucket Approve Plugin`_ seems to be
one such plugin.
Unfortunately, it's only for the *CLOUD*-hosted version of Bitbucket. The
self-hosted version, Bitbucket Server (formerly known as Stash) uses a