Skip to content

Instantly share code, notes, and snippets.

// 粘贴到 console 里就可以了
let r = () => {
const temp = Math.random; Math.random = () => 0; document.getElementById('random').click(); Math.random = temp;
}
let s = () => {
let t;
t = setInterval(() => {
let e = document.getElementById('lifeTrajectory')
if (!e) clearInterval(t)
else e.click()
@chawyehsu
chawyehsu / ublock-origin-csdn-list.txt
Last active December 6, 2020 16:40
用 uBlock 调整 CSDN 博客版面
! 2020-11-27 https://blog.csdn.net
blog.csdn.net##.clearfix.recommend-item-box
blog.csdn.net##.template-box
blog.csdn.net##.triplet-prompt
blog.csdn.net###asideNewComments
blog.csdn.net###asideArchive
blog.csdn.net###asideHotArticle
blog.csdn.net###asideCategory
blog.csdn.net##.left-toolbox
blog.csdn.net##.comment-sofa-flag
@mkczyk
mkczyk / .git-plugin-bash.sh
Last active May 13, 2024 06:59
Git aliases for bash (based on Oh My Zsh Git plugin)
#!/bin/bash
# To ~/.bashrc file add line:
# source ~/.git-plugin-bash.sh
# Based on Oh My Zsh Git plugin (without zsh functions):
# https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/git.plugin.zsh
# https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git
#
@bitcrazed
bitcrazed / settings.json
Last active February 1, 2021 06:29
Windows Terminal Settings
// This file was initially generated by Windows Terminal Preview 1.4.2652.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",
@danvy
danvy / WSL2-Net-Fix.ps1
Created September 5, 2020 21:04
Reset your WSL network connection trying to fix WSL2 media disconnected error
# Check these threads before proceeding:
# https://github.com/microsoft/WSL/discussions/5857
# https://github.com/microsoft/WSL/issues/5821
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
$CmdLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CmdLine
Exit
}
# Restart the Host Network Service
Restart-Service -Force -Name hns
@daehahn
daehahn / wsl2-network.ps1
Last active April 29, 2024 08:27
WSL 2 TCP NETWORK FORWARDING
# WSL2 network port forwarding script v1
# for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell,
# for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter.
# written by Daehyuk Ahn, Aug-1-2020
# Display all portproxy information
If ($Args[0] -eq "list") {
netsh interface portproxy show v4tov4;
exit;
}
@ld100
ld100 / ArchLinuxWSL2.md
Last active May 23, 2024 13:20
Steps for setting up Arch Linux on WSL2

Migrating from Ubuntu on WSL to ArchLinux on WSL2

Obsolete notice

This document was created back in 2020 and might not be actual nowadays. It is not supported anymore, so use thise information at your own risk.

Upgrading to WSL 2

  • Download WSL2 Kernel
  • run wsl --set-default-version 2 in windows command line, so that all future WSL machine will use WSL2.
@onomatopellan
onomatopellan / vhdx.txt
Last active January 21, 2024 21:57
How to automount an external vhdx file in WSL2
1. Ubuntu WSL2 must be already installed in C: system drive and user should be able to call windows binaries like wsl.exe from bash.
2. We will install Alpine WSL2 distro in an external partition/disk:
Download Alpine from here:
https://github.com/yuk7/AlpineWSL/releases/download/3.11.5-1/Alpine.zip
Extract the files in an external partition/disk. (for example D:\Alpine)
Make sure WSL2 is enabled by default (wsl.exe --set-default-version 2)
Inside the Alpine folder run Alpine.exe to install the Distro. An ext4.vhdx file will be created in that same folder.
@imba-tjd
imba-tjd / IMBALIST.TXT
Last active April 23, 2024 12:02
🚫 我的uBO屏蔽列表以及HE规则
[Adblock Plus 2.0]
! Title: IMBALIST
! Homepage: https://gist.github.com/imba-tjd/2c9817233ac6798d4f2bfe057f781ca5
! Expires: 10 days
! 使用方法:将 https://gist.githubusercontent.com/imba-tjd/2c9817233ac6798d4f2bfe057f781ca5/raw/IMBALIST.TXT 添加到uBO的规则列表中
! humblebundle领取key页面
www.humblebundle.com##.download-mosaic
www.humblebundle.com##.coupon.whitebox-redux
www.humblebundle.com##.js-subproduct-whitebox-holder > .whitebox-redux
@xmeng1
xmeng1 / wsl2-network.ps1
Created July 14, 2019 06:50
WSL2 Port forwarding port to linux
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}