Skip to content

Instantly share code, notes, and snippets.

View msjyoo's full-sized avatar

Michael Yoo msjyoo

View GitHub Profile
# https://sanctum.geek.nz/arabesque/better-bash-history/
shopt -s histappend
shopt -s cmdhist
export HISTFILESIZE=
export HISTSIZE=
export HISTTIMEFORMAT='%F %T '
export HISTFILE=~/.bash_history2
export HISTCONTROL=ignoreboth
export HISTIGNORE='ls:bg:fg:history'
export PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
@msjyoo
msjyoo / gist:78b741fb48a9f0936e20
Last active April 6, 2021 08:06
How to set up NAT for Internet access with Hyper-V
In the Virtual SAN Editor:
Select Internal mode.
Then, open cmd, type in `ipconfig`.
You should see something like this:
```
Ethernet adapter vEthernet (Internal Virtual Switch 1):
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : xxmacaddressxx:1:2:3:randomidentifier
@msjyoo
msjyoo / test.js
Created October 6, 2019 17:41
Event loop no-op performance test scripts
let y = 0;
async function sleep() {
await new Promise(resolve => {
setImmediate(() => {
y++;
resolve();
});
});
}
@msjyoo
msjyoo / gravity.prg
Created November 18, 2018 04:03
Commodore 64 Game Code
10 rem reserve addresses above 13312
20 poke 55,0: poke 56,52: clr
30 gosub 1000
40 gosub 2000
50 gosub 3000
60 gosub 4000
70 gosub 5000
80 print "you win!"
500 end
@msjyoo
msjyoo / 75-input.rules
Created April 11, 2018 01:40 — forked from fghaas/75-input.rules
Attempt to disable AlpsPS/2 ALPS DualPoint Stick as an input device (via udev)
# /etc/udev/rules.d/75-input.rules
# local udev rules for input devices
ACTION!="add|change", GOTO="input_end"
# ALPS DualPoint Stick: Ignore as input device
ENV{ID_BUS}=="i8042", ENV{NAME}=="AlpsPS/2 ALPS DualPoint Stick", ENV{ID_INPUT}="", ENV{ID_INPUT_MOUSE}="", ENV{ID_INPUT_POINTINGSTICK}=""
LABEL="input_end"
@msjyoo
msjyoo / README.md
Created July 24, 2015 12:55
A quick gist because this wasn't documented anywher else. How to render and make sense of the MCPE / PocketMine Skin Data

How to use

Basically, this file will take in a binary file of skin.dat and export 3 files: image.png is the skin file, face.png is the face in original size, faceLarge.png is the face in 512x512.

Only supports 64x64 skins for now. If you want 32x64 make appropriate checks.

The PocketMine's (MCPE's) Skin Data Format is in RGBA format, when represented as hex strings they are a stream of 8 characters. Each two characters represent the R, G, B A, and this continues until you have enough data for either a 32x64 image or a 64x64 image. You can also check whether 32x or 64x with the isSlimSkin() flag on the Player object.

Note that A only has 2 values: 0 and 255. They are inverted in the script because PHP.

If you have a gaming machine and a laptop, and want to use steam in-home streaming, but you only have 1 internet port in your room, and you only have a switch at your disposal? And it turns out just switching everything together doesn't work because your 1 port has port security enabled?

VLAN can be used to make sure that the port-security port doesn't see the computer while still all connected to the same switch.

1 - College LAN 2 - Laptop 3 - Gaming computer

Set up a VLAN between 1,2 and 2(tagged),3(PVID set to this VLAN). Pretty standard.

#!/usr/bin/env bash
# Copyright (c) 2017 Michael Yoo <michael@yoo.id.au> All Rights Reserved, Licenced under Apache-2.0
set -u
CASES=( 5000 10000 20000 50000 )
RUN=5
TESTDIR=$(mktemp -d)
FROM debian:jessie
ADD sources.list /etc/apt/sources.list
RUN cat /etc/apt/sources.list | sed -e 's/^deb/deb-src/g' >> /etc/apt/sources.list
WORKDIR /tmp/firefox-gtk2-build/
RUN apt-get update && apt-get build-dep -y -t unstable firefox=50.1.0-1
br-xxxxxxxxx
Could be docker, see using `docker network ls`