Skip to content

Instantly share code, notes, and snippets.

View luccamendonca's full-sized avatar

Lucca Mendonça luccamendonca

View GitHub Profile
@luccamendonca
luccamendonca / mac-dns-get.sh
Created January 19, 2022 13:36
Script to configure DNS entries for all network adapters on macOS
#!/bin/bash -e
while IFS= read -r adapter_name; do
echo "DNS Servers configured on $adapter_name:"
eval "networksetup -getdnsservers \"$adapter_name\""
echo ""
echo "Search domain configured on $adapter_name..."
eval "networksetup -getsearchdomains \"$adapter_name\""
echo ""
@luccamendonca
luccamendonca / Makefile
Created October 29, 2021 22:31
MacOS QEMU Debian example (x86_64)
.PHONY: setup install run
QEMU_BASE_DIR=${HOME}/QEMU
HD_DIR=${QEMU_BASE_DIR}/os-disk.qcow2
HD_SIZE=30G
ISO_DIR=${QEMU_BASE_DIR}/os-install.iso
ISO_URL=https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/current/amd64/iso-dvd/firmware-11.1.0-amd64-DVD-1.iso
define NETWORK_WARNING
================================================================================
@luccamendonca
luccamendonca / .Xmodmap
Created August 23, 2020 15:54
Xmodmap config file made to be used with the Motospeed CK62 keyboard, using CAPS LOCK as a MODE_SWITCH key. Based on https://gist.github.com/eduardomartines/371b790d1c102bccca6db9a25ad2b464
! Custom keycode mappings for the Motospeed ck62 keyboard
!
! How xmodmap works
!
! keycode X = A B C D
! X -> the keycode number. We can use `xev` to get it
!
! Now A-D represents the behaviors the keycode will have when
! A -> Only the key is pressed
! B -> The key is pressed with SHIFT
@luccamendonca
luccamendonca / urlParams.js
Last active May 24, 2016 15:13
Some simple functions to manipulate URL params using JavaScript
function goTo(href) {
if (!href) { return false; }
return window.location.href = href;
}
function getUrlParam (key) {
var paramsAssoc = getUrlParamsAssoc();
return (undefined == paramsAssoc[key]) ? null : paramsAssoc[key];