Skip to content

Instantly share code, notes, and snippets.

@Saya47
Saya47 / vhd4wsl2.md
Created March 20, 2024 11:39 — forked from lseongjoo/vhd4wsl2.md
Creating virtual hard disk (VHD) for WSL2

Creating additional virtual hard disk (VHDX) for WSL2 with ext4 filesystem

Lines starting with # mean the commands have to be executed by root user under Linux shell (WSL distro). All other commands have to be executed under Windows-PowerShell as Administrator.

Make VHDX disk file and mount it under Windows

New-VHD support.vhdx -SizeBytes 25GB -Dynamic -BlockSizeBytes 1MB
Write-Output "\\.\PhysicalDrive$((Mount-VHD -Path support.vhdx -PassThru | Get-Disk).Number)"
@Saya47
Saya47 / Anaconda PowerShell Prompt in Windows Terminal settings.json Add an "Anaconda PowerShell Prompt" profile to Windows Terminal. Just paste it in your settings.json file.
{
"colorScheme": "Campbell",
"commandline": "pwsh.exe -ExecutionPolicy ByPass -NoExit -Command \"& '%USERPROFILE%\\anaconda3\\shell\\condabin\\conda-hook.ps1' ; conda activate '%USERPROFILE%\\anaconda3' \"",
"guid": "{e7d34d61-5a57-4f38-8eab-91cb777b0c26}",
"hidden": false,
"icon": "%USERPROFILE%\\anaconda3\\Menu\\anaconda-navigator.ico",
"name": "Anaconda PowerShell Prompt",
"startingDirectory": "%USERPROFILE%"
}
@Saya47
Saya47 / gist:5b50bc3df7c981f07a936bddfd5b3c54
Created February 20, 2024 10:54 — forked from jgould22/gist:f42ad756fc07143e2a104d7844f39b12
Redis 7 Fluent-Bit Log parsing regex
# This is a partial regex to split a redis log line
# It will parse
# Pid
# The role (X, C, S, or M - https://github.com/redis/redis/blob/unstable/src/server.c#L130)
# Time
# level (.,-,*,# which are LOG_DEBUG, LOG_INFO, LOG_NOTICE, LOG_WARNING respectively - https://github.com/redis/redis/blob/unstable/src/server.c#L104)
# Message
[PARSER]
Name redis
@Saya47
Saya47 / fluent-filebeat-comparison.md
Created February 20, 2024 10:27 — forked from StevenACoffman/fluent-filebeat-comparison.md
Fluentd Fluent-bit FileBeat memory and cpu resources

Fluent-bit rocks

A short survey of log collection options and why you picked the wrong one. 😜

Who am I? Where am I from?

I'm Steve Coffman and I work at Ithaka. We do JStor (academic journals) and other stuff. How big is it?

Number what it means
101,332,633 unique visitors in 2017
@Saya47
Saya47 / wall.sh
Created February 15, 2024 13:20 — forked from danmou/wall.sh
Replacement for the unix wall command, which also works with gnome-terminal
#!/bin/bash
usage="
Usage:
wall [options] [message]
Write a message to all users.
Options:
-n, --nobanner do not print banner
@Saya47
Saya47 / index.user.js
Created February 14, 2024 13:31 — forked from m-Phoenix852/index.user.js
Userscript to login to discord accounts with ease, just do SHIFT + T at the login page and enter the token!
// ==UserScript==
// @name Discord Token Login
// @namespace https://gist.github.com/m-Phoenix852/d63d869f16e40dac623c9aa347e8641a/
// @version 1.1
// @description Taking over discord's tokens!
// @author Phoenix852
// @match *://discord.com/login
// @updateURL https://gist.github.com/m-Phoenix852/d63d869f16e40dac623c9aa347e8641a/raw/6d1ee63df17685e4ea06018bd8b47541d4261b82/index.user.js
// @grant none
// @iconURL https://i.imgur.com/rI8GsTz.png
@Saya47
Saya47 / starship.toml
Created September 15, 2023 12:09 — forked from ryo-ARAKI/starship.toml
Starship configuration file
# ~/.config/starship.toml
[battery]
full_symbol = "🔋"
charging_symbol = "🔌"
discharging_symbol = "⚡"
[[battery.display]]
threshold = 30
style = "bold red"
@Saya47
Saya47 / 00-usage.md
Created September 9, 2023 11:28 — forked from Benoss/00-usage.md
AutoSSH Tunnel Config

Create a new local tunnel user to keep the .ssh/config clean

sudo useradd -g nogroup -s /bin/false -m tunnel
sudo -u tunnel mkdir -p ~tunnel/.ssh  # and copy your private key here
sudo -u tunnel nano ~tunnel/.ssh/config  # add host and key configs here and a myhostsshconf (or other name)
sudo -u tunnel ssh myhostsshconf  # just make sure to add your host to `known_hosts`

Create a new systemd service with the same name than an entry in the .ssh/config (myhostsshconf in this example)

@Saya47
Saya47 / alacritty.yml
Created September 8, 2023 21:32 — forked from adibhanna/alacritty.yml
Alacritty
font:
size: 18
offset:
y: 16
glyph_offset:
y: 9
normal:
family: "SFMono Nerd Font"
window:
padding:
@Saya47
Saya47 / solution.md
Created April 29, 2023 08:27 — forked from kymtwyf/solution.md
org.apache.hadoop.security.AccessControlException): Permission denied: user=Yongfeng, access=WRITE, inode="/user/hadoop/test.txt

有几种解决办法

  1. 去掉hdfs的permissions:
<property>
  <name>dfs.permissions</name>
  <value>false</value>
</property>

这个一定有效...