Skip to content

Instantly share code, notes, and snippets.

View adrianriobo's full-sized avatar
🎯
Focusing

Adrián Riobo Lorenzo adrianriobo

🎯
Focusing
View GitHub Profile
@adrianriobo
adrianriobo / only podman
Last active February 16, 2023 10:24
podman key
macmini-crcqe-2:~ crcqe$ cat ~/.ssh/known_hosts
macmini-crcqe-2:~ crcqe$ ssh -i ~/.crc/machines/crc/id_ecdsa core@127.0.0.1 -p 2222
The authenticity of host '[127.0.0.1]:2222 ([127.0.0.1]:2222)' can't be established.
ED25519 key fingerprint is SHA256:jfbXiEwqxZcVKLW/biuNolLr80NfNuJuOdr3jmI9Xl4.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[127.0.0.1]:2222' (ED25519) to the list of known hosts.
Fedora CoreOS 37.20221225.3.0
Activate the web console with: systemctl enable --now cockpit.socket
@adrianriobo
adrianriobo / replace modules
Created December 23, 2022 13:20
Go cheatsheet
To get the v for a module from a different repo on a specific commit:
go get github.com/adrianriobo/pulumi-command@4007017bb359927f8474c223a753d6f2d4be79e2
This will add the required dependency on go.mod:
require (
github.com/adrianriobo/pulumi-command v0.0.0-20221223131545-4007017bb359 // indirect
...
)
Then use replace with the value:
@adrianriobo
adrianriobo / rh-subscription.sh
Created October 18, 2022 19:47
rh subscription management
# Check state
sudo subscription-manager status
# Check subscriptions
sudo subscription-manager list --consumed
# Check product
sudo subscription-manager list
# Register
@adrianriobo
adrianriobo / pull upstream PR
Last active December 21, 2022 09:23 — forked from umayr/recover-deleted-branch.sh
Git cheatsheet
git remote add upstream https://github.com/USER/repository.git
git checkout -b BRANCHNAME
git pull upstream pull/ID/head:BRANCHNAME
git checkout BRANCHNAME
@adrianriobo
adrianriobo / github-app-jwt.sh
Created May 30, 2022 20:37 — forked from carestad/github-app-jwt.sh
Script to generate JWT for use with Github apps
#!/usr/bin/env bash
# Generate JWT for Github App
#
# Inspired by implementation by Will Haley at:
# http://willhaley.com/blog/generate-jwt-with-bash/
# From:
# https://stackoverflow.com/questions/46657001/how-do-you-create-an-rs256-jwt-assertion-with-bash-shell-scripting
thisdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@adrianriobo
adrianriobo / multi.sh
Created July 29, 2021 07:25
multipart download script using curl
#!/bin/bash
# Author: Param Aggarwal
# Multipart parallel downloader in Shell using cURL
if [[ $# -lt 1 ]]; then
echo "$0: Pass URL to download as argument"
exit 1
fi
url=$1
@adrianriobo
adrianriobo / config.sh
Created May 5, 2021 12:58
jenkins automation
# Create token
curl 'https://${JENKINS_URL}/me/descriptorByName/jenkins.security.ApiTokenProperty/generateNewToken' \
--data 'newTokenName=${TOKEN_NAME}'
--user ${USERNAME}:${PASSWORD}
@adrianriobo
adrianriobo / win openssh config
Last active May 19, 2021 10:20
Windows Openssh configuration
# Download Openssh https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH
# Start-Service sshd
# OPTIONAL but recommended:
Set-Service -Name sshd -StartupType 'Automatic'
# In our case due the limitations on logon accounts for services on windows we need to create a bat file to start
# the service on startup
# Create firewall rule
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
@adrianriobo
adrianriobo / gpg-mgmt.sh
Last active December 4, 2020 07:34
gpg management
# Generate gpg use same email as verified account on Git
gpg --full-generate-key
# Get keys info
gpg --list-secret-keys --keyid-format LONG
# Upload key to server and sign to verify
gpg --export your@email.com | curl -T - https://keys.openpgp.org
# Configure to work with keyserver
@adrianriobo
adrianriobo / filesystem.sh
Created November 23, 2020 07:58
Linux troubleshooting
# Check largest files
sudo du -a /dir/ | sort -n -r | head -n 20