Skip to content

Instantly share code, notes, and snippets.

View Debcharon's full-sized avatar
🎮
ゲームスタート~

Sherlock Zhang Debcharon

🎮
ゲームスタート~
View GitHub Profile
@Debcharon
Debcharon / rename_foldername_with_underline.bat
Created April 1, 2024 15:37
Get the folder name and replace spaces with underline on Windows
REM Get the folder name and replace spaces with underline
for /f "tokens=*" %%i in ("%folderPath%") do (
set "folderName=%%~nxi"
set "newFolderName=!folderName: =_!"
)
@Debcharon
Debcharon / azure_vm_dynamic_secondary_ip_change.ps1
Created November 8, 2023 06:48
Azure VM Dynamic Secondary IP change, all of them will be renew
# Connect Azure account
Connect-AzAccount -Identity
# replace these with your own values
$resource_group = "AzureVMJP"
# Get Azure Resource in same resource group
$location = (Get-AzResourceGroup -Name $resource_group).Location
$vm_name = (Get-AzResource -ResourceGroupName $resource_group -ResourceType "Microsoft.Compute/virtualMachines").Name
@Debcharon
Debcharon / azure_vm_dynamic_ip_change.ps1
Last active November 17, 2023 10:14
Azure VM Dynamic IP Change
# Connect Azure account
Connect-AzAccount -Identity
# replace these with your own values
$resource_group = "AzureVMJP"
# Get Azure Resource in same resource group
$vm_name = (Get-AzResource -ResourceGroupName $resource_group -ResourceType "Microsoft.Compute/virtualMachines").Name
$public_ip_name = (Get-AzResource -ResourceGroupName $resource_group -ResourceType "Microsoft.Network/publicIPAddresses")[0].Name
$dns_label = (Get-AzPublicIpAddress -ResourceGroupName $resource_group -Name $public_ip_name).DnsSettings.DomainNameLabel
@Debcharon
Debcharon / paypal_onetime_subscription.html
Created July 18, 2023 08:50
paypal onetime subscription button for 1 USD
<div id="smart-button-container">
<div style="text-align: center;">
<div id="paypal-button-container"></div>
</div>
</div>
<script src="https://www.paypal.com/sdk/js?client-id={client_id}&enable-funding=venmo&currency=USD" data-sdk-integration-source="button-factory"></script>
<script>
function initPayPalButton() {
paypal.Buttons({
style: {
@Debcharon
Debcharon / subconverter.html
Last active February 18, 2023 09:03
Simple tools progress raw links before subconverter
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Subconverter</title>
</head>
<body>
<div id="pagewrap">
<p>Author:<a href="https://www.microcharon.top" target="_blank">Microcharon - The Way of Developer</a></p>
<p>Node File Path:
@Debcharon
Debcharon / example.com.conf
Last active November 5, 2022 09:26
The nginx vhost template for typecho, Manager for LNMP, lnmp.org
# @ HTTPS REDIRECT
server
{
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name example.com;
ssl_certificate /usr/local/nginx/conf/cert/example.com.crt;
ssl_certificate_key /usr/local/nginx/conf/cert/example.com.key;
return 301 https://www.example.com$request_uri;
}
@Debcharon
Debcharon / 404-template.html
Last active January 3, 2023 05:34
Simple 404 template with animatation for single html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="10;url='https://example.com'">
<title>404</title>
<style>
body {
background: #000;
height: 100vh;