Skip to content

Instantly share code, notes, and snippets.

View bombless's full-sized avatar

York Xiang bombless

  • Guangzhou, China
View GitHub Profile

https://sspai.com/post/74757

我们首先需要导出该发行版到一个压缩包中;再反注册该发行版;接着再一个新的安装位置重新导入该发行版。接下来用 D 盘来做一个具体的例子,假设我首先创建了一个空白的路径 D:\WSL\Ubuntu,然后执行:

PS C:\Users\someone> cd D:\WSL
PS D:\WSL> wsl.exe --export Ubuntu-20.04 Ubuntu-20.04.tar
PS D:\WSL> wsl.exe --unregister Ubuntu-20.04
PS D:\WSL> wsl.exe --import Ubuntu-20.04 D:\WSL\Ubuntu Ubuntu-20.04.tar
#include <cstddef>
#include <memory>
#include <iostream>
#include <vector>
template<typename T>
class ObjectTraits {
public :
// convert an ObjectTraits<T> to ObjectTraits<U>
template<typename U>
@bombless
bombless / Factory.java
Created October 12, 2022 08:19
Java Image processing
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;
class Factory {
public static void main(String[] args) throws IOException {
<script>
export let value = [1, [2, [3]]];
function extend(idx) {
return () => {
view[idx] = value[idx];
};
}
function strip(idx) {
return () => {
console.log('strip', view[idx]);
@bombless
bombless / _.sh
Created March 21, 2021 12:18
fastadmin 配 nginx
$ docker pull bitnami/php-fpm:latest
$ docker run -it --name phpfpm -p 9000:9000 -v /Users/yuekexiang/xxx:/app bitnami/php-fpm
$ cat /usr/local/etc/nginx/nginx.conf
# ...
server
{
listen 80;
#listen [::]:80;
server_name www.xxx.com;
@bombless
bombless / m.md
Created October 28, 2020 22:06
docker

https://uxmilk.jp/55512

我把save的内容保存为debian.tar,把export的内容保存为debian-container.tar了

@bombless
bombless / main.hs
Created May 3, 2020 13:04
Haskell fetch GBK web page
#!/usr/bin/env stack
-- stack script --resolver lts-12.21
{-# LANGUAGE OverloadedStrings #-}
import qualified Network.HTTP.Simple as Http
import qualified Codec.Text.IConv as IConv
import qualified Data.ByteString.Lazy as BSL
import qualified Data.ByteString.Lazy.Char8 as BSLC
-- check
@bombless
bombless / gist:b531d6b0346ce38fede89a85f434cf3b
Created October 8, 2019 08:19
datagrip/mysql workbench连接高版本mysql
use mysql;
update user set plugin='mysql_native_password' where User='root';
flush privileges;
Citing Ron Maupin's answer from https://networkengineering.stackexchange.com/questions/33397/debugging-no-route-to-host-over-ethernet:
The ICMP message, "no route to host," means that ARP cannot find the layer-2 address for the destination host. Usually, this means that that the host with that IP address is not online or responding.