Moved to: https://gist.github.com/valorad/7fd3e4a7fb4481f1eb77ded42a72537d
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 | |
set -e | |
caConfigFolder="/path/to/cfssl/caConfig" | |
sitesToRefresh=("com.mycompany" "site.my") | |
serverCertFolder="./certs" | |
for site in ${sitesToRefresh[@]}; do |
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
// 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); |
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
$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 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
--- | |
version: "3.9" | |
services: | |
node: | |
labels: | |
- "traefik.enable=true" | |
# Vue Dev Server |
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/sh | |
set -e | |
# Snapshot @targetSubvolume to @storageSubvolume/path/to/checkpoints/folder | |
UUID='76186cef-780f-4a80-9c0f-19fcc3a53ee6' | |
targetSubvolumeName='@arch-root' | |
storageSubvolumeName='@workspace' | |
mountPath="/mnt/$UUID" |
Fish (friendly interactive shell) users find themselves losing their installed snapd/flatpak apps after restarting the desktop.
These apps can be run with respective commands. However, they are unable to be found at the desktop menu. They cannot associate default apps either.
If you are also a fish user, when you run flatpak update
, you get this:
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
Write-Host "===============================================================" | |
Write-Host "=========================== Link On ===========================" | |
Write-Host "===============================================================" | |
# Configs --> | |
$linkConfig = [ordered]@{ | |
"originFolder1" = "D:\test\targetFolder1" | |
"originFolder2" = "D:\test\targetFolder2" | |
} |
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
/** | |
* Sets a value of nested key string descriptor inside a Object. | |
* It changes the passed object. | |
* Ex1: | |
* let obj = {a: {b:{c:'initial'}}}; | |
* setNestedKey(obj, ['a', 'b', 'c'], 'changed-value'); | |
* assert(obj === {a: {b:{c:'changed-value'}}}); | |
* | |
* Ex2: | |
* let obj = null; |
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
directory="/mnt/c/workspace" | |
fileEntries=`ls $directory` | |
for file in ${fileEntries[@]} | |
do | |
if [[ -L "$directory/$file" ]] | |
then | |
sudo mkdir -p /mnt/$file | |
sudo mount -t drvfs C:\\workspace\\$file /mnt/$file -o metadata,uid=1000,gid=1000,umask=22,fmask=002 | |
fi |