This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://hostloc.com/ | |
function getRandomValue(min, max) { | |
return Math.floor(Math.random() * (max - min + 1) + min); | |
} | |
function getUniqueRandomList(size) { | |
let ret = new Set(); | |
while (ret.size < size) { | |
ret.add(getRandomValue(1, 77000)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Net.NetworkInformation; | |
using System.Net.Sockets; | |
namespace WakeOnLAN | |
{ | |
public static class Program |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Net; | |
using System.Threading; | |
namespace WebClientDownloader | |
{ | |
public static class Program | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace IntegerEndianConvert | |
{ | |
public static class Program | |
{ | |
public static byte[] endianConvert(byte[] data) | |
{ | |
int length = data.Length; | |
byte[] ret = new byte[length]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Net; | |
using System.Reflection; | |
using System.Runtime.InteropServices; | |
using System.Runtime.Serialization.Json; | |
using System.Text; | |
namespace HTTPTimeClient | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Management; | |
using System.Text; | |
using static System.Management.ManagementObjectCollection; | |
namespace SerialQuery |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 0 3 * * * /home/quilt/storage_firewall_log.sh | |
LOG_PATH=/var/log/172.16.204.252 | |
LOG_FILE="date=$(date +%Y-%m-%d -d -1day).log" | |
COMPRESS_FILE="Firewall-$(date +%Y-%m-%d -d -1day).tar.xz" | |
STORAGE_PATH=/home/quilt/log | |
cd $LOG_PATH | |
tar Jcvf $COMPRESS_FILE $LOG_FILE | |
mv $COMPRESS_FILE "$STORAGE_PATH"/"$COMPRESS_FILE" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# crontab -e | |
# */5 * * * * /path/to/script.sh | |
# Domain Zone | |
zone=example.com | |
# Domain | |
dns_record=quilt.example.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
title KMS Office 2019 | |
>nul 2>&1 "%SystemRoot%\system32\cacls.exe" "%SystemRoot%\system32\config\system" | |
if "%ErrorLevel%" NEQ "0" ( | |
echo 嘗試取得系統管理員權限 ... | |
goto UACPrompt | |
) else ( | |
goto getAdmin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
netsh winsock reset | |
netsh int ip reset | |
ipconfig /release | |
ipconfig /renew | |
ipconfig /flushdns |
NewerOlder