🏠

晓东 - 模板

综合

整体

...
...
创作、办公、Web模板
Web模板测试服务器
java -m jdk.httpserver
访问 http://localhost:8000/Desktop/
CSS模板
@charset "UTF-8"; /* 大小写不敏感 */
h1::before {
  content: "@charset可解决content汉字乱码问题;加引号可换用open-quote";
}
h2{
  quotes:"user: \"" "\"" "'" "'";  /* 指定open-quote后,自定义(或转义)文本两边所添加的符号,后两个为嵌套内符号 */
}
h2::before{
  content:open-quote; /* 显示文本两边引号 */
}

HTML内容最简模板(省略body标签不利于SEO!):

HTML内容分区模板:

运维、编程

Gradle

Maven仓库配置
    repositories {
        mavenLocal() // 已内置;但断网时还需要显式声明在第一行。
        maven { // 公开访问
            url = uri("https://staticfiles.openle.com/.well-known/maven/our/maven-public-snapshot/")
            //url "https://asia-northeast1-maven.pkg.dev/project-000000/maven-public-snapshot/"
            // 若改为GAR插件识别的 artifactregistry://... 协议,可从GCE环境获取和配置Token
            content { includeGroup("com.openle.module") } // 可配多次 - includeGroup
        }
        maven { // 私有仓库
            url = uri("https://staticfiles.openle.com/.well-known/maven/our/maven-private-snapshot/")
            content { includeGroup("com.openle.our") }
            //  不写 authentication{} 则默认 BasicAuthentication;未响应401则应显式配置。
            authentication { create<BasicAuthentication>("basic") }
            name = "OurMavenRepo"
            //credentials { username = "user"; password = "pwd" }
            credentials(PasswordCredentials::class)
            /* Windows环境变量区分大小写:
                SETX ORG_GRADLE_PROJECT_OurMavenRepoUsername "user" /M
                SETX ORG_GRADLE_PROJECT_OurMavenRepoPassword "pwd" /M
                或 ./gradle -POurMavenRepoUsername=user -POurMavenRepoPassword=pwd
            */
        }
        //google() // 仅用于Android项目
        mavenCentral()
    }

    //  以下配置还未改为kts写法:
    apply plugin: "java" // gradle内置了该plugin,无需写入plugins块儿。
    apply plugin: "maven-publish" // 同上。
    publishing {
        repositories {
            maven { // 解决withJavadocJar()上传超时:systemProp.org.gradle.internal.http.socketTimeout=300000
                url "https://asia-northeast1-maven.pkg.dev/project-000000/maven-public-snapshot/"
                credentials { // 重点:若配置了credentials.username则可去掉插件,将协议改为“https://...”即可。
                    //  编码key.json内容为base64后username改用_json_key_base64
                    username = "_json_key"
                    password = file('../../../../docs/cloud/project-000000-8ad030ce3d3e.json').text
                }
                authentication { basic(BasicAuthentication) }
            }
        }
        publications { mainRelease(MavenPublication) { from(components.java) } }
    }
打开程序或命令行
注意 - NetBeans默认输出终端为cmd,若想回显powershell则要用/c启动。
tasks.register<Exec>("quarkusRunNew") {
    group="My" // environment=整体替换
    var username = providers.environmentVariable("ORG_GRADLE_PROJECT_OurMavenRepoUsername").getOrNull();
    var password = providers.environmentVariable("ORG_GRADLE_PROJECT_OurMavenRepoPassword").getOrNull();
    var tmpdir = providers.systemProperty("java.io.tmpdir").getOrNull(); // 避免回落到"C:\Windows\",以免类库无权写入。
    environment=mapOf("JAVA_HOME" to System.getenv("JAVA_HOME"),"tmp" to tmpdir,
      "SystemDrive" to System.getenv("SystemDrive"), // [可选]不写会在当前项目下生成 %SystemDrive% 目录
      "ORG_GRADLE_PROJECT_OurMavenRepoPassword" to password ,"ORG_GRADLE_PROJECT_OurMavenRepoUsername" to username)
    for (key in environment.keys) { println(key +" - "+environment[key]) }
    //commandLine("cmd","/c","start","powershell","-NoExit","-command","ls env:")
    commandLine("cmd","/c","start","powershell","-NoExit","-command","../gradlew -x check --info quarkusRun")
}
war打包时加入文件
tasks.war { webInf { from("src/main/resources/ibm-web-bnd.xml"); into("/WEB-INF/") } }

Shell

Shell备份Docker业务数据
  sudo rm /etc/systemd/system/our-back-up-db.service
  sudo vim.tiny /etc/systemd/system/our-back-up-db.service

        [Unit]
        Description=our-back-up-db
        [Service]
        Type=oneshot
        # 注意 - 大于符号 > 必须写在'单引号'内!或用x.sh脚本文件。
        ExecStartPre=/bin/sh -c '/usr/bin/docker exec our-mariadb sh -c \'exec mariadb-dump --databases oauth other -uroot -p"$MYSQL_ROOT_PASSWORD" --single-transaction\' | gzip > /tmp/our-back-up-db.sql.gz'
        # 注意 - $(date +%T)中%字符后的字母前必须用+加号隔开下。
        ExecStart=/bin/sh -c 'curl -X POST https://domain/back-up -F "file=@/tmp/our-back-up-db.sql.gz; type=application/gzip; filename=$(TZ='Asia/Shanghai' date +%+F_%+T).sql.gz" -F subDirName=databases'
        [Install]
        WantedBy=multi-user.target

  sudo systemctl daemon-reload

  [MariaDB启动较慢,无需开机启动,仅用timer调] sudo systemctl enable 【our-back-up-db.service】
  [执行备份测试下] sudo systemctl start our-back-up-db.service
  sudo systemctl status our-back-up-db.service


  sudo vim.tiny /etc/systemd/system/our-back-up-weekly.timer

        [Unit]
        Description=our-back-up-weekly
        [Timer]
        #OnCalendar=minutely
        OnCalendar=weekly
        Unit=our-back-up-db.service
        [Install]
        WantedBy=timers.target

  sudo systemctl start our-back-up-weekly.timer

  开机启动 sudo systemctl enable our-back-up-weekly.timer
  sudo systemctl status our-back-up-weekly.timer
  暂停  sudo systemctl stop our-back-up-weekly.timer
  永停  sudo systemctl disable our-back-up-weekly.timer
  列出  systemctl list-timers
                        
其他
...