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
#!/usr/bin/bash | |
SHOULD_CONNECT= | |
for SOCKET_FILE in "/run/user/$UID/vscode-ipc-"*.sock; do | |
if socat -u OPEN:/dev/null "UNIX-CONNECT:$SOCKET_FILE" &>/dev/null; then | |
echo "may connect? $SOCKET_FILE" >&2 | |
SHOULD_CONNECT=$SOCKET_FILE | |
else | |
echo "delete ununsed socket: $SOCKET_FILE" >&2 |
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
function json_array() { | |
if [[ $# -eq 0 ]]; then | |
echo '[]' | |
fi | |
# --ascii-output if no base64 | |
jq --null-input --compact-output --slurp '$ARGS.positional' --args "$@" | |
} | |
function json_array_get_back() { | |
local -i SIZE i |
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
########### /usr/local/bin/auto-update | |
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
declare -i RETRY=3 | |
while ! pacman -Syu --noconfirm; do | |
RETRY=$((RETRY - 1)) | |
if [[ $RETRY -le 0 ]]; then |
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
// GENERATED CODE, DO NOT EDIT. | |
{ | |
"$schema": "http://json-schema.org/schema", | |
"definitions": { | |
"global-config": { | |
"description": "全局配置", | |
"additionalProperties": false, | |
"properties": { | |
"RecordMode": { | |
"description": "录制模式", |
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
### append this into $PROFILE.CurrentUserAllHosts | |
foreach ($info in Get-ChildItem -Path HKCU:/Network) { | |
$letter = Split-Path -Leaf -Path $info.Name -ErrorAction SilentlyContinue | |
if (-Not $letter) { continue } | |
if (Test-Path -Path "${letter}:/") { continue } | |
$remote = $info.GetValue('RemotePath') | |
if (-Not $remote) { continue } | |
New-PSDrive -Scope Global -PSProvider "FileSystem" -Name $letter -Root $remote -ErrorAction SilentlyContinue | Out-Null | |
} |
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
#!/usr/bin/env bash | |
mkinitrd \ | |
--with fuse \ | |
--with virtio_scsi \ | |
--with virtio_mmio \ | |
--with virtio_console \ | |
--with virtio_blk \ | |
-f initrd.img \ | |
"$(uname -r)" |
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
declare -a _ARG_GETOPT_LONG | |
declare -a _ARG_GETOPT_SHORT | |
declare -A _ARG_COMMENT | |
declare -A _ARG_INPUT | |
declare -A _ARG_OUTPUT | |
declare -A _ARG_RESULT | |
declare -A _ARG_REQUIRE | |
function arg_string() { | |
if [[ "$1" == '+' ]]; then | |
shift |
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
if uname | grep -iq "cygwin" ; then | |
IFS=: read -r -d '' -a path_array < <(printf '%s:\0' "$PATH") | |
WINPATH="" | |
LP="" | |
for P in "${path_array[@]}"; do | |
if [[ "$P" =~ ^/cygdrive ]]; then | |
WINPATH+=":$P" | |
else | |
LP+="$P:" |
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
{"lastUpload":"2020-01-11T20:45:17.450Z","extensionVersion":"v3.4.3"} |
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
[Unit] | |
Description=Auto run UMI UI | |
After=data.mount | |
# Requires=mariadb.service | |
[Service] | |
Type=simple | |
Restart=on-failure | |
Environment=DISPLAY= HOST=0.0.0.0 UMI_PORT=15000 UMI_UI_BROWSER=none DEBUG=umiui:* | |
ExecStart=/usr/local/bin/umi ui |
NewerOlder