sudo apt install xrdp
sudo adduser xrdp ssl-cert
sudo systemctl restart xrdp
This file contains 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 | |
## | |
# File: | |
# nginx_modsite | |
# Description: | |
# Provides a basic script to automate enabling and disabling websites found | |
# in the default configuration directories: | |
# /etc/nginx/sites-available and /etc/nginx/sites-enabled | |
# For easy access to this script, copy it into the directory: |
This file contains 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
$GuardianName = 'UntrustedGuardian' | |
$CertificatePassword = Read-Host -Prompt 'Please enter a password to secure the certificate files' -AsSecureString | |
$guardian = Get-HgsGuardian -Name $GuardianName | |
if (-not $guardian) | |
{ | |
throw "Guardian '$GuardianName' could not be found on the local system." | |
} |
This file contains 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
/** | |
* get a random Integer number ∈ [minValue, maxValue) | |
*/ | |
public Integer getRandomNumberBetween(Integer minValue, Integer maxValue) { | |
if (minValue > maxValue) { | |
// swap position | |
Integer tmp = minValue; | |
minValue = maxValue; | |
maxValue = tmp; |
This file contains 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
const isObject = (obj: any) => obj && typeof obj === 'object'; | |
const deepMergeInner = (target: any, source: any) => { | |
Object.keys(source).forEach((key: string) => { | |
const targetValue = target[key]; | |
const sourceValue = source[key]; | |
if (Array.isArray(targetValue) && Array.isArray(sourceValue)) { | |
target[key] = targetValue.concat(sourceValue); | |
} else if (isObject(targetValue) && isObject(sourceValue)) { |
This file contains 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
// update 20230117 | |
// works on https://www.woniufr.vip/p/t_pc/course_pc_detail/video/xxx | |
// Important: Switch to "目录" tab before executing the following code. | |
const clickElementAndWait = (element, timeMS = 2000) => { | |
return new Promise((resolve, reject) => { | |
element.dispatchEvent(new MouseEvent('click')); | |
setTimeout(() => { | |
resolve(); | |
}, timeMS); |
NewerOlder