Skip to content

Instantly share code, notes, and snippets.

@citruz
citruz / QEMU_ON_M1.md
Last active June 6, 2024 08:29
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

@goffinet
goffinet / centos7-grub-console.sh
Last active June 17, 2022 03:51
Centos7 serial console enabled by grub /etc/default/grub, "grub-mkconfig -o /boot/grub/grub.cfg"
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
cat << EOF > /etc/default/grub
# grub-mkconfig -o /boot/grub/grub.cfg
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
@ivan-loh
ivan-loh / README.md
Last active September 30, 2022 19:13
netcat tcp proxy, for mapping ports on a remote machine to a local machine

Helper script to map ports to other servers.

Use Case

had a database that was only accesible in the VPC on aws, so i created an dev intance and did a ssh tunnel to that dev instance with netcat mapping the port to the database

Sample Usage

Forward all request from local 5432 to remote host google.com port 80

./nc-proxy.sh 5432 google.com 80
@albertbori
albertbori / Installation.md
Last active July 15, 2024 15:33
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges