Skip to content

Instantly share code, notes, and snippets.

View johnnymillergh's full-sized avatar
💪
Coding & Building

Johnny Miller johnnymillergh

💪
Coding & Building
View GitHub Profile
@johnnymillergh
johnnymillergh / docker-initialization-for-mac-linux.md
Last active March 12, 2021 14:13
Docker Initialization Command

Docker Image Initialization (Mac)

Basically, these command is doing mapping local host’s file system to docker container.

[TOC]

Command Instructions: docker run

docker run --help
@johnnymillergh
johnnymillergh / index.txt
Last active July 18, 2021 12:36
Windows 10 Docker Errors & Solutions on WSL2
https://github.com/docker/for-win/issues/3171#issuecomment-554587817
This is /obviously/ not docker's problem (as best I can tell), it's probably not even hyperv's. Commenting here as this seems to be a frustrating and common end of journey for googlers. What follows is at least "one" of the resolutions/explanations.
On one of my machines the dynamic port range was not updated to the "new" start port, and I guess related to a resolved bug in windows has now "exposed" this as a serious problem (e.g.: I couldn't even bind to port 3000 for node dev -- access denied is I think a valid response, but it's not the typical "port in use" root cause).
Current dynamic port config:
> netsh int ipv[46] show dynamicport tcp
Unless you know you've mucked with these settings, and if it doesn't specify 49152 as "Start Port" and is set to 1025, it's not "current". I don't know if there is some kind of migration bug when they were patching this new value or what. Dynamic start port for udp was set correctly for example.
@johnnymillergh
johnnymillergh / 1. Proxy Domain or IP.txt
Last active September 27, 2023 14:28
V2ray Configuration
===== Domain =====
geosite:google,
geosite:apple,
geosite:microsoft,
geosite:facebook,
geosite:twitter,
geosite:telegram,
geosite:geolocation-!cn,
geosite:tld-!cn,
domain:github.com,
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
// This file was initially generated by Windows Terminal 1.3.2651.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
SELECT *
FROM user
WHERE username LIKE '%/_%' ESCAPE '/';
SELECT *
FROM user
WHERE username LIKE '%\_%';
@johnnymillergh
johnnymillergh / edas-startup.cmd
Last active December 14, 2020 06:08
EDAS startup command for Windows
@echo on
setlocal
@REM UTF-8
chcp 65001
cls
set SERVER_IP=""
if not "%JRE_HOME%" == "" goto gotJreHome
if not "%JAVA_HOME%" == "" goto gotJavaHome
@johnnymillergh
johnnymillergh / index.js
Last active August 20, 2020 06:08
Proxy and reflect in JavaScript
/**
* Observe an object by proxy
* @param {*} object
* @param {function} callback function
* @returns {Proxy} the proxy of object
*/
function observe (object, callback) {
return new Proxy(object, {
get (target, key, receiver) {
return Reflect.get(target, key, receiver)
@johnnymillergh
johnnymillergh / getLocalIP.js
Created July 7, 2019 01:48 — forked from hectorguo/getLocalIP.js
Get local IP address through Javascript
/**
* Get Local IP Address
*
* @returns Promise Object
*
* getLocalIP().then((ipAddr) => {
* console.log(ipAddr); // 192.168.0.122
* });
*/
function getLocalIP() {