Skip to content

Instantly share code, notes, and snippets.

View gsw945's full-sized avatar
🙏
buddha-like coding

玖亖伍 gsw945

🙏
buddha-like coding
View GitHub Profile
@rminderhoud
rminderhoud / powershell-web-server.ps1
Last active May 3, 2025 17:24 — forked from 19WAS85/powershell-web-server.ps1
A simple web server built with powershell.
# This is a super **SIMPLE** example of how to create a very basic powershell webserver
# 2019-05-18 UPDATE — Created by me and and evalued by @jakobii and the comunity.
# Http Server
$http = [System.Net.HttpListener]::new()
# Hostname and port to listen on
$http.Prefixes.Add("http://localhost:8080/")
# Start the Http Server
@wholroyd
wholroyd / preparations.md
Last active August 10, 2026 12:53
Getting Minikube on WSL2 Ubuntu working

Windows Preparation

  1. Ensure hypervisor functionality is enabled in BIOS.

    • I know it sounds stupid, but if you already have it enabled, disable it, restart the machine, and enable it again.
    • Otherwise you will hit microsoft/WSL#5363
  2. Launch a PowerShell prompt in Administrator mode [Win+X > Windows PowerShell (Admin)]

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
@banyudu
banyudu / free-docker-space-in-wsl2.blog.md
Last active April 28, 2026 13:58
WSL2 Docker释放磁盘空间

WSL2 Docker释放磁盘空间

Docker使用久了,会残留很多中间生成的镜像,占用磁盘空间。

要清理Docker镜像,本来是挺简单的,一条命令就搞定了:

Code Color
30 Black
31 Red
32 Green
33 Yellow
34 Blue
35 Magenta
36 Cyan
37 White
@changhuixu
changhuixu / git-prompt.sh
Created June 26, 2020 13:38
~/.config/git/git-prompt.sh
PS1='\[\033]0;$TITLEPREFIX:\W\007\]' # set window title
PS1="$PS1"'\n' # new line
PS1="$PS1"'\[\033[32m\]' # change to green
PS1="$PS1"'git@local ' # user@host<space>
PS1="$PS1"'\[\033[35m\]' # change to purple
PS1="$PS1"'$MSYSTEM ' # show MSYSTEM
PS1="$PS1"'\[\033[33m\]' # change to brownish yellow
PS1="$PS1"'\W' # current working directory
if test -z "$WINELOADERNOEXEC"
then
@bfgits
bfgits / set ulimit
Created April 16, 2020 09:00
Set Permanently ulimit -n / open files in ubuntu
# available limit
user@ubuntu:~$ ulimit -n
1024
# To increase the available limit to say 65535
user@ubuntu:~$ sudo vim /etc/sysctl.conf
# add the following line to it
fs.file-max = 65535
@arkadiuszwojcik
arkadiuszwojcik / ActorContainerNext.cs
Created December 11, 2019 20:38
Scoped dependency injection in Proto Actor
public class ActorContainerNext : WindsorContainer
{
private readonly ConcurrentDictionary<Type, PID> singletons = new ConcurrentDictionary<Type, PID>();
public ActorContainerNext(IWindsorContainer parent = null)
{
Parent = parent;
Register(ContainerComponents().ToArray());
}
@SkinyMonkey
SkinyMonkey / gist:d15514ec05be86c9e03dca678eec8e78
Last active August 9, 2021 05:54
protoactor linked list benchmark
package main
import (
"fmt"
"runtime"
"sync"
"time"
"github.com/AsynkronIT/protoactor-go/actor"
)
public class LiteDbContext : ILiteDbContext
{
public LiteDatabase Database { get; }
public LiteDbContext(IOptions<LiteDbOptions> options)
{
Database = new LiteDatabase(options.Value.DatabaseLocation);
}
}