Skip to content

Instantly share code, notes, and snippets.

View alfredodeza's full-sized avatar

Alfredo Deza alfredodeza

View GitHub Profile
@alfredodeza
alfredodeza / rescue.md
Created November 29, 2025 01:00
Mount Omarchy root volume

Rescue from Omarchy

If you ever are stuck with Omarchy like I did with a bad hyperland.conf and you have no access to the system, then boot with the ISO with USB and exit from the installer.

Then:

  1. lsblk of fdisk -l to find your partition. Mine is NVME so I used that one
  2. crypsetup luksOpen /dev/your-root-partition cryptroot # this will prompt your password
  3. mount /dev/mapper/cryptroot /mnt
@alfredodeza
alfredodeza / README.md
Created December 12, 2023 00:12
Force Forward DNS in Edge Router

Force DNS to any client on your network

Enforce any client that uses port 53 for a DNS lookup to get redirected to the DNS server of your choice. This effectively forces any client with custom or self-configured DNS to still go through your DNS server of choice.

UI Settings

Navigate to the UI and then to: Firewall/NAT -> NAT. Click on "Add a Destination NAT Rule". In my case eth1 is the port all clients go and eth0 is where the WAN goes in, and 192.168.0.1 is the router itself where the DNS server is

  • Inbound interface: eth1
  • Translations Address: 192.168.0.1
#!/bin/bash
set -x
# Get all users
USERS=`az ad user list -o tsv --query "[].id"`
# Grant them the Azure Active Directory built-in role (not an Azure role!)
# The cf1c3... id comes from https://learn.microsoft.com/en-us/azure/active-directory/roles/permissions-reference
# Specifically, it is the Application Developer role which has the "Template ID" in that table
for USER in $USERS; do
@alfredodeza
alfredodeza / gist:f3b42d4fd1ab958da29475efbcee8cd7
Created January 2, 2023 21:21
Use avconvert to encode MOV files to MP4 using h264
destination_dir=$(dirname $1)
input_filename=$(basename $1)
name=$(basename ${input_filename} .mov)
output_path="$destination_dir/$name.mp4"
avconvert --preset Preset1920x1080 --source $1 --output $output_path
if [ $? -eq 0 ]; then
mv $1 /tmp/
fi
# This workflow will build and push a Python application to an Azure Web App when a commit is pushed to your default branch.
#
# This workflow assumes you have already created the target Azure App Service web app.
# For instructions see https://docs.microsoft.com/en-us/azure/app-service/quickstart-python?tabs=bash&pivots=python-framework-flask
#
# To configure this workflow:
#
# 1. Download the Publish Profile for your Azure Web App. You can download this file from the Overview page of your Web App in the Azure Portal.
# For more information: https://docs.microsoft.com/en-us/azure/app-service/deploy-github-actions?tabs=applevel#generate-deployment-credentials
#
@alfredodeza
alfredodeza / markdown_links.md
Created July 18, 2022 12:42
Markdown links for GitHub repository
@alfredodeza
alfredodeza / remote-desktop.md
Last active December 14, 2023 16:27
Remote k8s with docker-desktop using an SSH tunnel

Remote Kubernetes using SSH

My setup is using a Macmini with Docker for Desktop installed and with the Kubernetes option enabled. The main objective of the setup: use kubectl directly without any additional flags from my local computer, accessing/interacting the remote k8s instance

Ensure SSH is setup with key-based authentication

Copy public key to the remote authorized_keys file

cat ~/.ssh/id_rsa.pub | ssh admin@macmini-server 'umask 0077; mkdir -p .ssh; cat >> .ssh/authorized_keys'
@alfredodeza
alfredodeza / osx-cmake-fix.sh
Created July 12, 2021 19:26
OSX fixing missing cmake executable
# Install cmake with homebrew, which prevents:
# AssertionError: Could not find "cmake" executable!
brew install cmake
# and then install protobuf which fixes:
# CMake Error at CMakeLists.txt:292 (message):
# Protobuf compiler not found
# Call Stack (most recent call first):
# CMakeLists.txt:323 (relative_protobuf_generate_cpp)
brew install protobuf
@alfredodeza
alfredodeza / Vagrantfile
Created February 26, 2020 16:45
Handy vagrantfile for local VMs with some custom IP/CPU/ram mappings
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.ssh.insert_key = false
config.vm.synced_folder '.', '/vagrant', disabled: true
config.vm.define 'node1' do |node1|
node1.vm.box = "ceph/ubuntu-bionic"
node1.vm.network :private_network, :ip => "192.168.111.100"
$ minishift start --show-libmachine-logs -v5
-- minishift version: v1.30.0+186b034
-- Starting profile 'minishift'
Found binary path at /usr/local/bin/docker-machine-driver-xhyve
Launching plugin server for driver xhyve
Plugin server listening at address 127.0.0.1:55267
() DBG | operation not supported by device
() Calling .GetVersion
Using API Version 1
() Calling .SetConfigRaw