Skip to content

Instantly share code, notes, and snippets.

View bytemain's full-sized avatar
🎯
Focusing

野声 bytemain

🎯
Focusing
View GitHub Profile
@bytemain
bytemain / wsl-hosts.ps1
Created August 10, 2022 02:50 — forked from kakkun61/wsl-hosts.ps1
WSL v2 windows hosts sync (powershell - updates domains to wsl2 ip)
If (!(New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host 'Run this as administrator.'
$choice = Read-Host 'Do you want to re-run this as administrator? [y/N]'
if ($choice -ne 'y') {
exit 1
}
$actualScriptRoot = $PSScriptRoot
if ((Get-Item $PSCommandPath).Target) {
$actualScriptRoot = Split-Path -Parent ((Get-Item $PSCommandPath).Target)
}
// Released under MIT license
// Copyright (c) 2009-2010 Dominic Baggott
// Copyright (c) 2009-2010 Ash Berlin
// Copyright (c) 2011 Christoph Dorn <christoph@christophdorn.com> (http://www.christophdorn.com)
/*jshint browser:true, devel:true */
(function( expose ) {
/**
@bytemain
bytemain / HttpProxy.go
Created February 17, 2023 11:46 — forked from yowu/HttpProxy.go
A simple HTTP proxy by Golang
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"strings"
)
@bytemain
bytemain / .gitconfig
Created April 19, 2023 02:57 — forked from Kovrinic/.gitconfig
git global url insteadOf setup
# one or the other, NOT both
[url "https://github"]
insteadOf = git://github
# or
[url "git@github.com:"]
insteadOf = git://github