Skip to content

Instantly share code, notes, and snippets.

View jreypo's full-sized avatar
🇪🇸
Living life my way

Juanma jreypo

🇪🇸
Living life my way
View GitHub Profile
@jreypo
jreypo / tmstart.sh
Created September 25, 2025 14:14
tmux startup script
#!/usr/bin/env bash
SESSION=dev
# If session already exists, just attach
if tmux has-session -t $SESSION 2>/dev/null; then
tmux attach -t $SESSION
exit 0
fi
# Otherwise create new one
# Azure Bastion tunnel script (PowerShell version) by @jreypo
#
# Requires Azure CLI installed in your Windows machine
#
$rg = Read-Host "Enter resource group name"
$bastion = Read-Host "Enter Bastion name"
$vmname = Read-Host "Enter virtual machine name"
$resourceport = Read-Host "Enter remote resource port"
$port = Read-Host "Enter local port"
@jreypo
jreypo / bastion-tunnel.sh
Created April 12, 2023 14:00
Script to open an tunnel to Azure Bastion and use Remote Desktop to acess a VM in Azure
#!/bin/bash
#
# Azure Bastion tunnel script by @jreypo
#
echo -n "Enter resource group name: "
read rg
echo -n "Enter Bastion name: "
read bastion
echo -n "Enter virtual machine name: "

Keybase proof

I hereby claim:

  • I am jreypo on github.
  • I am jreypo (https://keybase.io/jreypo) on keybase.
  • I have a public key ASD3xugQdQNn1V_bE7Ra38ASzJarqSm7v6Y9Da58ZWUVIwo

To claim this, I am signing this object:

#!/bin/bash
#
# Script to install Docker and Kubeadm in Ubuntu 18.04
#
# Written by Juan Manuel Rey <juanmanuel.reyportal@gmail.com>
# Based on Kubernetes official doc
#
echo "Installing Docker..."
@jreypo
jreypo / boxstarter.ps1
Last active May 19, 2020 09:39
Boxstarter script for quick Windows 10 setup
# Description: Boxstarter Script
# Author: Juan Manuel Rey <juanmanuel.reyportal@gmail.com>
#
# Heavily based on Jess Frazz Boxstarter gist https://gist.github.com/jessfraz/7c319b046daa101a4aaef937a20ff41f
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#

CMD useful comands

  • tasklist - To list the tasks running
  • taskkill - To kill a task

Examples

Search for a task

{
"type": "ExistingCloud",
"auth_url": "http://172.16.98.7:5000/v2.0",
"region_name": "RegionOne",
"admin": {
"username": "admin",
"password": "redhat",
"tenant_name": "admin"
}
}
for node in $(ironic node-list | egrep "power on" | awk '{print $2}'); do
echo "Powering off $node"
ironic node-set-power-state $node off
done
#!/usr/bin/env python
#
# Written by Juan Manuel Rey
# Github: https://github.com/jreypo
# Blog: http://blog.jreypo.io/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#