Skip to content

Instantly share code, notes, and snippets.

View darkn3rd's full-sized avatar
🏠
Working from home

Joaquin Menchaca darkn3rd

🏠
Working from home
View GitHub Profile
@darkn3rd
darkn3rd / vagrant_qemu_command.sh
Last active May 12, 2024 21:53
Vagrant QEMU Plugin - qemu command
#####
# qemu command created by vagrant-qemu plugin example
#
# Description:
# This is an example of what the vagrant-qemu plugin creates.
# I am not sure if any of this works, this shell script is theory
# crafting for documentation and understanding.
##########################################
#####################
@darkn3rd
darkn3rd / linux-vms-on-apple-m1-with-networking.md
Created May 10, 2024 06:10 — forked from davidandreoletti/linux-vms-on-apple-m1-with-networking.md
Short summary to run Linux VMs on an Apple M1 host using QEMU, libvirt and HVF with a working network setup

Linux Virtual Machines with Private Network on an Apple M1 Device

Background

The aim was to be able to:

  1. Run multiple Linux VMs on an Apple M1/ARM device
  2. Use Apple's HVF for native performance speeds
  3. Configure VMs to allow network access to each other
  4. Configure VMs to allow access to the internet
  5. Not rely on custom modifications of software
@darkn3rd
darkn3rd / README.en.md
Created May 10, 2024 05:50 — forked from niw/README.en.md
How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

Here is easy steps to try Windows 10 on ARM or Ubuntu for ARM64 on your Apple Silicon Mac. Enjoy!

NOTE: that this is current, 10/1/2021 state.

Running Windows 10 on ARM

  1. Install Xcode from App Store or install Command Line Tools on your Mac
@darkn3rd
darkn3rd / QEMU_ON_M1.md
Created May 10, 2024 05:49 — forked from citruz/QEMU_ON_M1.md
Create Ubuntu and Windows VMs with QEMU on Apple Silicon

Running Linux and Windows on M1 with QEMU

30.11.2020: Updated with the new patchseries and instructions for Windows

02.12.2020: Added tweaks

08.12.2020: Updated with patchseries v4

31.01.2020: Updated with patchseries v6

@darkn3rd
darkn3rd / randpasswd_function.sh
Last active April 28, 2024 03:45
randpasswd bash function
randpasswd() {
NUM=${1:-32}
# macOS scenario
if [[ $(uname -s) == "Darwin" ]]; then
perl -pe 'binmode(STDIN, ":bytes"); tr/A-Za-z0-9//dc;' < /dev/urandom | head -c $NUM
else
# tested with: GNU/Linux, Cygwin, MSys
tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w $NUM | sed 1q
fi
@darkn3rd
darkn3rd / vault_dgraph_1.sh
Last active April 25, 2024 19:18
Vault Dgraph Part 1
mkdir ./{vault,dgraph}
cat << 'EOF' > compose.yml
services:
zero1:
image: dgraph/dgraph:${DGRAPH_VERSION}
command: dgraph zero --my=zero1:5080 --replicas 1 --raft idx=1
ports:
- 6080:6080
container_name: zero1
@darkn3rd
darkn3rd / instructions.md
Last active March 2, 2024 22:18
Consul Lab 0 - KodeKloud

Installation

Goal: Install Consul 1.17.0.

# INSTALL
# Source: https://developer.hashicorp.com/consul/downloads
wget -O- https://apt.releases.hashicorp.com/gpg \
  | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
@darkn3rd
darkn3rd / get_eksctl_ebs_policy.sh
Created May 6, 2023 18:38
Get Inline Policy Attached to Node IAM Role
EKS_CLUSTER_NAME=${EKS_CLUSTER_NAME:-"my-cluster"}
NODE_GROUP=$(aws eks list-nodegroups \
--cluster-name $EKS_CLUSTER_NAME \
| jq -r '.nodegroups[0]'
)
ROLE_ARN=$(aws eks describe-nodegroup \
--cluster-name $EKS_CLUSTER_NAME \
--nodegroup-name $NODE_GROUP \
| jq -r '.nodegroup.nodeRole'
)
@darkn3rd
darkn3rd / provision.md
Last active January 4, 2024 08:30
Pedantic ADHD Guide to Kubernetes Provisioning

Pedantic ADHD Guide to Kubenretes Provisioning

This is my guide for how to get Kubernetes provisioned using Azure, Google Cloud, or AWS using CLI tools. This will require setting up an account with local CLI tools. The goal of this is to quickly set up a disposable test clusters in minimalist way.

The Tools

Some tools used here:

  • General
  • direnv (direnv) - used to setup environment variables automatically
@darkn3rd
darkn3rd / SQL Cheat Sheet.md
Created January 4, 2023 12:27 — forked from janikvonrotz/SQL Cheat Sheet.md
SQL Cheat Sheet#SQL#Markdown

SQL languages

DDL is short name of Data Definition Language, which deals with database schemas and descriptions, of how the data should reside in the database.

DML is short name of Data Manipulation Language which deals with data manipulation, and includes most common SQL statements such SELECT, INSERT, UPDATE, DELETE etc, and it is used to store, modify, retrieve, delete and update data in database.

DCL is short name of Data Control Language which includes commands such as GRANT, and mostly concerned with rights, permissions and other controls of the database system.

Datatypes

Text types