Skip to content

Instantly share code, notes, and snippets.

View aleguerra05's full-sized avatar

Alejandro Guerra Perez aleguerra05

View GitHub Profile
@aleguerra05
aleguerra05 / Github_issues.gs
Last active March 29, 2024 03:28
Google Script for retrieve Projects issues from GitHub using GraphQL API
// Replace 'YOUR_ACCESS_TOKEN' with your GitHub access token
var accessToken = '<gitHubAccesToken>';
// Replace 'YOUR_PROJECT_ID' with the desired project ID
var projectId = '<ProjectID>';
function fetchGitHubData() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
sheet.clear();
@aleguerra05
aleguerra05 / setOracleSequences.sql
Last active April 21, 2021 20:44
Set value of all sequences of oracle schema
BEGIN
FOR x in (select * from user_sequences)
LOOP
EXECUTE IMMEDIATE 'drop sequence '||x.sequence_name ;
EXECUTE IMMEDIATE 'create sequence '||x.sequence_name||' start with 10000';
END LOOP;
END;
@aleguerra05
aleguerra05 / oracle-delete-blob.sql
Last active June 9, 2020 16:39
Oracle Blob free space
alter table table_name modify lob (column_name) (shrink space);
@aleguerra05
aleguerra05 / git-bundle.sh
Created June 7, 2020 20:00
bundle git changes
machineA$ git bundle create feature.mirama.bundle develop..feature/mirama --all
machineA$ git tag -f semana1 feature/mirama
'send the file
machineB$ git bundle verify feature.mirama.bundle
machineB$ git ls-remote feature.mirama.bundle
machineB$ git checkout feature/mirama
machineB$ git pull feature.mirama.bundle
@aleguerra05
aleguerra05 / inprovments_dockerfile.txt
Created January 20, 2020 18:02
inprovments dockerfile
in git version 1.7.9.5 this seems to work to export a single file from a remote
git archive --remote=ssh://host/pathto/repo.git HEAD README.md
This will cat the contents of the file READ
@aleguerra05
aleguerra05 / autisgned-cert.sh
Created September 3, 2019 18:37
Create an autosigned certificate
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt
@aleguerra05
aleguerra05 / load-balancer-proxy.cfg
Created September 3, 2019 18:17
redirect port 80 to 443 (ssl)
frontend 80
acl lepath path_beg -i /.well-known/acme-challenge
acl lepath path_beg -i /rancher
redirect scheme https code 302 if !lepath !{ ssl_fc }
@aleguerra05
aleguerra05 / docker-trics.sh
Last active September 6, 2019 19:02
Some docker tricks
# Docker service start on boot
sudo systemctl enable docker
#check Docker status
sudo systemctl status docker
#remove untagged images
docker rmi $(docker images -f "dangling=true" -q)
@aleguerra05
aleguerra05 / export-import-docker.ps
Created June 27, 2019 19:09
Esport and Import all docker images.
--EXPORT
docker save $(docker images -q) -o /path/to/save/mydockersimages.tar
--
docker images | awk '{if ($1 ~ /^(openshift|centos)/) print $1 " " $2 " " $3 }' | tr -c "a-z A-Z0-9_.\n-" "%" | while read REPOSITORY TAG IMAGE_ID
do
echo "== Saving $REPOSITORY $TAG $IMAGE_ID =="
docker save -o /path/to/save/$REPOSITORY-$TAG-$IMAGE_ID.tar $IMAGE_ID
done
@aleguerra05
aleguerra05 / process-port.ps
Created June 27, 2019 16:28
How can you find out which process is listening on a port on Windows?
Get-Process -Id (Get-NetTCPConnection -LocalPort portNumber).OwningProcess