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 [email protected] -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 / export-import-gpg.sh
Last active August 5, 2024 11:05
gpg management
# Get ID
gpg --auto-key-locate keyserver --locate-keys [email protected]
# Export
gpg -ao mypub.key --export <MY_KEY_ID>
gpg -ao myprivate.key --export-secret-keys <MY_KEY_ID>
# Import
gpg --import myprivate.key
gpg --import mypub.key
@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