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 / 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 / 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

(?<loglevel>[A-Z])%{NUMBER:logcode} %{TIME} %{NUMBER:threadid} (?<file_source>%{WORD}\.%{WORD}):(?<file_line>%{NUMBER})\] (?<message>.*)
@darkn3rd
darkn3rd / git-crypt-list-keys.sh
Created March 24, 2021 18:04 — forked from acobaugh/git-crypt-list-keys.sh
List git-crypt gpg keys
for key in .git-crypt/keys/default/0/* ; do gpg -k $(echo $(basename $key) | sed -e 's/.gpg//') ; done ;
@darkn3rd
darkn3rd / update-alternatives-golang.sh
Created February 24, 2021 02:10 — forked from bench/update-alternatives-golang.sh
update-alternatives golang
#!/bin/bash
#
# Use the following script using sudo to install multiple golang installations on your debian
# update-alternatives creates, removes, maintains and displays information about the symbolic links comprising the alternatives system
# Usage : sudo ./full_golang_install.sh
#
if [[ $(id -u) -ne 0 ]] ; then echo "This script should be run using sudo or as the root user" ; exit 1 ; fi
## Configuration and init
@darkn3rd
darkn3rd / ansible_variable_precedence.md
Created November 24, 2020 23:54 — forked from ekreutz/ansible_variable_precedence.md
Ansible variable precedence (order, hierarchy)
@darkn3rd
darkn3rd / nginxproxy.md
Created July 3, 2018 06:44 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg