Opengist Logo 清羽飞扬の代码片段

Explore

  • All gists
  • Topics
  • Users
个人主页 站长博客
Give feedback on the new UI Powered by Opengist ⋅ 56ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login Register
b

bash

Recently created Least recently created Recently updated Least recently updated
LiuShen

LiuShen / 通过HTTP同步时间

Last active 6 hours ago bash http

在123端口无法访问的情况下使用http来进行时间同步

0 0 1
1 #!/bin/bash
2
3 set -e
4
5 URL="http://www.baidu.com/"
6 COUNT=10
7
8 echo "正在通过百度 HTTP 校准系统时间..."
9 echo
LiuShen

LiuShen / 通过HTTP同步时间

Last active 6 hours ago bash ntp

在123端口无法使用的情况下通过http请求头携带的时间实现时间同步

0 0 1
1 #!/bin/bash
2
3 set -e
4
5 URL="http://www.baidu.com/"
6 COUNT=10
7
8 echo "正在通过百度 HTTP 校准系统时间..."
9 echo
LiuShen

LiuShen / Linux服务器添加SWAP虚拟内存

Last active 4 months ago bash linux ram swap

在Linux服务器添加SWAP虚拟内存,提高服务器使用率

0 0 1
1 #!/bin/bash
2
3 # ============================
4 # 创建一个 4GB 的 Swap 文件
5 # ============================
6
7 # 步骤 1:创建 4GB 的 Swap 文件
8 echo "步骤 1:创建 4GB 的 Swap 文件"
9
10 # 使用 fallocate 创建一个 4GB 的 swap 文件