3篇 code related articles

Monitor a website with curl command

Hey there, tech enthusiasts! In this blog post, we'll embark on a journey to create a robust website monitoring system using the Bash shell. We'll dive into the intricacies of checking website availability, handling timeouts, and sending notifications via curl when things go awry.

  1. Laying the Foundation:

    Begin by opening your favorite terminal emulator and creating a new Bash script file. We'll call it "website_monitor.sh." This script will serve as the brain of our monitoring system.

More ~

android上浏览器中过滤广告

浏览器用google play下载三星Internet;

  1. 在三星浏览器里打开
    internet://debug/

  2. 右下角打开设置,点开最下面的“Debug settings”

  3. 点开“Feature variation test”

  4. 修改“Sales code”、“Country code”、“Country iso code”到你想要的区。以港区为例,分别在“Other”里填上“TGY”、“Hong Kong”、“HK”

  5. 重启浏览器

  6. 在浏览器右下脚中打开广告拦截器, 下载ABP : 到google play中下载三星浏览器专用ABP;

  7. 在ABP中更新广告筛选清单,可接受广告选 否,我想禁用可接受广告。完事。

More ~

golang random with range

package main

import (
    "fmt"
    "math/rand"
    "time"
)
        
func main() {
    rand.Seed(time.Now().UnixNano())
    min := 10
    max := 30
    fmt.Println(rand.Intn(max - min + 1) + min)
}

More ~