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 | |
# Check whether the command line parameters are provided. | |
# If not, display the usage and exit | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 <process_name>" | |
exit 1 | |
fi | |
# Get the process name to find from the command line parameters |
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
import os | |
import time | |
import argparse | |
# Create a file | |
def create_local_file(file_number, local_directory, file_size_mb): | |
local_file_name = f'sample_file_{file_number}.txt' | |
local_file_path = os.path.join(local_directory, local_file_name) | |
with open(local_file_path, 'wb') as file: | |
file.write(os.urandom(file_size_mb * 1024 * 1024)) |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>滚动条</title> | |
<style> | |
#s1 { | |
overflow: hidden; |
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 | |
# Docker Volume: ghost_data | |
# MariaDB Container: mariadb | |
# 定义文件名变量 | |
data_filename="ghost_data-`date +%Y-%m-%d_%H%M%S`.tar.gz" | |
db_filename="ghost_db-`date +%Y-%m-%d_%H%M%S`.sql" | |
# 通过临时创建的中间容器挂载 volume 并压缩打包成带时间的 tar.gz 文件 | |
docker run --rm \ |
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
"gettext": { | |
"scope": "html", | |
"prefix": "_", | |
"body": "{{ _('$1') }}", | |
"description": "create a gettext code" | |
}, | |
"variable": { | |
"scope": "html", | |
"prefix": "jv", | |
"body": "{{ $1 }}", |
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/sh | |
FRPC=/usr/bin/frpc | |
CONFIG=/etc/frp/frpc.ini | |
LOG=/var/log/frp.log | |
USER=pi # change this with the actual user | |
exec chpst -u $USER $FRPC -c $CONFIG -L $LOG |
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
from datetime import datetime, timedelta, timezone | |
# 东8区时间 | |
time_utc_8 = datetime.now().astimezone(timezone(timedelta(hours=8))) | |
print(time_utc_8) | |
# 2018-02-02 10:56:10.496695+08:00 | |
# 格式化 | |
format = time_utc_8.strftime('%Y-%m-%d %H:%M:%S') |
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
Verifying my Blockstack ID is secured with the address 1NWuk5A3KPrSRYSs8ApqEEmjAA97uEfevJ https://explorer.blockstack.org/address/1NWuk5A3KPrSRYSs8ApqEEmjAA97uEfevJ |
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 | |
# install dependency packages | |
sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg2 \ | |
software-properties-common | |
# add gpg key |
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
# custom/Espo/Custom/Resources/metadata/entityDefs/Settings.json | |
{ | |
"fields": { | |
"currencyList": { | |
"options": ["__APPEND__","RMB"] | |
} | |
} | |
} |
NewerOlder