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 | |
| set /p name=请输您的计算机名: | |
| reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v ComputerName /t reg_sz /d %name% /f | |
| reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t reg_sz /d %name% /f | |
| reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v Hostname /t reg_sz /d %name% /f |
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 | |
| SH_PATH=$(cd "$(dirname "$0")";pwd) | |
| cd ${SH_PATH} | |
| if [ ! -z "$(command -v yum)" ]; then | |
| yum -y install wget expect | |
| if [ ! -f "/etc/yum.repos.d/cloudfoundry-cli.repo" ]; then | |
| wget -O /etc/yum.repos.d/cloudfoundry-cli.repo https://packages.cloudfoundry.org/fedora/cloudfoundry-cli.repo | |
| fi | |
| yum -y install cf-cli |
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
| #!/usr/bin/env python3 | |
| import time | |
| SUFFIXES = {1000: ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], | |
| 1024: ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']} | |
| def approximate_size(size, a_kilobyte_is_1024_bytes=True): | |
| '''Convert a file size to human-readable form. | |
| Keyword arguments: | |
| size -- file size in bytes |
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 | |
| # Ryan Lieu <[email protected]> | |
| # 2018.06.27 | |
| # config start | |
| CID= | |
| USER= | |
| PASSWD= | |
| MOUNTPOINT=/mnt/onedrive | |
| LOGDIR=/var/log/onedrive.log | |
| # config end |
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 | |
| # Frp client start script for 453bmini ( QNAP x86_64 NAS) | |
| # Created: 2020-03-02 | |
| # Author: Ryan Lieu<[email protected]> | |
| # https://doufu.ru | |
| # Support multiple frpc config file | |
| CONFIG_DIR=/share/homes/admin/.config | |
| # confirm config dir exists | |
| mkdir -pv ${CONFIG_DIR} |
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 | |
| export PATH=${PATH}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:. | |
| # 函数定义 | |
| function info() { | |
| echo -e "\e[36m[信息]$*\e[0m" | |
| } | |
| function warn() { | |
| echo -e "\e[33m[警告]$*\e[0m" | |
| } | |
| function error() { |
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 -o errexit | |
| image=shadowsocksr | |
| # Create a container | |
| container=$(buildah from alpine) | |
| # Add maintainer label | |
| buildah config --label maintainer="Ryan Lieu <[email protected]>" | |
| # Install necessary packages | |
| buildah run ${container} apk --update add --no-cache su-exec libsodium py-pip |
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 | |
| # 来自《构建高可用Linux服务器(第4版)》 714/6522 | |
| # Nagios return codes | |
| STATE_OK=0 | |
| STATE_WARNING=1 | |
| STATE_CRITICAL=2 | |
| STATE_UNKNOWN=3 | |
| # Plugin parameters value if not define | |
| LIST_WARNING_THRESHOLD="70" | |
| LIST_CRITICAL_THRESHOLD="80" |
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
| #!/usr/bin/env python2 | |
| # -*- coding:utf-8 -*- | |
| import httplib, urllib | |
| import os, time, json | |
| domain_ids = dict() | |
| ddns_domain = "" | |
| ddns_subdomain = "" | |
| ddns_type="AAAA" # AAAA or A |
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
| [Unit] | |
| Description=SSH Tunnel(7070) | |
| [Service] | |
| ExecStart=/usr/bin/ssh -qTnN -D 7070 [email protected] | |
| Restart=on-abort | |
| [Install] | |
| WantedBy=multi-user.target |