Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Justin cattyhouse

💭
I may be slow to respond.
  • N/A
  • Jupiter
View GitHub Profile
@cattyhouse
cattyhouse / README.en.md
Created Jun 12, 2021 — forked from niw/README.en.md
How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac
View README.en.md

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, 6/6/2021 state.

Running Windows 10 on ARM

  1. Install Xcode from App Store or install Command Line Tools on your Mac running on Apple Silicon.
@cattyhouse
cattyhouse / QEMU-Silicon-Mac-Virtualization.md
Created Jun 9, 2021 — forked from nrjdalal/QEMU-Silicon-Mac-Virtualization.md
Create Virtual Machines using QEMU on Silicon based Apple Macs
View QEMU-Silicon-Mac-Virtualization.md

Install QEMU on Silicon based Apple Macs (June 2021)

Option 1 - Automatically

zsh -c "$(curl -fsSL https://raw.githubusercontent.com/nrjdalal/silicon-virtualizer/master/install-qemu.sh)"

Option 2 - Manually

  • Install Xcode command line tools

xcode-select --install
@cattyhouse
cattyhouse / ArchLinuxARM-M1
Created May 28, 2021 — forked from thalamus/ArchLinuxARM-M1
How to boot Arch Linux ARM in QEMU (patched for M1) or Parallels Technical Preview for M1
View ArchLinuxARM-M1
/*
* This document is provided to the public domain under the
* terms of the Creative Commons CC0 public domain license
*/
How to boot Arch Linux ARM in QEMU (patched for M1) or Parallels Technical Preview for M1
Prerequisites:
Either:
@cattyhouse
cattyhouse / disable.sh
Created Jun 9, 2020 — forked from pwnsdx/disable.sh
Disable bunch of #$!@ in Catalina
View disable.sh
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
@cattyhouse
cattyhouse / unit.sh
Created Jun 7, 2020 — forked from tvlooy/unit.sh
Bash test: get the directory of a script
View unit.sh
#!/bin/bash
function test {
MESSAGE=$1
RECEIVED=$2
EXPECTED=$3
if [ "$RECEIVED" = "$EXPECTED" ]; then
echo -e "\033[32m✔︎ Tested $MESSAGE"
else
View meson-gxl-s905d-phicomm-n1.dts
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2018 He Yangxuan
*/
/dts-v1/;
#include "meson-gxl-s905d-p230.dts"
/ {
View PotatsoAdblockConfig.conf
ruleSets:
- name: Potatso Adblock Config
rules:
# Some services are available locally
- DOMAIN-MATCH,aka,Proxy
- DOMAIN-SUFFIX,edu.cn,DIRECT
# Apple
- DOMAIN-SUFFIX,apple.co,Proxy
View PotatsoConfig.conf
ruleSets:
- name: Potatso Config
rules:
- DOMAIN-MATCH,aka,Proxy
- DOMAIN-SUFFIX,edu.cn,DIRECT
- DOMAIN-SUFFIX,cn,DIRECT
- DOMAIN-MATCH,-cn,DIRECT
- DOMAIN-MATCH,360buy,DIRECT
- DOMAIN-MATCH,alipay,DIRECT
View chnroute-gen.sh
#!/bin/sh
export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/bin"
# download chnroute, if faied, then stop
echo "* * * begin"
curl 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | grep ipv4 | grep CN | awk -F\| '{ printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > chnroute.txt && echo "chnroute.txt generated" || exit 1
# use cidrmerge to compress chnroute, if tailed, then exit
cat chnroute.txt | cidrmerge > chnroute.lite.txt && echo "chnroute.lite.txt generated" || exit 1
# generate new chnroute-action to use with ~/bin/acd
rm -f chnroute-action
while read cnip ; do echo "route -nq \${_action} ${cnip} \${current_gw}" >> chnroute-action ; done < chnroute.lite.txt && echo "chnroute-action generated, copy them to the script"
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname