├── .gitattributes
├── .github
├── config.yml
├── template
│ ├── build.yml
│ ├── full.yml
│ ├── release-1.yml
│ └── release.yml
└── workflows
│ ├── daily.yml
│ └── test.yml
├── .gitignore
├── .gitmodules
├── .idea
├── .gitignore
├── Keeper.iml
├── inspectionProfiles
│ └── Project_Default.xml
├── misc.xml
├── modules.xml
└── vcs.xml
├── .vscode
└── settings.json
├── LICENSE
├── README.md
├── image
└── README
│ └── 1644490835674.png
├── package.json
├── poetry.lock
├── pyproject.toml
├── scripts
├── GitHub520
│ └── GitHub520.bat
├── Windows-administration
│ ├── add.reg
│ └── remove.reg
├── Windows-service-manager.bat
├── adjust_volume.sh
├── aria2.bat
├── backup.bat
├── booter.bat
├── convert-utils-win.sh
├── disk-sleep-guard.bat
├── docker
│ ├── docker-compose-test.yml
│ ├── docker-compose.yml
│ └── test
│ │ └── Dockerfile
├── hello.py
└── win-flush-icon-cache.bat
├── utils.bat
└── utils.sh
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.sh text eol=lf
2 | *.bat text eol=crlf
3 | *.cmd text eol=crlf
4 |
--------------------------------------------------------------------------------
/.github/config.yml:
--------------------------------------------------------------------------------
1 | # Configuration for welcome - https://github.com/behaviorbot/welcome
2 |
3 | # Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
4 |
5 | # Comment to be posted to on first time issues
6 | # newIssueWelcomeComment: >
7 | # Thanks for opening your first issue here! Be sure to follow the issue template!
8 |
9 | # Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
10 |
11 | # Comment to be posted to on PRs from first time contributors in your repository
12 | # newPRWelcomeComment: >
13 | # Thanks for opening this pull request! Please check out our contributing guidelines.
14 |
15 | # Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
16 |
17 | # Comment to be posted to on pull requests merged by a first time user
18 | # firstPRMergeComment: >
19 | # Congrats on merging your first pull request! We here at behaviorbot are proud of you!
20 |
21 | # It is recommended to include as many gifs and emojis as possible!
22 |
--------------------------------------------------------------------------------
/.github/template/build.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 |
3 |
4 | on:
5 | push:
6 | paths-ignore:
7 | - '**/*.md'
8 | pull_request:
9 | paths-ignore:
10 | - '**/*.md'
11 |
12 | jobs:
13 | build:
14 | name: "Build (${{ matrix.os }})"
15 | runs-on: ${{ matrix.os }}
16 | strategy:
17 | fail-fast: false
18 | matrix:
19 | os:
20 | - windows-2022
21 | - ubuntu-20.04
22 | - macos-12
23 | env:
24 | enableLocalPublishingTest: 'false'
25 | gradleArgs: --scan "-Dorg.gradle.jvmargs=-Xmx4096m" "-Dfile.encoding=UTF-8"
26 | isMac: ${{ startsWith(matrix.os, 'macos') }}
27 | isWindows: ${{ startsWith(matrix.os, 'windows') }}
28 | isUbuntu: ${{ startsWith(matrix.os, 'ubuntu') }}
29 | isUnix: ${{ startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') }}
30 | steps:
31 | - uses: actions/checkout@v2
32 | with:
33 | submodules: 'recursive'
34 |
35 | - uses: actions/setup-java@v2
36 | with:
37 | distribution: temurin
38 | java-version: 17
39 |
40 | - name: Setup Gradle
41 | uses: gradle/gradle-build-action@v2
42 |
43 | - name: Cache Konan
44 | uses: pat-s/always-upload-cache@v3
45 | with:
46 | path: ~/.konan
47 | key: ${{ runner.os }}-konan-${{ hashFiles('*.gradle.kts') }}
48 | restore-keys: |
49 | ${{ runner.os }}-konan-
50 |
51 | - name: Cache Gradle
52 | uses: pat-s/always-upload-cache@v3
53 | with:
54 | path: ~/.gradle
55 | key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
56 | restore-keys: |
57 | ${{ runner.os }}-gradle-
58 |
59 | - name: Cache Maven
60 | uses: pat-s/always-upload-cache@v3
61 | with:
62 | path: ~/.m2
63 | key: ${{ runner.os }}-maven-${{ hashFiles('*.gradle.kts') }}
64 | restore-keys: |
65 | ${{ runner.os }}-maven-
66 |
67 | - if: ${{ env.isUnix == 'true' }}
68 | run: chmod -R 777 *
69 |
70 | - name: Clean and download dependencies
71 | run: ./gradlew clean ${{ env.gradleArgs }}
72 |
73 |
74 | - if: ${{ env.isMac == 'true' }}
75 | name: Prepare signing key
76 | id: android_signing_key
77 | uses: timheuer/base64-to-file@v1.1
78 | with:
79 | fileName: 'android_signing_key'
80 | fileDir: './'
81 | encodedString: ${{ secrets.SIGNING_RELEASE_STOREFILE }}
82 |
83 | - if: ${{ env.isMac == 'true' }}
84 | name: Build Android APK
85 | run: ./gradlew assembleRelease ${{ env.gradleArgs }}
86 | env:
87 | "signing.release.storeFileFromRoot": ${{ steps.android_signing_key.outputs.filePath }}
88 | "signing.release.storePassword": ${{ secrets.SIGNING_RELEASE_STOREPASSWORD }}
89 | "signing.release.keyAlias": ${{ secrets.SIGNING_RELEASE_KEYALIAS }}
90 | "signing.release.keyPassword": ${{ secrets.SIGNING_RELEASE_KEYPASSWORD }}
91 |
92 | - if: ${{ env.isMac == 'true' }}
93 | name: Upload Android APK packages
94 | uses: actions/upload-artifact@v3
95 | with:
96 | name: animation-garden-android
97 | path: android/build/outputs/apk/release/animation-garden-android-release.apk
98 |
99 |
100 | - name: Assemble
101 | run: ./gradlew assemble ${{ env.gradleArgs }}
102 |
103 | - name: Check
104 | run: ./gradlew check ${{ env.gradleArgs }}
105 |
106 | - name: Package
107 | run: ./gradlew createDistributable package ${{ env.gradleArgs }}
108 | # continue-on-error: true
109 |
110 | # - if: ${{ env.isMac == 'true' }}
111 | # name: Upload error logs
112 | # uses: actions/upload-artifact@v3
113 | # with:
114 | # name: errors-${{ matrix.os }}
115 | # path: desktop/build/compose/logs/
116 | # continue-on-error: true
117 |
118 | - if: ${{ env.isMac == 'true' }}
119 | name: Upload macOS packages
120 | uses: actions/upload-artifact@v3
121 | with:
122 | name: animation-garden-desktop-macos
123 | path: desktop/build/compose/binaries/main/app
124 |
125 | - if: ${{ env.isMac == 'true' }}
126 | name: Upload macOS packages
127 | uses: actions/upload-artifact@v3
128 | with:
129 | name: animation-garden-desktop-macos-installer
130 | path: desktop/build/compose/binaries/main/dmg
131 |
132 | - if: ${{ env.isUbuntu == 'true' }}
133 | name: Upload Linux packages
134 | uses: actions/upload-artifact@v3
135 | with:
136 | name: animation-garden-desktop-linux
137 | path: desktop/build/compose/binaries/main/app
138 |
139 | - if: ${{ env.isUbuntu == 'true' }}
140 | name: Upload Linux packages
141 | uses: actions/upload-artifact@v3
142 | with:
143 | name: animation-garden-desktop-linux-installer
144 | path: desktop/build/compose/binaries/main/deb
145 |
146 | - if: ${{ env.isWindows == 'true' }}
147 | name: Upload Windows packages
148 | uses: actions/upload-artifact@v3
149 | with:
150 | name: animation-garden-desktop-windows
151 | path: desktop/build/compose/binaries/main/app
152 |
153 | - if: ${{ env.isWindows == 'true' }}
154 | name: Upload Windows packages
155 | uses: actions/upload-artifact@v3
156 | with:
157 | name: animation-garden-desktop-windows-installer
158 | path: desktop/build/compose/binaries/main/msi
159 |
--------------------------------------------------------------------------------
/.github/template/full.yml:
--------------------------------------------------------------------------------
1 | name: Plugin Build
2 |
3 | on:
4 | push:
5 | paths-ignore:
6 | - '**.md'
7 | branches:
8 | - master
9 | - main
10 | - ci-test
11 | tags:
12 | - '*'
13 | pull_request:
14 | paths-ignore:
15 | - '**.md'
16 | branches:
17 | - master
18 | - main
19 |
20 | env:
21 | PLUGIN_NAME: 'obs-auto-subtitle'
22 |
23 | jobs:
24 | clang_check:
25 | name: 01 - Code Format Check
26 | runs-on: ubuntu-22.04
27 | steps:
28 | - name: Checkout
29 | uses: actions/checkout@v3
30 | with:
31 | submodules: recursive
32 |
33 | - name: Install clang-format
34 | run: sudo apt-get install -y clang-format-13
35 |
36 | - name: Run clang-format
37 | run: ./.github/scripts/check-format.sh && ./.github/scripts/check-changes.sh
38 |
39 | - name: Install cmake-format
40 | run: sudo pip install cmakelang
41 |
42 | - name: Run cmake-format
43 | run: ./.github/scripts/check-cmake.sh
44 |
45 | macos_build:
46 | name: 02 - macOS
47 | runs-on: macos-12
48 | strategy:
49 | fail-fast: true
50 | matrix:
51 | arch: [x86_64, arm64, universal]
52 | if: always()
53 | needs: [clang_check]
54 | outputs:
55 | commitHash: ${{ steps.setup.outputs.commitHash }}
56 | env:
57 | CODESIGN_IDENT: '-'
58 | CODESIGN_IDENT_INSTALLER: ''
59 | MACOSX_DEPLOYMENT_TARGET: '10.15'
60 | defaults:
61 | run:
62 | shell: zsh {0}
63 | steps:
64 | - name: Checkout
65 | uses: actions/checkout@v3
66 | with:
67 | path: plugin
68 | submodules: recursive
69 |
70 | - name: Checkout obs-studio
71 | uses: actions/checkout@v3
72 | with:
73 | repository: 'obsproject/obs-studio'
74 | path: obs-studio
75 | fetch-depth: 0
76 | submodules: recursive
77 |
78 | - name: Setup Environment
79 | id: setup
80 | working-directory: ${{ github.workspace }}/plugin
81 | run: |
82 | ## SETUP ENVIRONMENT SCRIPT
83 | print '::group::Clean Homebrew Environment'
84 | typeset -a to_remove=()
85 |
86 | for formula (speexdsp curl php) {
87 | if [[ -d ${HOMEBREW_PREFIX}/opt/${formula} ]] to_remove+=(${formula})
88 | }
89 |
90 | if (( #to_remove > 0 )) brew uninstall --ignore-dependencies ${to_remove}
91 | print '::endgroup::'
92 |
93 | print '::group::Set up code signing'
94 | if [[ '${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }}' != '' && \
95 | '${{ secrets.MACOS_SIGNING_INSTALLER_IDENTITY }}' != '' && \
96 | '${{ secrets.MACOS_SIGNING_CERT }}' != '' ]] {
97 | print 'haveCodesignIdent=true' >> $GITHUB_OUTPUT
98 | } else {
99 | print 'haveCodesignIdent=false' >> $GITHUB_OUTPUT
100 | }
101 |
102 | if [[ '${{ secrets.MACOS_NOTARIZATION_USERNAME }}' != '' && \
103 | '${{ secrets.MACOS_NOTARIZATION_PASSWORD }}' != '' ]] {
104 | print 'haveNotarizationUser=true' >> $GITHUB_OUTPUT
105 | } else {
106 | print 'haveNotarizationUser=false' >> $GITHUB_OUTPUT
107 | }
108 | print '::endgroup::'
109 |
110 | print "ccacheDate=$(date +"%Y-%m-%d")" >> $GITHUB_OUTPUT
111 | print "commitHash=${"$(git rev-parse HEAD)"[0,9]}" >> $GITHUB_OUTPUT
112 |
113 | - name: Restore Compilation Cache
114 | id: ccache-cache
115 | uses: actions/cache@v3
116 | with:
117 | path: ${{ github.workspace }}/.ccache
118 | key: macos-${{ matrix.arch }}-ccache-plugin-${{ steps.setup.outputs.ccacheDate }}
119 | restore-keys: |
120 | macos-${{ matrix.arch }}-ccache-plugin-
121 |
122 | - name: Check for GitHub Labels
123 | id: seekingTesters
124 | if: ${{ github.event_name == 'pull_request' }}
125 | run: |
126 | if [[ -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')" ]] {
127 | print 'found=true' >> $GITHUB_OUTPUT
128 | } else {
129 | print 'found=false' >> $GITHUB_OUTPUT
130 | }
131 |
132 | - name: Install Apple Developer Certificate
133 | if: ${{ github.event_name != 'pull_request' && steps.setup.outputs.haveCodesignIdent == 'true' }}
134 | uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
135 | with:
136 | keychain-password: ${{ github.run_id }}
137 | p12-file-base64: ${{ secrets.MACOS_SIGNING_CERT }}
138 | p12-password: ${{ secrets.MACOS_SIGNING_CERT_PASSWORD }}
139 |
140 | - name: Set Signing Identity
141 | if: ${{ github.event_name != 'pull_request' && steps.setup.outputs.haveCodesignIdent == 'true' }}
142 | run: |
143 | print "CODESIGN_IDENT=${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }}" >> $GITHUB_ENV
144 | print "CODESIGN_IDENT_INSTALLER=${{ secrets.MACOS_SIGNING_INSTALLER_IDENTITY }}" >> $GITHUB_ENV
145 |
146 | - name: Build Plugin
147 | uses: ./plugin/.github/actions/build-plugin
148 | with:
149 | workingDirectory: ${{ github.workspace }}/plugin
150 | target: ${{ matrix.arch }}
151 | config: RelWithDebInfo
152 | codesign: 'true'
153 | codesignIdent: ${{ env.CODESIGN_IDENT }}
154 |
155 | - name: Package Plugin
156 | uses: ./plugin/.github/actions/package-plugin
157 | with:
158 | workingDirectory: ${{ github.workspace }}/plugin
159 | target: ${{ matrix.arch }}
160 | config: RelWithDebInfo
161 | codesign: ${{ github.event_name != 'pull_request' && steps.setup.outputs.haveCodesignIdent == 'true' }}
162 | notarize: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' && steps.setup.outputs.haveNotarizationUser == 'true' }}
163 | codesignIdent: ${{ env.CODESIGN_IDENT }}
164 | installerIdent: ${{ env.CODESIGN_IDENT_INSTALLER }}
165 | codesignUser: ${{ secrets.MACOS_NOTARIZATION_USERNAME }}
166 | codesignPass: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}
167 |
168 | - name: Upload Build Artifact
169 | if: ${{ success() && (github.event_name != 'pull_request' || steps.seekingTesters.outputs.found == 'true') }}
170 | uses: actions/upload-artifact@v3
171 | with:
172 | name: ${{ env.PLUGIN_NAME }}-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
173 | path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*-macos-${{ matrix.arch }}.pkg
174 |
175 | linux_build:
176 | name: 02 - Linux
177 | runs-on: ubuntu-22.04
178 | strategy:
179 | fail-fast: true
180 | matrix:
181 | arch: [x86_64]
182 | if: false
183 | needs: [clang_check]
184 | outputs:
185 | commitHash: ${{ steps.setup.outputs.commitHash }}
186 | defaults:
187 | run:
188 | shell: bash
189 | steps:
190 | - name: Checkout
191 | uses: actions/checkout@v3
192 | with:
193 | path: plugin
194 | submodules: recursive
195 |
196 | - name: Checkout obs-studio
197 | uses: actions/checkout@v3
198 | with:
199 | repository: 'obsproject/obs-studio'
200 | path: obs-studio
201 | fetch-depth: 0
202 | submodules: recursive
203 |
204 | - name: Setup Environment
205 | working-directory: ${{ github.workspace }}/plugin
206 | id: setup
207 | run: |
208 | ## SETUP ENVIRONMENT SCRIPT
209 | echo "ccacheDate=$(date +"%Y-%m-%d")" >> $GITHUB_OUTPUT
210 | echo "commitHash=$(git rev-parse HEAD | cut -c1-9)" >> $GITHUB_OUTPUT
211 |
212 | - name: Restore Compilation Cache
213 | id: ccache-cache
214 | uses: actions/cache@v3
215 | with:
216 | path: ${{ github.workspace }}/.ccache
217 | key: linux-${{ matrix.arch }}-ccache-plugin-${{ steps.setup.outputs.ccacheDate }}
218 | restore-keys: |
219 | linux-${{ matrix.arch }}-ccache-plugin-
220 |
221 | - name: Check for GitHub Labels
222 | id: seekingTesters
223 | if: ${{ github.event_name == 'pull_request' }}
224 | run: |
225 | ## GITHUB LABEL SCRIPT
226 | if [[ -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')" ]]; then
227 | echo 'found=true' >> $GITHUB_OUTPUT
228 | else
229 | echo 'found=false' >> $GITHUB_OUTPUT
230 | fi
231 |
232 | - name: Build Plugin
233 | uses: ./plugin/.github/actions/build-plugin
234 | with:
235 | workingDirectory: ${{ github.workspace }}/plugin
236 | target: ${{ matrix.arch }}
237 | config: RelWithDebInfo
238 |
239 | - name: Package Plugin
240 | uses: ./plugin/.github/actions/package-plugin
241 | with:
242 | workingDirectory: ${{ github.workspace }}/plugin
243 | target: ${{ matrix.arch }}
244 | config: RelWithDebInfo
245 |
246 | - name: Upload Build Artifact
247 | if: ${{ success() && (github.event_name != 'pull_request' || steps.seekingTesters.outputs.found == 'true') }}
248 | uses: actions/upload-artifact@v3
249 | with:
250 | name: ${{ env.PLUGIN_NAME }}-linux-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
251 | path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*-linux-${{ matrix.arch }}.*
252 |
253 | windows_build:
254 | name: 02 - Windows
255 | runs-on: windows-2022
256 | strategy:
257 | fail-fast: true
258 | matrix:
259 | arch: [x64]
260 | if: always()
261 | needs: [clang_check]
262 | outputs:
263 | commitHash: ${{ steps.setup.outputs.commitHash }}
264 | defaults:
265 | run:
266 | shell: pwsh
267 | steps:
268 | - name: Checkout
269 | uses: actions/checkout@v3
270 | with:
271 | path: plugin
272 | submodules: recursive
273 |
274 | - name: Checkout obs-studio
275 | uses: actions/checkout@v3
276 | with:
277 | repository: 'obsproject/obs-studio'
278 | path: obs-studio
279 | fetch-depth: 0
280 | submodules: recursive
281 |
282 | - name: Setup Environment
283 | working-directory: ${{ github.workspace }}/plugin
284 | id: setup
285 | run: |
286 | ## SETUP ENVIRONMENT SCRIPT
287 | $CommitHash = (git rev-parse HEAD)[0..8] -join ''
288 | "commitHash=${CommitHash}" >> $env:GITHUB_OUTPUT
289 |
290 | - name: Check for GitHub Labels
291 | id: seekingTesters
292 | working-directory: ${{ github.workspace }}/plugin
293 | if: ${{ github.event_name == 'pull_request' }}
294 | run: |
295 | ## GITHUB LABEL SCRIPT
296 | $LabelFound = try {
297 | $Params = @{
298 | Authentication = 'Bearer'
299 | Token = (ConvertTo-SecureString '${{ secrets.GITHUB_TOKEN }}' -AsPlainText)
300 | Uri = '${{ github.event.pull_request.url }}'
301 | UseBasicParsing = $true
302 | }
303 |
304 | (Invoke-RestMethod @Params).labels.name.contains('Seeking Testers')
305 | } catch {
306 | $false
307 | }
308 |
309 | "found=$(([string]${LabelFound}).ToLower())" >> $env:GITHUB_OUTPUT
310 |
311 | - name: Build Plugin
312 | uses: ./plugin/.github/actions/build-plugin
313 | with:
314 | workingDirectory: ${{ github.workspace }}/plugin
315 | target: ${{ matrix.arch }}
316 | config: RelWithDebInfo
317 | visualStudio: 'Visual Studio 17 2022'
318 |
319 | - name: Package Plugin
320 | uses: ./plugin/.github/actions/package-plugin
321 | with:
322 | workingDirectory: ${{ github.workspace }}/plugin
323 | target: ${{ matrix.arch }}
324 | config: RelWithDebInfo
325 |
326 | - name: Upload Build Artifact
327 | if: ${{ success() && (github.event_name != 'pull_request' || steps.seekingTesters.outputs.found == 'true') }}
328 | uses: actions/upload-artifact@v3
329 | with:
330 | name: ${{ env.PLUGIN_NAME }}-windows-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
331 | path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*.zip
332 |
333 | - name: Package Plugin Installer
334 | if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
335 | uses: ./plugin/.github/actions/package-plugin
336 | with:
337 | workingDirectory: ${{ github.workspace }}/plugin
338 | target: ${{ matrix.arch }}
339 | config: RelWithDebInfo
340 | createInstaller: true
341 |
342 | - name: Upload Installer Artifact
343 | if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
344 | uses: actions/upload-artifact@v3
345 | with:
346 | name: ${{ env.PLUGIN_NAME }}-windows-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}-installer
347 | path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*.exe
348 |
349 | make-release:
350 | name: 03 - Create and upload release
351 | runs-on: ubuntu-22.04
352 | if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
353 | needs: [macos_build, windows_build]
354 | defaults:
355 | run:
356 | shell: bash
357 | steps:
358 | - name: Get Metadata
359 | id: metadata
360 | run: |
361 | ## METADATA SCRIPT
362 | echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
363 |
364 | - name: Download build artifacts
365 | uses: actions/download-artifact@v3
366 |
367 | - name: Generate Checksums
368 | run: |
369 | ## CHECKSUM GENERATION SCRIPT
370 | shopt -s extglob
371 | echo "### Checksums" > ${{ github.workspace }}/CHECKSUMS.txt
372 | for file in ${{ github.workspace }}/**/@(*.pkg|*.exe|*.deb|*.zip); do
373 | echo " ${file##*/}: $(sha256sum "${file}" | cut -d " " -f 1)" >> ${{ github.workspace }}/CHECKSUMS.txt
374 | done
375 |
376 | - name: Create Release
377 | id: create_release
378 | uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
379 | with:
380 | draft: false
381 | prerelease: ${{ contains(steps.metadata.outputs.version, 'rc') || contains(steps.metadata.outputs.version, 'beta') }}
382 | tag_name: ${{ steps.metadata.outputs.version }}
383 | name: "${{ env.PLUGIN_NAME }} ${{ steps.metadata.outputs.version }}"
384 | body_path: ${{ github.workspace }}/CHECKSUMS.txt
385 | files: |
386 | ${{ github.workspace }}/**/*.zip
387 | ${{ github.workspace }}/**/*.exe
388 | ${{ github.workspace }}/**/*.deb
389 | ${{ github.workspace }}/**/*.pkg
390 |
--------------------------------------------------------------------------------
/.github/template/release-1.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 |
3 | on:
4 | push:
5 | tags:
6 | - v[0-9]+.[0-9]+.[0-9]+*
7 |
8 | jobs:
9 | release:
10 | name: Publish to Github Releases
11 | permissions:
12 | contents: write
13 | outputs:
14 | rc: ${{ steps.check-tag.outputs.rc }}
15 |
16 | strategy:
17 | matrix:
18 | include:
19 | - target: aarch64-unknown-linux-musl
20 | os: ubuntu-latest
21 | use-cross: true
22 | cargo-flags: ""
23 | - target: aarch64-apple-darwin
24 | os: macos-latest
25 | use-cross: true
26 | cargo-flags: ""
27 | - target: aarch64-pc-windows-msvc
28 | os: windows-latest
29 | use-cross: true
30 | cargo-flags: "--no-default-features"
31 | - target: x86_64-apple-darwin
32 | os: macos-latest
33 | cargo-flags: ""
34 | - target: x86_64-pc-windows-msvc
35 | os: windows-latest
36 | cargo-flags: ""
37 | - target: x86_64-unknown-linux-musl
38 | os: ubuntu-latest
39 | use-cross: true
40 | cargo-flags: ""
41 | - target: i686-unknown-linux-musl
42 | os: ubuntu-latest
43 | use-cross: true
44 | cargo-flags: ""
45 | - target: i686-pc-windows-msvc
46 | os: windows-latest
47 | use-cross: true
48 | cargo-flags: ""
49 | - target: armv7-unknown-linux-musleabihf
50 | os: ubuntu-latest
51 | use-cross: true
52 | cargo-flags: ""
53 | - target: arm-unknown-linux-musleabihf
54 | os: ubuntu-latest
55 | use-cross: true
56 | cargo-flags: ""
57 | - target: mips-unknown-linux-musl
58 | os: ubuntu-latest
59 | use-cross: true
60 | cargo-flags: "--no-default-features"
61 | - target: mipsel-unknown-linux-musl
62 | os: ubuntu-latest
63 | use-cross: true
64 | cargo-flags: "--no-default-features"
65 | - target: mips64-unknown-linux-gnuabi64
66 | os: ubuntu-latest
67 | use-cross: true
68 | cargo-flags: "--no-default-features"
69 | - target: mips64el-unknown-linux-gnuabi64
70 | os: ubuntu-latest
71 | use-cross: true
72 | cargo-flags: "--no-default-features"
73 | runs-on: ${{matrix.os}}
74 |
75 | steps:
76 | - uses: actions/checkout@v2
77 |
78 | - name: Check Tag
79 | id: check-tag
80 | shell: bash
81 | run: |
82 | tag=${GITHUB_REF##*/}
83 | echo "::set-output name=version::$tag"
84 | if [[ "$tag" =~ [0-9]+.[0-9]+.[0-9]+$ ]]; then
85 | echo "::set-output name=rc::false"
86 | else
87 | echo "::set-output name=rc::true"
88 | fi
89 |
90 |
91 | - name: Install Rust Toolchain Components
92 | uses: actions-rs/toolchain@v1
93 | with:
94 | override: true
95 | target: ${{ matrix.target }}
96 | toolchain: stable
97 | profile: minimal # minimal component installation (ie, no documentation)
98 |
99 | - name: Show Version Information (Rust, cargo, GCC)
100 | shell: bash
101 | run: |
102 | gcc --version || true
103 | rustup -V
104 | rustup toolchain list
105 | rustup default
106 | cargo -V
107 | rustc -V
108 |
109 | - name: Build
110 | uses: actions-rs/cargo@v1
111 | with:
112 | use-cross: ${{ matrix.use-cross }}
113 | command: build
114 | args: --locked --release --target=${{ matrix.target }} ${{ matrix.cargo-flags }}
115 |
116 | - name: Build Archive
117 | shell: bash
118 | id: package
119 | env:
120 | target: ${{ matrix.target }}
121 | version: ${{ steps.check-tag.outputs.version }}
122 | run: |
123 | set -euxo pipefail
124 |
125 | bin=${GITHUB_REPOSITORY##*/}
126 | src=`pwd`
127 | dist=$src/dist
128 | name=$bin-$version-$target
129 | executable=target/$target/release/$bin
130 |
131 | if [[ "$RUNNER_OS" == "Windows" ]]; then
132 | executable=$executable.exe
133 | fi
134 |
135 | mkdir $dist
136 | cp $executable $dist
137 | cd $dist
138 |
139 | if [[ "$RUNNER_OS" == "Windows" ]]; then
140 | archive=$dist/$name.zip
141 | 7z a $archive *
142 | echo "::set-output name=archive::`pwd -W`/$name.zip"
143 | else
144 | archive=$dist/$name.tar.gz
145 | tar czf $archive *
146 | echo "::set-output name=archive::$archive"
147 | fi
148 |
149 | - name: Publish Archive
150 | uses: softprops/action-gh-release@v0.1.5
151 | if: ${{ startsWith(github.ref, 'refs/tags/') }}
152 | with:
153 | draft: false
154 | files: ${{ steps.package.outputs.archive }}
155 | prerelease: ${{ steps.check-tag.outputs.rc == 'true' }}
156 | env:
157 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
158 |
159 | docker:
160 | name: Publish to Docker Hub
161 | if: startsWith(github.ref, 'refs/tags/')
162 | runs-on: ubuntu-latest
163 | needs: release
164 | steps:
165 | - name: Set up QEMU
166 | uses: docker/setup-qemu-action@v1
167 | - name: Set up Docker Buildx
168 | uses: docker/setup-buildx-action@v1
169 | - name: Login to DockerHub
170 | uses: docker/login-action@v1
171 | with:
172 | username: ${{ secrets.DOCKERHUB_USERNAME }}
173 | password: ${{ secrets.DOCKERHUB_TOKEN }}
174 | - name: Build and push
175 | uses: docker/build-push-action@v2
176 | with:
177 | build-args: |
178 | REPO=${{ github.repository }}
179 | VER=${{ github.ref_name }}
180 | platforms: |
181 | linux/amd64
182 | linux/arm64
183 | linux/386
184 | linux/arm/v7
185 | push: ${{ needs.release.outputs.rc == 'false' }}
186 | tags: ${{ github.repository }}:latest, ${{ github.repository }}:${{ github.ref_name }}
187 |
188 | publish-crate:
189 | name: Publish to crates.io
190 | if: ${{ needs.release.outputs.rc == 'false' }}
191 | runs-on: ubuntu-latest
192 | needs: release
193 | steps:
194 | - uses: actions/checkout@v2
195 | - uses: actions-rs/toolchain@v1
196 | with:
197 | profile: minimal
198 | toolchain: stable
199 | - name: Publish
200 |
201 | env:
202 | CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_API_TOKEN }}
203 | run: cargo publish
204 |
--------------------------------------------------------------------------------
/.github/template/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 |
3 | on:
4 | push:
5 | tags: [ 'v*' ]
6 |
7 | jobs:
8 | create-release:
9 | name: Create Release
10 | runs-on: ubuntu-22.04
11 | steps:
12 | - name: Get Tag # usage: ${{ steps.tag.outputs.tag }}
13 | id: tag
14 | uses: dawidd6/action-get-tag@v1
15 |
16 | - uses: bhowell2/github-substring-action@v1.0.0
17 | id: tag-version # usage: ${{ steps.tag-version.outputs.substring }}
18 | with:
19 | value: ${{ steps.tag.outputs.tag }}
20 | index_of_str: "v"
21 |
22 | - name: Create Release
23 | id: create_release
24 | uses: actions/create-release@v1
25 | env:
26 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 | with:
28 | tag_name: ${{ steps.tag.outputs.tag }}
29 | release_name: ${{ steps.tag-version.outputs.substring }}
30 | body: |
31 | Automatically created from tag ${{ steps.tag.outputs.tag }}. Do not change anything until assets are uploaded.
32 |
33 | ----
34 |
35 | 有关附件的说明,查看[下载](https://github.com/Him188/animation-garden-desktop#%E4%B8%8B%E8%BD%BD)。
36 | 可扫描以下二维码下载 Android 版本:
37 | 
38 |
39 | draft: true
40 | prerelease: false
41 | outputs:
42 | upload_url: ${{ steps.create_release.outputs.upload_url }}
43 |
44 | release:
45 | needs: [ create-release ]
46 | name: ${{ matrix.os }}
47 | runs-on: ${{ matrix.os }}
48 | strategy:
49 | fail-fast: false
50 | matrix:
51 | os:
52 | - windows-2022
53 | - ubuntu-20.04
54 | - macos-12
55 | env:
56 | enableLocalPublishingTest: 'false'
57 | gradleArgs: --scan "-Dorg.gradle.jvmargs=-Xmx4096m" "-Dfile.encoding=UTF-8"
58 | isMac: ${{ startsWith(matrix.os, 'macos') }}
59 | isWindows: ${{ startsWith(matrix.os, 'windows') }}
60 | isUbuntu: ${{ startsWith(matrix.os, 'ubuntu') }}
61 | isUnix: ${{ startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') }}
62 | steps:
63 | - uses: actions/checkout@v2
64 | with:
65 | submodules: 'recursive'
66 |
67 | - name: Get Tag # usage: ${{ steps.tag.outputs.tag }}
68 | id: tag
69 | uses: dawidd6/action-get-tag@v1
70 |
71 | - uses: bhowell2/github-substring-action@v1.0.0
72 | id: tag-version # usage: ${{ steps.tag-version.outputs.substring }}
73 | with:
74 | value: ${{ steps.tag.outputs.tag }}
75 | index_of_str: "v"
76 |
77 | - if: ${{ env.isUnix == 'true' }}
78 | uses: actions/setup-java@v2
79 | with:
80 | distribution: temurin
81 | java-version: 17
82 |
83 | - if: ${{ env.isWindows == 'true' }}
84 | uses: actions/setup-java@v2
85 | with:
86 | distribution: microsoft
87 | java-version: 17
88 |
89 | - name: Setup Gradle
90 | uses: gradle/gradle-build-action@v2
91 |
92 | - name: Cache Konan
93 | uses: pat-s/always-upload-cache@v3
94 | with:
95 | path: ~/.konan
96 | key: ${{ runner.os }}-konan-${{ hashFiles('*.gradle.kts') }}
97 | restore-keys: |
98 | ${{ runner.os }}-konan-
99 |
100 | - name: Cache Gradle
101 | uses: pat-s/always-upload-cache@v3
102 | with:
103 | path: ~/.gradle
104 | key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
105 | restore-keys: |
106 | ${{ runner.os }}-gradle-
107 |
108 | - name: Cache Maven
109 | uses: pat-s/always-upload-cache@v3
110 | with:
111 | path: ~/.m2
112 | key: ${{ runner.os }}-maven-${{ hashFiles('*.gradle.kts') }}
113 | restore-keys: |
114 | ${{ runner.os }}-maven-
115 |
116 | - if: ${{ env.isUnix == 'true' }}
117 | run: chmod -R 777 *
118 |
119 | - name: Clean and download dependencies
120 | run: ./gradlew clean ${{ env.gradleArgs }}
121 |
122 | - if: ${{ env.isMac == 'true' }}
123 | name: Prepare signing key
124 | id: android_signing_key
125 | uses: timheuer/base64-to-file@v1.1
126 | with:
127 | fileName: 'android_signing_key'
128 | fileDir: './'
129 | encodedString: ${{ secrets.SIGNING_RELEASE_STOREFILE }}
130 |
131 | - if: ${{ env.isMac == 'true' }}
132 | name: Build Android APK
133 | run: ./gradlew assembleRelease ${{ env.gradleArgs }}
134 | env:
135 | "signing.release.storeFileFromRoot": ${{ steps.android_signing_key.outputs.filePath }}
136 | "signing.release.storePassword": ${{ secrets.SIGNING_RELEASE_STOREPASSWORD }}
137 | "signing.release.keyAlias": ${{ secrets.SIGNING_RELEASE_KEYALIAS }}
138 | "signing.release.keyPassword": ${{ secrets.SIGNING_RELEASE_KEYPASSWORD }}
139 |
140 | - if: ${{ env.isMac == 'true' }}
141 | name: Upload Android APK
142 | uses: actions/upload-release-asset@v1
143 | id: upload_apk
144 | env:
145 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
146 | with:
147 | upload_url: ${{ needs.create-release.outputs.upload_url }}
148 | asset_path: android/build/outputs/apk/release/animation-garden-android-release.apk
149 | asset_name: AnimationGarden-${{ steps.tag-version.outputs.substring }}.apk
150 | asset_content_type: application/vnd.android.package-archive
151 |
152 | - if: ${{ env.isMac == 'true' }}
153 | name: Generate QR code for APK
154 | uses: snow-actions/qrcode@v1.0.0
155 | with:
156 | text: https://github.com/Him188/animation-garden-desktop/releases/download/${{ steps.tag.outputs.tag }}/AnimationGarden-${{ steps.tag-version.outputs.substring }}.apk
157 | path: apk-qrcode.png
158 |
159 | - if: ${{ env.isMac == 'true' }}
160 | name: Upload QR code
161 | id: upload_apk_qr
162 | uses: actions/upload-release-asset@v1
163 | env:
164 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
165 | with:
166 | upload_url: ${{ needs.create-release.outputs.upload_url }}
167 | asset_path: apk-qrcode.png
168 | asset_name: AnimationGarden-${{ steps.tag-version.outputs.substring }}.apk.qrcode.png
169 | asset_content_type: image/png
170 |
171 | - name: Assemble
172 | run: ./gradlew assemble ${{ env.gradleArgs }}
173 |
174 | - name: Check
175 | run: ./gradlew check ${{ env.gradleArgs }}
176 |
177 | - name: Package
178 | run: ./gradlew createDistributable package packageUberJarForCurrentOS ${{ env.gradleArgs }}
179 | # continue-on-error: true
180 |
181 | # - if: ${{ env.isMac == 'true' }}
182 | # name: Upload error logs
183 | # uses: actions/upload-artifact@v3
184 | # with:
185 | # name: errors-${{ matrix.os }}
186 | # path: desktop/build/compose/logs/
187 | # continue-on-error: true
188 |
189 | # - name: Generate Line Temp File
190 | # run: "cat CHANGELOG.md | grep -n '## \\\\' | cut -d: -f1 | head -n 2 >> line.tmp"
191 | #
192 | # - name: Generate Release Log
193 | # run: "cat CHANGELOG.md | head -n $((`tail -n 1 line.tmp`-1)) | tail -n +`head -n 1 line.tmp` >> release.log"
194 |
195 | # Upload assets for release
196 |
197 | - if: ${{ env.isUnix == 'true' }}
198 | name: Zip distribution
199 | run: zip -q -r desktop.zip desktop/build/compose/binaries/main/app
200 |
201 | # macOS
202 |
203 | - if: ${{ env.isMac == 'true' }}
204 | name: Upload installer for macOS
205 | uses: actions/upload-release-asset@v1
206 | env:
207 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
208 | with:
209 | upload_url: ${{ needs.create-release.outputs.upload_url }}
210 | asset_path: desktop/build/compose/binaries/main/dmg/AnimationGarden-${{ steps.tag-version.outputs.substring }}.dmg
211 | asset_name: AnimationGarden-${{ steps.tag-version.outputs.substring }}-macos-amd64.dmg
212 | asset_content_type: application/octet-stream
213 |
214 | - if: ${{ env.isMac == 'true' }}
215 | name: Upload distribution archive for macOS
216 | uses: actions/upload-release-asset@v1
217 | env:
218 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
219 | with:
220 | upload_url: ${{ needs.create-release.outputs.upload_url }}
221 | asset_path: desktop.zip
222 | asset_name: AnimationGarden-${{ steps.tag-version.outputs.substring }}-macos-amd64.zip
223 | asset_content_type: application/zip
224 |
225 | - if: ${{ env.isMac == 'true' }}
226 | name: Upload JAR for macOS
227 | uses: actions/upload-release-asset@v1
228 | env:
229 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
230 | with:
231 | upload_url: ${{ needs.create-release.outputs.upload_url }}
232 | asset_path: desktop/build/compose/jars/AnimationGarden-macos-x64-${{ steps.tag-version.outputs.substring }}.jar
233 | asset_name: AnimationGarden-${{ steps.tag-version.outputs.substring }}-macos-amd64.jar
234 | asset_content_type: application/octet-stream
235 |
236 | # Windows
237 |
238 | - if: ${{ env.isWindows == 'true' }}
239 | shell: powershell
240 | run: Compress-Archive desktop/build/compose/binaries/main/app/ desktop.zip
241 |
242 | - if: ${{ env.isWindows == 'true' }}
243 | name: Upload installer for Windows
244 | uses: actions/upload-release-asset@v1
245 | env:
246 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
247 | with:
248 | upload_url: ${{ needs.create-release.outputs.upload_url }}
249 | asset_path: desktop/build/compose/binaries/main/msi/AnimationGarden-${{ steps.tag-version.outputs.substring }}.msi
250 | asset_name: AnimationGarden-${{ steps.tag-version.outputs.substring }}-windows-amd64.msi
251 | asset_content_type: application/octet-stream
252 |
253 | - if: ${{ env.isWindows == 'true' }}
254 | name: Upload distribution archive for Windows
255 | uses: actions/upload-release-asset@v1
256 | env:
257 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
258 | with:
259 | upload_url: ${{ needs.create-release.outputs.upload_url }}
260 | asset_path: desktop.zip
261 | asset_name: AnimationGarden-${{ steps.tag-version.outputs.substring }}-windows-amd64.zip
262 | asset_content_type: application/zip
263 |
264 | - if: ${{ env.isWindows == 'true' }}
265 | name: Upload JAR for Windows
266 | uses: actions/upload-release-asset@v1
267 | env:
268 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
269 | with:
270 | upload_url: ${{ needs.create-release.outputs.upload_url }}
271 | asset_path: desktop/build/compose/jars/AnimationGarden-windows-x64-${{ steps.tag-version.outputs.substring }}.jar
272 | asset_name: AnimationGarden-${{ steps.tag-version.outputs.substring }}-windows-amd64.jar
273 | asset_content_type: application/octet-stream
274 |
275 | # Linux
276 |
277 | - if: ${{ env.isUbuntu == 'true' }}
278 | name: Upload installer for Debian
279 | uses: actions/upload-release-asset@v1
280 | env:
281 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
282 | with:
283 | upload_url: ${{ needs.create-release.outputs.upload_url }}
284 | asset_path: desktop/build/compose/binaries/main/deb/animationgarden_${{ steps.tag-version.outputs.substring }}-1_amd64.deb
285 | asset_name: AnimationGarden-${{ steps.tag-version.outputs.substring }}-debian-amd64.deb
286 | asset_content_type: application/octet-stream
287 |
288 | - if: ${{ env.isUbuntu == 'true' }}
289 | name: Upload distribution archive for Debian
290 | uses: actions/upload-release-asset@v1
291 | env:
292 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
293 | with:
294 | upload_url: ${{ needs.create-release.outputs.upload_url }}
295 | asset_path: desktop.zip
296 | asset_name: AnimationGarden-${{ steps.tag-version.outputs.substring }}-debian-amd64.zip
297 | asset_content_type: application/zip
298 |
299 | - if: ${{ env.isUbuntu == 'true' }}
300 | name: Upload JAR for Debian
301 | uses: actions/upload-release-asset@v1
302 | env:
303 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
304 | with:
305 | upload_url: ${{ needs.create-release.outputs.upload_url }}
306 | asset_path: desktop/build/compose/jars/AnimationGarden-linux-x64-${{ steps.tag-version.outputs.substring }}.jar
307 | asset_name: AnimationGarden-${{ steps.tag-version.outputs.substring }}-debian-amd64.jar
308 | asset_content_type: application/octet-stream
309 | outputs:
310 | apk_qr_url: ${{ steps.upload_apk_qr.outputs.browser_download_url }}
311 |
312 | # apk-qrcode:
313 | # needs: [ release ]
314 | # runs-on: ubuntu-22.04
315 | # steps:
316 | # - id: update_release
317 | # uses: tubone24/update_release@v1.0
318 | # env:
319 | # GITHUB_TOKEN: ${{ github.token }}
320 | # with:
321 | # body: \n\n
322 |
323 | # steps:
324 | # - name: Checkout
325 | # uses: actions/checkout@v2
326 | #
327 | # - name: Set up JDK 11
328 | # uses: actions/setup-java@v1
329 | # with:
330 | # java-version: 11
331 | #
332 | # - name: Grant Execute Permission for gradlew
333 | # run: chmod +x gradlew
334 | #
335 | # - run: ./gradlew mirai-api-http:checkMavenCentralPublication --info --scan
336 | # env:
337 | # PUBLICATION_CREDENTIALS: ${{ secrets.PUBLICATION_CREDENTIALS }}
338 | #
339 | # - name: Build with Gradle
340 | # run: ./gradlew buildCiJar
341 | #
342 | # - name: Get Tag
343 | # id: tag
344 | # uses: dawidd6/action-get-tag@v1
345 | #
346 | # - name: Generate Line Temp File
347 | # run: "cat CHANGELOG.md | grep -n '## \\\\' | cut -d: -f1 | head -n 2 >> line.tmp"
348 | #
349 | # - name: Generate Release Log
350 | # run: "cat CHANGELOG.md | head -n $((`tail -n 1 line.tmp`-1)) | tail -n +`head -n 1 line.tmp` >> release.log"
351 | #
352 | # - name: Create Release
353 | # id: create_release
354 | # uses: actions/create-release@v1
355 | # env:
356 | # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
357 | # with:
358 | # tag_name: ${{ github.ref }}
359 | # release_name: mirai-api-http-${{ steps.tag.outputs.tag }}
360 | # body_path: release.log
361 | # draft: false
362 | # prerelease: false
363 |
--------------------------------------------------------------------------------
/.github/workflows/daily.yml:
--------------------------------------------------------------------------------
1 | name: DailyTask
2 |
3 | on:
4 | # push:
5 | # branches:
6 | # - main
7 | # 东八区每天八点多运行
8 | schedule:
9 | - cron: "0 0 * * *"
10 |
11 | # 标星时运行
12 | # watch:
13 | # types: [started]
14 |
15 | workflow_dispatch:
16 | inputs:
17 | debug_enabled:
18 | type: boolean
19 | description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
20 | required: false
21 | default: false
22 |
23 | jobs:
24 | autogreen:
25 | runs-on: ubuntu-latest
26 | steps:
27 | - name: Clone repository
28 | uses: actions/checkout@v2
29 | with:
30 | # 这里必须是0, gitee 不允许 shallow push
31 | fetch-depth: 0
32 | ref: tasks
33 | persist-credentials: false
34 |
35 | - name: Setup PHP Action
36 | uses: shivammathur/setup-php@2.9.0
37 |
38 | - name: My-Tasks
39 | run: |
40 | # 设置Git
41 | if [ 'a${{ secrets.PUSH_EMAIL }}' != 'a' ]; then
42 | git config --local user.name ${{ github.actor }}
43 | git config --local user.email ${{ secrets.PUSH_EMAIL }}
44 | else
45 | git config --local user.name "github-actions[bot]"
46 | git config --local user.email "github-actions[bot]@users.noreply.github.com"
47 | fi
48 | git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
49 |
50 | # https://github.com/mouday/wallpaper-database
51 | # 获取必应壁纸
52 | cd ./Bing && php index.php && cd ..
53 |
54 | # 记录log
55 | date +"%Y-%m-%d %H:%M:%S.%N" >> Tasks.log
56 |
57 | # 推送
58 | git add .
59 | git commit -am "A commit a day keeps girlfriend away."
60 | git push origin tasks
61 |
62 | # gitee-ssh
63 | if [ 'a${{ secrets.GITEE_RSA }}' != 'a' ]; then
64 | mkdir ~/.ssh
65 | echo 'StrictHostKeyChecking no
66 | # gitee
67 | Host gitee.com
68 | HostName gitee.com
69 | PreferredAuthentications publickey
70 | IdentityFile ~/.ssh/Gitee_rsa' > ~/.ssh/config
71 |
72 | echo '${{ secrets.GITEE_RSA }}' > ~/.ssh/Gitee_rsa
73 | chmod 600 ~/.ssh/*
74 | ssh -T git@gitee.com
75 | git remote add Gitee git@gitee.com:${{ github.repository }}.git
76 | git push Gitee tasks -f
77 | fi
78 |
79 | wakabox:
80 | name: Update-wakabox-gist
81 | runs-on: ubuntu-latest
82 | env:
83 | WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
84 | GH_TOKEN: ${{ secrets.GH_TOKEN }}
85 | GIST_ID: 4f05baa3e214af5fb92660d3cb44c238
86 | GIST_BARSTYLE: SOLIDLT
87 | GIST_BARLENGTH: -1
88 | GIST_TIMESTYLE: SHORT
89 |
90 | steps:
91 | - name: Set up Go
92 | uses: actions/setup-go@v2
93 | with:
94 | go-version: ^1.18
95 | id: go
96 |
97 | - name: Clone repository
98 | uses: actions/checkout@v3
99 | with:
100 | repository: 'XiaoMiku01/waka-box-go'
101 | # 设置 path 的话, checkout 之后需要 cd 切进去
102 | # path: 'waka-box-go'
103 |
104 | - name: Update-gist
105 | run: go run ./cmd/box/main.go
106 |
107 | wakeup-and-checkssl:
108 | runs-on: ubuntu-latest
109 | steps:
110 | - name: Checkout
111 | uses: actions/checkout@v2
112 | with:
113 | ref: gh-pages
114 |
115 | - name: wakeup & Build
116 | run: |
117 | curl ${{ secrets.URL }}
118 |
119 | chmod +x checker.sh
120 | ./checker.sh ${{ secrets.URL }}
121 |
122 | - name: Deploy
123 | uses: peaceiris/actions-gh-pages@v3
124 | with:
125 | github_token: ${{ secrets.GITHUB_TOKEN }}
126 | # external_repository: username/external-repository
127 | # publish_branch: your-branch # default: gh-pages
128 | publish_dir: .
129 | # 如果不设置下面, 会以用户名义提交, 与上面的Auto-green重复
130 | user_name: 'github-actions[bot]'
131 | user_email: 'github-actions[bot]@users.noreply.github.com'
132 |
133 | mirror:
134 | runs-on: ubuntu-latest
135 | steps:
136 | - name: Mirror Weidows-projects
137 | uses: Yikun/hub-mirror-action@master
138 | with:
139 | src: github/Weidows-projects
140 | dst: gitee/weidows-projects
141 | dst_key: ${{ secrets.GITEE_RSA }}
142 | dst_token: ${{ secrets.GITEE_TOKEN }}
143 | account_type: org
144 | force_update: true
145 | # white_list:
146 | black_list: '.github'
147 | # static_list:
148 |
149 | - name: Mirror Hebau-Community
150 | uses: Yikun/hub-mirror-action@master
151 | with:
152 | src: github/Hebau-Community
153 | dst: gitee/Hebau-Community
154 | dst_key: ${{ secrets.GITEE_RSA }}
155 | dst_token: ${{ secrets.GITEE_TOKEN }}
156 | account_type: org
157 | force_update: true
158 | # white_list:
159 | black_list: '.github'
160 | # static_list:
161 |
162 | # - name: Mirror personal
163 | # uses: Yikun/hub-mirror-action@master
164 | # with:
165 | # src: github/Weidows
166 | # dst: gitee/Weidows
167 | # dst_key: ${{ secrets.GITEE_RSA }}
168 | # dst_token: ${{ secrets.GITEE_TOKEN }}
169 | # white_list: ""
170 | # black_list:
171 | # static_list:
172 | # force_update: true
173 |
174 | # https://github.com/mxschmitt/action-tmate
175 | ssh-debug:
176 | runs-on: ubuntu-latest
177 | steps:
178 | # Enable tmate debugging of manually-triggered workflows if the input option was provided
179 | - name: Setup tmate session
180 | uses: mxschmitt/action-tmate@v3
181 | if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
182 | timeout-minutes: 15
183 | with:
184 | limit-access-to-actor: true
185 |
--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | name: Test
2 |
3 | on:
4 | watch:
5 | types: [started]
6 |
7 | jobs:
8 | test-1:
9 | name: test-1
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - name: Debugging with ssh
14 | uses: lhotari/action-upterm@v1
15 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | scripts/GitHub520/*.exe
2 | scripts/docker/data
3 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "Programming-Configuration"]
2 | path = Programming-Configuration
3 | url = https://github.com/Weidows-projects/Programming-Configuration.git
4 | [submodule "scripts/bitwarden-ssh-agent"]
5 | path = scripts/bitwarden-ssh-agent
6 | url = https://github.com/joaojacome/bitwarden-ssh-agent
7 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # 默认忽略的文件
2 | /shelf/
3 | /workspace.xml
4 | # 基于编辑器的 HTTP 客户端请求
5 | /httpRequests/
6 | # Datasource local storage ignored files
7 | /dataSources/
8 | /dataSources.local.xml
9 |
--------------------------------------------------------------------------------
/.idea/Keeper.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "workbench.colorCustomizations": {
3 | "activityBar.activeBorder": "#422c74"
4 | },
5 | "editor.suggest.snippetsPreventQuickSuggestions": false,
6 | "aiXcoder.showTrayIcon": true
7 | }
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Mozilla Public License Version 2.0
2 | ==================================
3 |
4 | 1. Definitions
5 | --------------
6 |
7 | 1.1. "Contributor"
8 | means each individual or legal entity that creates, contributes to
9 | the creation of, or owns Covered Software.
10 |
11 | 1.2. "Contributor Version"
12 | means the combination of the Contributions of others (if any) used
13 | by a Contributor and that particular Contributor's Contribution.
14 |
15 | 1.3. "Contribution"
16 | means Covered Software of a particular Contributor.
17 |
18 | 1.4. "Covered Software"
19 | means Source Code Form to which the initial Contributor has attached
20 | the notice in Exhibit A, the Executable Form of such Source Code
21 | Form, and Modifications of such Source Code Form, in each case
22 | including portions thereof.
23 |
24 | 1.5. "Incompatible With Secondary Licenses"
25 | means
26 |
27 | (a) that the initial Contributor has attached the notice described
28 | in Exhibit B to the Covered Software; or
29 |
30 | (b) that the Covered Software was made available under the terms of
31 | version 1.1 or earlier of the License, but not also under the
32 | terms of a Secondary License.
33 |
34 | 1.6. "Executable Form"
35 | means any form of the work other than Source Code Form.
36 |
37 | 1.7. "Larger Work"
38 | means a work that combines Covered Software with other material, in
39 | a separate file or files, that is not Covered Software.
40 |
41 | 1.8. "License"
42 | means this document.
43 |
44 | 1.9. "Licensable"
45 | means having the right to grant, to the maximum extent possible,
46 | whether at the time of the initial grant or subsequently, any and
47 | all of the rights conveyed by this License.
48 |
49 | 1.10. "Modifications"
50 | means any of the following:
51 |
52 | (a) any file in Source Code Form that results from an addition to,
53 | deletion from, or modification of the contents of Covered
54 | Software; or
55 |
56 | (b) any new file in Source Code Form that contains any Covered
57 | Software.
58 |
59 | 1.11. "Patent Claims" of a Contributor
60 | means any patent claim(s), including without limitation, method,
61 | process, and apparatus claims, in any patent Licensable by such
62 | Contributor that would be infringed, but for the grant of the
63 | License, by the making, using, selling, offering for sale, having
64 | made, import, or transfer of either its Contributions or its
65 | Contributor Version.
66 |
67 | 1.12. "Secondary License"
68 | means either the GNU General Public License, Version 2.0, the GNU
69 | Lesser General Public License, Version 2.1, the GNU Affero General
70 | Public License, Version 3.0, or any later versions of those
71 | licenses.
72 |
73 | 1.13. "Source Code Form"
74 | means the form of the work preferred for making modifications.
75 |
76 | 1.14. "You" (or "Your")
77 | means an individual or a legal entity exercising rights under this
78 | License. For legal entities, "You" includes any entity that
79 | controls, is controlled by, or is under common control with You. For
80 | purposes of this definition, "control" means (a) the power, direct
81 | or indirect, to cause the direction or management of such entity,
82 | whether by contract or otherwise, or (b) ownership of more than
83 | fifty percent (50%) of the outstanding shares or beneficial
84 | ownership of such entity.
85 |
86 | 2. License Grants and Conditions
87 | --------------------------------
88 |
89 | 2.1. Grants
90 |
91 | Each Contributor hereby grants You a world-wide, royalty-free,
92 | non-exclusive license:
93 |
94 | (a) under intellectual property rights (other than patent or trademark)
95 | Licensable by such Contributor to use, reproduce, make available,
96 | modify, display, perform, distribute, and otherwise exploit its
97 | Contributions, either on an unmodified basis, with Modifications, or
98 | as part of a Larger Work; and
99 |
100 | (b) under Patent Claims of such Contributor to make, use, sell, offer
101 | for sale, have made, import, and otherwise transfer either its
102 | Contributions or its Contributor Version.
103 |
104 | 2.2. Effective Date
105 |
106 | The licenses granted in Section 2.1 with respect to any Contribution
107 | become effective for each Contribution on the date the Contributor first
108 | distributes such Contribution.
109 |
110 | 2.3. Limitations on Grant Scope
111 |
112 | The licenses granted in this Section 2 are the only rights granted under
113 | this License. No additional rights or licenses will be implied from the
114 | distribution or licensing of Covered Software under this License.
115 | Notwithstanding Section 2.1(b) above, no patent license is granted by a
116 | Contributor:
117 |
118 | (a) for any code that a Contributor has removed from Covered Software;
119 | or
120 |
121 | (b) for infringements caused by: (i) Your and any other third party's
122 | modifications of Covered Software, or (ii) the combination of its
123 | Contributions with other software (except as part of its Contributor
124 | Version); or
125 |
126 | (c) under Patent Claims infringed by Covered Software in the absence of
127 | its Contributions.
128 |
129 | This License does not grant any rights in the trademarks, service marks,
130 | or logos of any Contributor (except as may be necessary to comply with
131 | the notice requirements in Section 3.4).
132 |
133 | 2.4. Subsequent Licenses
134 |
135 | No Contributor makes additional grants as a result of Your choice to
136 | distribute the Covered Software under a subsequent version of this
137 | License (see Section 10.2) or under the terms of a Secondary License (if
138 | permitted under the terms of Section 3.3).
139 |
140 | 2.5. Representation
141 |
142 | Each Contributor represents that the Contributor believes its
143 | Contributions are its original creation(s) or it has sufficient rights
144 | to grant the rights to its Contributions conveyed by this License.
145 |
146 | 2.6. Fair Use
147 |
148 | This License is not intended to limit any rights You have under
149 | applicable copyright doctrines of fair use, fair dealing, or other
150 | equivalents.
151 |
152 | 2.7. Conditions
153 |
154 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155 | in Section 2.1.
156 |
157 | 3. Responsibilities
158 | -------------------
159 |
160 | 3.1. Distribution of Source Form
161 |
162 | All distribution of Covered Software in Source Code Form, including any
163 | Modifications that You create or to which You contribute, must be under
164 | the terms of this License. You must inform recipients that the Source
165 | Code Form of the Covered Software is governed by the terms of this
166 | License, and how they can obtain a copy of this License. You may not
167 | attempt to alter or restrict the recipients' rights in the Source Code
168 | Form.
169 |
170 | 3.2. Distribution of Executable Form
171 |
172 | If You distribute Covered Software in Executable Form then:
173 |
174 | (a) such Covered Software must also be made available in Source Code
175 | Form, as described in Section 3.1, and You must inform recipients of
176 | the Executable Form how they can obtain a copy of such Source Code
177 | Form by reasonable means in a timely manner, at a charge no more
178 | than the cost of distribution to the recipient; and
179 |
180 | (b) You may distribute such Executable Form under the terms of this
181 | License, or sublicense it under different terms, provided that the
182 | license for the Executable Form does not attempt to limit or alter
183 | the recipients' rights in the Source Code Form under this License.
184 |
185 | 3.3. Distribution of a Larger Work
186 |
187 | You may create and distribute a Larger Work under terms of Your choice,
188 | provided that You also comply with the requirements of this License for
189 | the Covered Software. If the Larger Work is a combination of Covered
190 | Software with a work governed by one or more Secondary Licenses, and the
191 | Covered Software is not Incompatible With Secondary Licenses, this
192 | License permits You to additionally distribute such Covered Software
193 | under the terms of such Secondary License(s), so that the recipient of
194 | the Larger Work may, at their option, further distribute the Covered
195 | Software under the terms of either this License or such Secondary
196 | License(s).
197 |
198 | 3.4. Notices
199 |
200 | You may not remove or alter the substance of any license notices
201 | (including copyright notices, patent notices, disclaimers of warranty,
202 | or limitations of liability) contained within the Source Code Form of
203 | the Covered Software, except that You may alter any license notices to
204 | the extent required to remedy known factual inaccuracies.
205 |
206 | 3.5. Application of Additional Terms
207 |
208 | You may choose to offer, and to charge a fee for, warranty, support,
209 | indemnity or liability obligations to one or more recipients of Covered
210 | Software. However, You may do so only on Your own behalf, and not on
211 | behalf of any Contributor. You must make it absolutely clear that any
212 | such warranty, support, indemnity, or liability obligation is offered by
213 | You alone, and You hereby agree to indemnify every Contributor for any
214 | liability incurred by such Contributor as a result of warranty, support,
215 | indemnity or liability terms You offer. You may include additional
216 | disclaimers of warranty and limitations of liability specific to any
217 | jurisdiction.
218 |
219 | 4. Inability to Comply Due to Statute or Regulation
220 | ---------------------------------------------------
221 |
222 | If it is impossible for You to comply with any of the terms of this
223 | License with respect to some or all of the Covered Software due to
224 | statute, judicial order, or regulation then You must: (a) comply with
225 | the terms of this License to the maximum extent possible; and (b)
226 | describe the limitations and the code they affect. Such description must
227 | be placed in a text file included with all distributions of the Covered
228 | Software under this License. Except to the extent prohibited by statute
229 | or regulation, such description must be sufficiently detailed for a
230 | recipient of ordinary skill to be able to understand it.
231 |
232 | 5. Termination
233 | --------------
234 |
235 | 5.1. The rights granted under this License will terminate automatically
236 | if You fail to comply with any of its terms. However, if You become
237 | compliant, then the rights granted under this License from a particular
238 | Contributor are reinstated (a) provisionally, unless and until such
239 | Contributor explicitly and finally terminates Your grants, and (b) on an
240 | ongoing basis, if such Contributor fails to notify You of the
241 | non-compliance by some reasonable means prior to 60 days after You have
242 | come back into compliance. Moreover, Your grants from a particular
243 | Contributor are reinstated on an ongoing basis if such Contributor
244 | notifies You of the non-compliance by some reasonable means, this is the
245 | first time You have received notice of non-compliance with this License
246 | from such Contributor, and You become compliant prior to 30 days after
247 | Your receipt of the notice.
248 |
249 | 5.2. If You initiate litigation against any entity by asserting a patent
250 | infringement claim (excluding declaratory judgment actions,
251 | counter-claims, and cross-claims) alleging that a Contributor Version
252 | directly or indirectly infringes any patent, then the rights granted to
253 | You by any and all Contributors for the Covered Software under Section
254 | 2.1 of this License shall terminate.
255 |
256 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
257 | end user license agreements (excluding distributors and resellers) which
258 | have been validly granted by You or Your distributors under this License
259 | prior to termination shall survive termination.
260 |
261 | ************************************************************************
262 | * *
263 | * 6. Disclaimer of Warranty *
264 | * ------------------------- *
265 | * *
266 | * Covered Software is provided under this License on an "as is" *
267 | * basis, without warranty of any kind, either expressed, implied, or *
268 | * statutory, including, without limitation, warranties that the *
269 | * Covered Software is free of defects, merchantable, fit for a *
270 | * particular purpose or non-infringing. The entire risk as to the *
271 | * quality and performance of the Covered Software is with You. *
272 | * Should any Covered Software prove defective in any respect, You *
273 | * (not any Contributor) assume the cost of any necessary servicing, *
274 | * repair, or correction. This disclaimer of warranty constitutes an *
275 | * essential part of this License. No use of any Covered Software is *
276 | * authorized under this License except under this disclaimer. *
277 | * *
278 | ************************************************************************
279 |
280 | ************************************************************************
281 | * *
282 | * 7. Limitation of Liability *
283 | * -------------------------- *
284 | * *
285 | * Under no circumstances and under no legal theory, whether tort *
286 | * (including negligence), contract, or otherwise, shall any *
287 | * Contributor, or anyone who distributes Covered Software as *
288 | * permitted above, be liable to You for any direct, indirect, *
289 | * special, incidental, or consequential damages of any character *
290 | * including, without limitation, damages for lost profits, loss of *
291 | * goodwill, work stoppage, computer failure or malfunction, or any *
292 | * and all other commercial damages or losses, even if such party *
293 | * shall have been informed of the possibility of such damages. This *
294 | * limitation of liability shall not apply to liability for death or *
295 | * personal injury resulting from such party's negligence to the *
296 | * extent applicable law prohibits such limitation. Some *
297 | * jurisdictions do not allow the exclusion or limitation of *
298 | * incidental or consequential damages, so this exclusion and *
299 | * limitation may not apply to You. *
300 | * *
301 | ************************************************************************
302 |
303 | 8. Litigation
304 | -------------
305 |
306 | Any litigation relating to this License may be brought only in the
307 | courts of a jurisdiction where the defendant maintains its principal
308 | place of business and such litigation shall be governed by laws of that
309 | jurisdiction, without reference to its conflict-of-law provisions.
310 | Nothing in this Section shall prevent a party's ability to bring
311 | cross-claims or counter-claims.
312 |
313 | 9. Miscellaneous
314 | ----------------
315 |
316 | This License represents the complete agreement concerning the subject
317 | matter hereof. If any provision of this License is held to be
318 | unenforceable, such provision shall be reformed only to the extent
319 | necessary to make it enforceable. Any law or regulation which provides
320 | that the language of a contract shall be construed against the drafter
321 | shall not be used to construe this License against a Contributor.
322 |
323 | 10. Versions of the License
324 | ---------------------------
325 |
326 | 10.1. New Versions
327 |
328 | Mozilla Foundation is the license steward. Except as provided in Section
329 | 10.3, no one other than the license steward has the right to modify or
330 | publish new versions of this License. Each version will be given a
331 | distinguishing version number.
332 |
333 | 10.2. Effect of New Versions
334 |
335 | You may distribute the Covered Software under the terms of the version
336 | of the License under which You originally received the Covered Software,
337 | or under the terms of any subsequent version published by the license
338 | steward.
339 |
340 | 10.3. Modified Versions
341 |
342 | If you create software not governed by this License, and you want to
343 | create a new license for such software, you may create and use a
344 | modified version of this License if you rename the license and remove
345 | any references to the name of the license steward (except to note that
346 | such modified license differs from this License).
347 |
348 | 10.4. Distributing Source Code Form that is Incompatible With Secondary
349 | Licenses
350 |
351 | If You choose to distribute Source Code Form that is Incompatible With
352 | Secondary Licenses under the terms of this version of the License, the
353 | notice described in Exhibit B of this License must be attached.
354 |
355 | Exhibit A - Source Code Form License Notice
356 | -------------------------------------------
357 |
358 | This Source Code Form is subject to the terms of the Mozilla Public
359 | License, v. 2.0. If a copy of the MPL was not distributed with this
360 | file, You can obtain one at http://mozilla.org/MPL/2.0/.
361 |
362 | If it is not possible or desirable to put the notice in a particular
363 | file, then You may include the notice in a location (such as a LICENSE
364 | file in a relevant directory) where a recipient would be likely to look
365 | for such a notice.
366 |
367 | You may add additional accurate notices of copyright ownership.
368 |
369 | Exhibit B - "Incompatible With Secondary Licenses" Notice
370 | ---------------------------------------------------------
371 |
372 | This Source Code Form is "Incompatible With Secondary Licenses", as
373 | defined by the Mozilla Public License, v. 2.0.
374 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 | - ## 🌈Keeper
13 |
14 | 一些实用的的定时任务集合(线上/线下组合拳).
15 |
16 |
17 |
18 | # GitHub-Action
19 |
20 | - [x] daily-push `刷绿 profile 格子` (Fork 项目不被计数刷绿; 主旨非作弊行为 [\[1\]](#cite_note-1)
21 | - [x] 获取`必应壁纸`,存储在 tasks 分支的 Bing 里面 [\[2\]](#cite_note-2)
22 | - [x] 同步 github 仓库到 gitee. [\[3\]](#cite_note-3)
23 | - [x] 访问唤醒+检查 SSL 状态 [(如 LeanCloud 评论后台 / 博客后台,Demo 地址)](https://weidows-projects.github.io/Keeper/) [\[4\]](#cite_note-4)
24 | - [x] 调用更新 waka-box [\[10\]](#cite_note-10)
25 |
26 | - 进入 settings 配置 secret :
27 |
28 | | name | value (不会泄露,未填的项不会启用) |
29 | | :--------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
30 | | PUSH_EMAIL | github 推送邮箱 (默认使用 Github-action[bot]) |
31 | | URL | 唤醒+SSL-Check,支持多个如 `weidows.avosapps.us www.baidu.com` 注意只能是域名不能有前后缀 |
32 | | GITEE_RSA | 私钥文件内容; 公钥复制到 [用户设置](https://gitee.com/profile/sshkeys); 如何生成秘钥可以查看 [这篇文章](https://weidows.github.io/post/experience/SSH); 需要提前在 gitee 创建同名同邮箱的仓库 |
33 | | GITEE_TOKEN | 用于镜像时自动创建不存在的仓库,Gitee 可以在[这里](https://gitee.com/profile/personal_access_tokens)找到 |
34 | | WAKATIME_API_KEY | waka-box 需要的 wakatime API |
35 | | GH_TOKEN | 更新 waka-box 需要用带有 Gist 权限的 GitHub TOKEN |
36 |
37 | 
38 |
39 | # 本机
40 |
41 | - 全堆在 [utils.bat](./utils.bat) 里,注释很明确; 下图为样式
42 |
43 | 
44 |
45 | - [x] 备份各种开发配置信息 (包括装的软件/SDK,每个工具装的库,config 文件...)
46 |
47 | `机子有价,数据无价`,可参考我的备份仓库: [Weidows-projects/Programming-Configuration](https://github.com/Weidows-projects/Programming-Configuration)
48 |
49 | - [x] 各平台每日签到,某些交给 github-action 容易被查封,所以在本机手动跑.
50 | - [x] [原创用于 aria2 后台启动最佳方案](./scripts/aria2.bat)
51 | - [x] [原创 Hello 图床多线程增量备份脚本.](./scripts/hello.py)
52 | - [x] [刷新本机 GitHub520 - hosts](./scripts/GitHub520/) [\[7\]](#cite_note-7) [\[8\]](#cite_note-8) [\[9\]](#cite_note-9)
53 |
54 | 非 append/overwrite, 不会改变其他 host; [此处 Release 中打包好了 64 位可执行文件](https://github.com/Weidows-projects/scoop-3rd/releases/tag/1.0.0)
55 |
56 | 
57 |
58 | # 借物表
59 |
60 | [1]: [justjavac/auto-green](https://github.com/justjavac/auto-green)
61 |
62 | [2]: [mstf/bingdownload](https://gitee.com/mstf/bingdownload)
63 |
64 | [3]: [Yikun/hub-mirror-action](https://github.com/Yikun/hub-mirror-action/)
65 |
66 | [4]: [ChenYFan/ssl](https://github.com/ChenYFan/ssl)
67 |
68 | [7]: [521xueweihan/GitHub520](https://github.com/521xueweihan/GitHub520)
69 |
70 | [8]: https://github.com/mbuilov/sed-windows
71 |
72 | [9]: https://github.com/islamadel/bat2exe
73 |
74 | [10]: https://github.com/YouEclipse/waka-box-go
75 |
--------------------------------------------------------------------------------
/image/README/1644490835674.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Weidows-projects/Keeper/2b8b08b571c3a967468736c7ec83d2cc76beaec9/image/README/1644490835674.png
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "docker",
3 | "version": "1.0.0",
4 | "description": "脚本文件",
5 | "main": "index.js",
6 | "repository": "https://github.com/Weidows/docker.git",
7 | "author": "Weidows ",
8 | "license": "MIT",
9 | "scripts": {
10 | "init": "git submodule update --init --recursive",
11 | "utils-win": "utils.bat",
12 | "convert-utils-win": "sh scripts/convert-utils-win.sh",
13 | "utils-unix": "sh utils.sh",
14 | "docker-compose": "cd ./scripts/docker && docker-compose up -d",
15 | "docker-compose-test": "cd ./scripts/docker && docker-compose -f docker-compose-test.yml -p test up",
16 | "docker-weidows-test": "cd ./scripts/docker && wsl docker build -t weidows-test:v1 .",
17 | "Windows-service-manager": "cmd /c scripts\\Windows-service-manager.bat",
18 | "fav-backup": "cd D:/Audio/fav && fav fetch && fav pull"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/poetry.lock:
--------------------------------------------------------------------------------
1 | # This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand.
2 |
3 | [[package]]
4 | name = "certifi"
5 | version = "2023.5.7"
6 | description = "Python package for providing Mozilla's CA Bundle."
7 | category = "main"
8 | optional = false
9 | python-versions = ">=3.6"
10 | files = [
11 | {file = "certifi-2023.5.7-py3-none-any.whl", hash = "sha256:c6c2e98f5c7869efca1f8916fed228dd91539f9f1b444c314c06eef02980c716"},
12 | {file = "certifi-2023.5.7.tar.gz", hash = "sha256:0f0d56dc5a6ad56fd4ba36484d6cc34451e1c6548c61daad8c320169f91eddc7"},
13 | ]
14 |
15 | [package.source]
16 | type = "legacy"
17 | url = "https://pypi.tuna.tsinghua.edu.cn/simple"
18 | reference = "tsinghua"
19 |
20 | [[package]]
21 | name = "charset-normalizer"
22 | version = "3.1.0"
23 | description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
24 | category = "main"
25 | optional = false
26 | python-versions = ">=3.7.0"
27 | files = [
28 | {file = "charset-normalizer-3.1.0.tar.gz", hash = "sha256:34e0a2f9c370eb95597aae63bf85eb5e96826d81e3dcf88b8886012906f509b5"},
29 | {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e0ac8959c929593fee38da1c2b64ee9778733cdf03c482c9ff1d508b6b593b2b"},
30 | {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d7fc3fca01da18fbabe4625d64bb612b533533ed10045a2ac3dd194bfa656b60"},
31 | {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:04eefcee095f58eaabe6dc3cc2262f3bcd776d2c67005880894f447b3f2cb9c1"},
32 | {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:20064ead0717cf9a73a6d1e779b23d149b53daf971169289ed2ed43a71e8d3b0"},
33 | {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1435ae15108b1cb6fffbcea2af3d468683b7afed0169ad718451f8db5d1aff6f"},
34 | {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c84132a54c750fda57729d1e2599bb598f5fa0344085dbde5003ba429a4798c0"},
35 | {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75f2568b4189dda1c567339b48cba4ac7384accb9c2a7ed655cd86b04055c795"},
36 | {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:11d3bcb7be35e7b1bba2c23beedac81ee893ac9871d0ba79effc7fc01167db6c"},
37 | {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:891cf9b48776b5c61c700b55a598621fdb7b1e301a550365571e9624f270c203"},
38 | {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:5f008525e02908b20e04707a4f704cd286d94718f48bb33edddc7d7b584dddc1"},
39 | {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:b06f0d3bf045158d2fb8837c5785fe9ff9b8c93358be64461a1089f5da983137"},
40 | {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:49919f8400b5e49e961f320c735388ee686a62327e773fa5b3ce6721f7e785ce"},
41 | {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:22908891a380d50738e1f978667536f6c6b526a2064156203d418f4856d6e86a"},
42 | {file = "charset_normalizer-3.1.0-cp310-cp310-win32.whl", hash = "sha256:12d1a39aa6b8c6f6248bb54550efcc1c38ce0d8096a146638fd4738e42284448"},
43 | {file = "charset_normalizer-3.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:65ed923f84a6844de5fd29726b888e58c62820e0769b76565480e1fdc3d062f8"},
44 | {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9a3267620866c9d17b959a84dd0bd2d45719b817245e49371ead79ed4f710d19"},
45 | {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6734e606355834f13445b6adc38b53c0fd45f1a56a9ba06c2058f86893ae8017"},
46 | {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f8303414c7b03f794347ad062c0516cee0e15f7a612abd0ce1e25caf6ceb47df"},
47 | {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aaf53a6cebad0eae578f062c7d462155eada9c172bd8c4d250b8c1d8eb7f916a"},
48 | {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3dc5b6a8ecfdc5748a7e429782598e4f17ef378e3e272eeb1340ea57c9109f41"},
49 | {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e1b25e3ad6c909f398df8921780d6a3d120d8c09466720226fc621605b6f92b1"},
50 | {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ca564606d2caafb0abe6d1b5311c2649e8071eb241b2d64e75a0d0065107e62"},
51 | {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b82fab78e0b1329e183a65260581de4375f619167478dddab510c6c6fb04d9b6"},
52 | {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:bd7163182133c0c7701b25e604cf1611c0d87712e56e88e7ee5d72deab3e76b5"},
53 | {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:11d117e6c63e8f495412d37e7dc2e2fff09c34b2d09dbe2bee3c6229577818be"},
54 | {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:cf6511efa4801b9b38dc5546d7547d5b5c6ef4b081c60b23e4d941d0eba9cbeb"},
55 | {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:abc1185d79f47c0a7aaf7e2412a0eb2c03b724581139193d2d82b3ad8cbb00ac"},
56 | {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:cb7b2ab0188829593b9de646545175547a70d9a6e2b63bf2cd87a0a391599324"},
57 | {file = "charset_normalizer-3.1.0-cp311-cp311-win32.whl", hash = "sha256:c36bcbc0d5174a80d6cccf43a0ecaca44e81d25be4b7f90f0ed7bcfbb5a00909"},
58 | {file = "charset_normalizer-3.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:cca4def576f47a09a943666b8f829606bcb17e2bc2d5911a46c8f8da45f56755"},
59 | {file = "charset_normalizer-3.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0c95f12b74681e9ae127728f7e5409cbbef9cd914d5896ef238cc779b8152373"},
60 | {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fca62a8301b605b954ad2e9c3666f9d97f63872aa4efcae5492baca2056b74ab"},
61 | {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac0aa6cd53ab9a31d397f8303f92c42f534693528fafbdb997c82bae6e477ad9"},
62 | {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c3af8e0f07399d3176b179f2e2634c3ce9c1301379a6b8c9c9aeecd481da494f"},
63 | {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a5fc78f9e3f501a1614a98f7c54d3969f3ad9bba8ba3d9b438c3bc5d047dd28"},
64 | {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:628c985afb2c7d27a4800bfb609e03985aaecb42f955049957814e0491d4006d"},
65 | {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:74db0052d985cf37fa111828d0dd230776ac99c740e1a758ad99094be4f1803d"},
66 | {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:1e8fcdd8f672a1c4fc8d0bd3a2b576b152d2a349782d1eb0f6b8e52e9954731d"},
67 | {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:04afa6387e2b282cf78ff3dbce20f0cc071c12dc8f685bd40960cc68644cfea6"},
68 | {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:dd5653e67b149503c68c4018bf07e42eeed6b4e956b24c00ccdf93ac79cdff84"},
69 | {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d2686f91611f9e17f4548dbf050e75b079bbc2a82be565832bc8ea9047b61c8c"},
70 | {file = "charset_normalizer-3.1.0-cp37-cp37m-win32.whl", hash = "sha256:4155b51ae05ed47199dc5b2a4e62abccb274cee6b01da5b895099b61b1982974"},
71 | {file = "charset_normalizer-3.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:322102cdf1ab682ecc7d9b1c5eed4ec59657a65e1c146a0da342b78f4112db23"},
72 | {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e633940f28c1e913615fd624fcdd72fdba807bf53ea6925d6a588e84e1151531"},
73 | {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:3a06f32c9634a8705f4ca9946d667609f52cf130d5548881401f1eb2c39b1e2c"},
74 | {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7381c66e0561c5757ffe616af869b916c8b4e42b367ab29fedc98481d1e74e14"},
75 | {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3573d376454d956553c356df45bb824262c397c6e26ce43e8203c4c540ee0acb"},
76 | {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e89df2958e5159b811af9ff0f92614dabf4ff617c03a4c1c6ff53bf1c399e0e1"},
77 | {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:78cacd03e79d009d95635e7d6ff12c21eb89b894c354bd2b2ed0b4763373693b"},
78 | {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:de5695a6f1d8340b12a5d6d4484290ee74d61e467c39ff03b39e30df62cf83a0"},
79 | {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1c60b9c202d00052183c9be85e5eaf18a4ada0a47d188a83c8f5c5b23252f649"},
80 | {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:f645caaf0008bacf349875a974220f1f1da349c5dbe7c4ec93048cdc785a3326"},
81 | {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:ea9f9c6034ea2d93d9147818f17c2a0860d41b71c38b9ce4d55f21b6f9165a11"},
82 | {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:80d1543d58bd3d6c271b66abf454d437a438dff01c3e62fdbcd68f2a11310d4b"},
83 | {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:73dc03a6a7e30b7edc5b01b601e53e7fc924b04e1835e8e407c12c037e81adbd"},
84 | {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6f5c2e7bc8a4bf7c426599765b1bd33217ec84023033672c1e9a8b35eaeaaaf8"},
85 | {file = "charset_normalizer-3.1.0-cp38-cp38-win32.whl", hash = "sha256:12a2b561af122e3d94cdb97fe6fb2bb2b82cef0cdca131646fdb940a1eda04f0"},
86 | {file = "charset_normalizer-3.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:3160a0fd9754aab7d47f95a6b63ab355388d890163eb03b2d2b87ab0a30cfa59"},
87 | {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:38e812a197bf8e71a59fe55b757a84c1f946d0ac114acafaafaf21667a7e169e"},
88 | {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6baf0baf0d5d265fa7944feb9f7451cc316bfe30e8df1a61b1bb08577c554f31"},
89 | {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8f25e17ab3039b05f762b0a55ae0b3632b2e073d9c8fc88e89aca31a6198e88f"},
90 | {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3747443b6a904001473370d7810aa19c3a180ccd52a7157aacc264a5ac79265e"},
91 | {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b116502087ce8a6b7a5f1814568ccbd0e9f6cfd99948aa59b0e241dc57cf739f"},
92 | {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d16fd5252f883eb074ca55cb622bc0bee49b979ae4e8639fff6ca3ff44f9f854"},
93 | {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21fa558996782fc226b529fdd2ed7866c2c6ec91cee82735c98a197fae39f706"},
94 | {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6f6c7a8a57e9405cad7485f4c9d3172ae486cfef1344b5ddd8e5239582d7355e"},
95 | {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ac3775e3311661d4adace3697a52ac0bab17edd166087d493b52d4f4f553f9f0"},
96 | {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:10c93628d7497c81686e8e5e557aafa78f230cd9e77dd0c40032ef90c18f2230"},
97 | {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:6f4f4668e1831850ebcc2fd0b1cd11721947b6dc7c00bf1c6bd3c929ae14f2c7"},
98 | {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:0be65ccf618c1e7ac9b849c315cc2e8a8751d9cfdaa43027d4f6624bd587ab7e"},
99 | {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:53d0a3fa5f8af98a1e261de6a3943ca631c526635eb5817a87a59d9a57ebf48f"},
100 | {file = "charset_normalizer-3.1.0-cp39-cp39-win32.whl", hash = "sha256:a04f86f41a8916fe45ac5024ec477f41f886b3c435da2d4e3d2709b22ab02af1"},
101 | {file = "charset_normalizer-3.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:830d2948a5ec37c386d3170c483063798d7879037492540f10a475e3fd6f244b"},
102 | {file = "charset_normalizer-3.1.0-py3-none-any.whl", hash = "sha256:3d9098b479e78c85080c98e1e35ff40b4a31d8953102bb0fd7d1b6f8a2111a3d"},
103 | ]
104 |
105 | [package.source]
106 | type = "legacy"
107 | url = "https://pypi.tuna.tsinghua.edu.cn/simple"
108 | reference = "tsinghua"
109 |
110 | [[package]]
111 | name = "idna"
112 | version = "3.4"
113 | description = "Internationalized Domain Names in Applications (IDNA)"
114 | category = "main"
115 | optional = false
116 | python-versions = ">=3.5"
117 | files = [
118 | {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"},
119 | {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"},
120 | ]
121 |
122 | [package.source]
123 | type = "legacy"
124 | url = "https://pypi.tuna.tsinghua.edu.cn/simple"
125 | reference = "tsinghua"
126 |
127 | [[package]]
128 | name = "requests"
129 | version = "2.30.0"
130 | description = "Python HTTP for Humans."
131 | category = "main"
132 | optional = false
133 | python-versions = ">=3.7"
134 | files = [
135 | {file = "requests-2.30.0-py3-none-any.whl", hash = "sha256:10e94cc4f3121ee6da529d358cdaeaff2f1c409cd377dbc72b825852f2f7e294"},
136 | {file = "requests-2.30.0.tar.gz", hash = "sha256:239d7d4458afcb28a692cdd298d87542235f4ca8d36d03a15bfc128a6559a2f4"},
137 | ]
138 |
139 | [package.dependencies]
140 | certifi = ">=2017.4.17"
141 | charset-normalizer = ">=2,<4"
142 | idna = ">=2.5,<4"
143 | urllib3 = ">=1.21.1,<3"
144 |
145 | [package.extras]
146 | socks = ["PySocks (>=1.5.6,!=1.5.7)"]
147 | use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"]
148 |
149 | [package.source]
150 | type = "legacy"
151 | url = "https://pypi.tuna.tsinghua.edu.cn/simple"
152 | reference = "tsinghua"
153 |
154 | [[package]]
155 | name = "urllib3"
156 | version = "2.0.2"
157 | description = "HTTP library with thread-safe connection pooling, file post, and more."
158 | category = "main"
159 | optional = false
160 | python-versions = ">=3.7"
161 | files = [
162 | {file = "urllib3-2.0.2-py3-none-any.whl", hash = "sha256:d055c2f9d38dc53c808f6fdc8eab7360b6fdbbde02340ed25cfbcd817c62469e"},
163 | {file = "urllib3-2.0.2.tar.gz", hash = "sha256:61717a1095d7e155cdb737ac7bb2f4324a858a1e2e6466f6d03ff630ca68d3cc"},
164 | ]
165 |
166 | [package.extras]
167 | brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"]
168 | secure = ["certifi", "cryptography (>=1.9)", "idna (>=2.0.0)", "pyopenssl (>=17.1.0)", "urllib3-secure-extra"]
169 | socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"]
170 | zstd = ["zstandard (>=0.18.0)"]
171 |
172 | [package.source]
173 | type = "legacy"
174 | url = "https://pypi.tuna.tsinghua.edu.cn/simple"
175 | reference = "tsinghua"
176 |
177 | [metadata]
178 | lock-version = "2.0"
179 | python-versions = "^3.10"
180 | content-hash = "56e96fd4b0a41bdd06a046988f68c32ebece819b6a98f6fb24269f410b085662"
181 |
--------------------------------------------------------------------------------
/pyproject.toml:
--------------------------------------------------------------------------------
1 | [tool.poetry]
2 | name = "keeper"
3 | version = "0.1.0"
4 | description = ""
5 | authors = ["Weidows "]
6 | readme = "README.md"
7 |
8 | [tool.poetry.dependencies]
9 | python = "^3.10"
10 | requests = "^2.30.0"
11 |
12 | [[tool.poetry.source]]
13 | name = "tsinghua"
14 | url = "https://pypi.tuna.tsinghua.edu.cn/simple"
15 | default = true
16 | secondary = false
17 |
18 | [build-system]
19 | requires = ["poetry-core"]
20 | build-backend = "poetry.core.masonry.api"
21 |
--------------------------------------------------------------------------------
/scripts/GitHub520/GitHub520.bat:
--------------------------------------------------------------------------------
1 | @REM * @?: **********************************************************
2 | @REM * @Author: Weidows
3 | @REM * @Date: 2022-04-24 11:38:38
4 | @REM * @LastEditors: Weidows
5 | @REM * @LastEditTime: 2022-04-24 11:53:18
6 | @REM * @FilePath: \Keeper\scripts\GitHub-520.bat
7 | @REM * @Description: 手动刷新 GitHub520 hosts + 原版备份
8 | @REM * 报错了的话检查一下是不是 hosts 里面 GitHub520 重复了
9 | @REM * @!: **********************************************************
10 | @echo off
11 |
12 | @REM set file=%windir%\System32\drivers\etc\hosts
13 | set file=C:\Windows\System32\drivers\etc\hosts
14 | set bak_file=%file%.bak
15 | set curl_file=%file%.github
16 |
17 | @REM 获取指定字符串的行号
18 | sed -n "/GitHub520 Host Start/=" %file% > %bak_file%
19 | set /p startLine=<%bak_file%
20 | sed -n "/GitHub520 Host End/=" %file% > %bak_file%
21 | set /p endLine=<%bak_file%
22 |
23 | if "%startLine%,%endLine%d"==",d" (
24 | echo GitHub520 not exists, will append
25 | copy %file% %bak_file% /Y
26 | ) else (
27 | echo GitHub520 exists, will refresh
28 | sed %startLine%,%endLine%d %file% > %bak_file%
29 | copy %bak_file% %file% /Y
30 | )
31 |
32 | @REM https://github.com/521xueweihan/GitHub520
33 | curl https://raw.hellogithub.com/hosts > %curl_file%
34 | @REM 去除错误信息, 如下
35 | @REM
36 | @REM 502 Bad Gateway
37 | @REM
38 | @REM 502 Bad Gateway
39 | @REM
nginx/1.14.0 (Ubuntu)
40 | @REM
41 | @REM
42 | sed "/> %file%
43 |
44 | echo Finished.
45 |
--------------------------------------------------------------------------------
/scripts/Windows-administration/add.reg:
--------------------------------------------------------------------------------
1 | Windows Registry Editor Version 5.00
2 |
3 | [-HKEY_CLASSES_ROOT\*\shell\runas]
4 |
5 | [HKEY_CLASSES_ROOT\*\shell\runas]
6 | @="获取超级管理员权限"
7 | "Icon"="C:\\Windows\\System32\\imageres.dll,-78"
8 | "NoWorkingDirectory"=""
9 |
10 | [HKEY_CLASSES_ROOT\*\shell\runas\command]
11 | @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
12 | "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
13 |
14 | [-HKEY_CLASSES_ROOT\Directory\shell\runas]
15 |
16 | [HKEY_CLASSES_ROOT\Directory\shell\runas]
17 | @="获取超级管理员权限"
18 | "Icon"="C:\\Windows\\System32\\imageres.dll,-78"
19 | "NoWorkingDirectory"=""
20 |
21 | [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
22 | @="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
23 | "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
24 |
25 | [-HKEY_CLASSES_ROOT\dllfile\shell]
26 |
27 | [HKEY_CLASSES_ROOT\dllfile\shell\runas]
28 | @="获取超级管理员权限"
29 | "HasLUAShield"=""
30 | "NoWorkingDirectory"=""
31 |
32 | [HKEY_CLASSES_ROOT\dllfile\shell\runas\command]
33 | @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
34 | "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
35 |
36 | [-HKEY_CLASSES_ROOT\Drive\shell\runas]
37 |
38 | [HKEY_CLASSES_ROOT\Drive\shell\runas]
39 | @="获取超级管理员权限"
40 | "Icon"="C:\\Windows\\System32\\imageres.dll,-78"
41 | "NoWorkingDirectory"=""
42 |
43 | [HKEY_CLASSES_ROOT\Drive\shell\runas\command]
44 | @="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
45 | "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
46 |
--------------------------------------------------------------------------------
/scripts/Windows-administration/remove.reg:
--------------------------------------------------------------------------------
1 | Windows Registry Editor Version 5.00
2 |
3 | [-HKEY_CLASSES_ROOT\*\shell\runas]
4 |
5 | [-HKEY_CLASSES_ROOT\Directory\shell\runas]
6 |
7 | [-HKEY_CLASSES_ROOT\dllfile\shell]
8 |
9 | [-HKEY_CLASSES_ROOT\Drive\shell\runas]
10 |
11 | [-HKEY_CLASSES_ROOT\exefile\shell\runas]
12 |
13 | [HKEY_CLASSES_ROOT\exefile\shell\runas]
14 | "HasLUAShield"=""
15 |
16 | [HKEY_CLASSES_ROOT\exefile\shell\runas\command]
17 | @="\"%1\" %*"
18 | "IsolatedCommand"="\"%1\" %*"
19 |
--------------------------------------------------------------------------------
/scripts/Windows-service-manager.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | chcp 65001
3 |
4 | @REM https://blog.csdn.net/weixin_40461281/article/details/111563206
5 | @REM 自动
6 | @REM sudo sc config 服务名 start= auto
7 |
8 |
9 |
10 | @REM 手动
11 | @REM sudo sc config 服务名 start= demand
12 | sudo sc config "VMAuthdService" start= demand
13 | sudo sc config "VMnetDHCP" start= demand
14 | sudo sc config "VMware NAT Service" start= demand
15 | sudo sc config "VMUSBArbService" start= demand
16 | sudo sc config "VmwareAutostartService" start= demand
17 |
18 |
19 | @REM 禁用 (不会停止)
20 | @REM sudo sc config 服务名 start= disabled
21 | sudo sc config "AsusAppService" start= disabled
22 | sudo sc config "LightingService" start= disabled
23 | sudo sc config "ASUSLinkNear" start= disabled
24 | sudo sc config "ASUSLinkRemote" start= disabled
25 | sudo sc config "ASUSOptimization" start= disabled
26 | sudo sc config "ASUSSoftwareManager" start= disabled
27 | sudo sc config "ASUSSwitch" start= disabled
28 | sudo sc config "ASUSSystemAnalysis" start= disabled
29 | sudo sc config "ASUSSystemDiagnosis" start= disabled
30 | sudo sc config "asus" start= disabled
31 | sudo sc config "asusm" start= disabled
32 |
33 | sudo sc config "pcmastersvc" start= disabled
34 | sudo sc config "Winmgmt" start= disabled
35 |
36 |
37 |
38 | @REM 停止
39 | @REM sudo net stop 服务名
40 | sudo net stop "VMAuthdService"
41 | sudo net stop "VMnetDHCP"
42 | sudo net stop "VMware NAT Service"
43 | sudo net stop "VMUSBArbService"
44 | sudo net stop "VmwareAutostartService"
45 |
46 | sudo net stop "AsusAppService"
47 | sudo net stop "LightingService"
48 | sudo net stop "ASUSLinkNear"
49 | sudo net stop "ASUSLinkRemote"
50 | sudo net stop "ASUSOptimization"
51 | sudo net stop "ASUSSoftwareManager"
52 | sudo net stop "ASUSSwitch"
53 | sudo net stop "ASUSSystemAnalysis"
54 | sudo net stop "ASUSSystemDiagnosis"
55 | sudo net stop "asus"
56 | sudo net stop "asusm"
57 |
58 | sudo net stop "pcmastersvc"
59 |
60 | @REM 解决 WMI 占用问题: https://www.mobile01.com/topicdetail.php?f=296&t=6690829
61 | sudo net stop "Winmgmt"
62 |
63 |
64 |
65 | @REM 启动
66 | @REM sudo net start "Winmgmt"
67 |
--------------------------------------------------------------------------------
/scripts/adjust_volume.sh:
--------------------------------------------------------------------------------
1 | # 定义一个函数,接受一个音频文件名和一个音量调整参数(分贝值)
2 | adjust_volume() {
3 | # 使用ffmpeg的volume滤镜来改变音频文件的音量
4 | ffmpeg -i "$1" -filter:a "volume=$2dB" "adjusted/$1"
5 | }
6 |
7 | mkdir adjusted
8 |
9 | # 遍历当前目录下的所有mp3和wav文件
10 | for file in *.mp3 *.wav; do
11 | # 调用函数,将音量降低5分贝
12 | adjust_volume "$file" -5
13 | done
14 |
--------------------------------------------------------------------------------
/scripts/aria2.bat:
--------------------------------------------------------------------------------
1 | @REM ==================================================================
2 | @REM aria2: 直接通过shell启动会被它占用,此处通过vbs另开
3 | @REM 调用链: utils.bat -> aria2.vbs -> aria2.exe -> aria2.conf -> aria2.session
4 | @REM 需要通过参数传递或者手动修改下面设置 BACKUP_DIR 和 DOWNLOAD_DIR
5 | @REM ==================================================================
6 | @echo off
7 |
8 | @REM 检测是否已运行
9 | @REM https://blog.csdn.net/yelllowcong/article/details/78424329
10 | @REM ps |grep aria2 |grep -v "grep" |wc -l
11 | @REM https://blog.csdn.net/asfuyao/article/details/8931828 | windows-find 在 powershell 中会提示 "FIND: 参数格式不正确"
12 | tasklist | find /i "aria2c.exe" && goto :eof
13 |
14 | @REM 配置和启动脚本目录 (空的就行)
15 | set BACKUP_DIR=%1
16 | if not defined BACKUP_DIR set BACKUP_DIR=backup
17 |
18 | @REM 下载目录, 默认为 D:\Download
19 | set DOWNLOAD_DIR=%2
20 | if not defined DOWNLOAD_DIR set DOWNLOAD_DIR=D:\Download
21 | @REM ==================================================================
22 |
23 | @REM aria2.session
24 | mkdir %BACKUP_DIR%\others\aria2\ >nul 2>&1
25 | touch %BACKUP_DIR%\others\aria2\aria2.session
26 |
27 | @REM 括号内命令的标准输出会重定向到 aria2.conf
28 | @REM https://aria2.github.io/manual/en/html/aria2c.html
29 | (
30 | echo ## # 开头为注释内容, 选项都有相应的注释说明, 根据需要修改 ##
31 | echo ## 被注释的选项填写的是默认值, 建议在需要修改时再取消注释 ##
32 | echo.
33 | echo ## 文件保存相关 ##
34 | echo.
35 | echo # 文件的保存路径 (可使用绝对路径或相对路径), 默认: 当前启动位置
36 | echo dir=%DOWNLOAD_DIR%
37 | echo # 启用磁盘缓存, 0 为禁用缓存, 需 1.16 以上版本, 默认:16M
38 | echo #disk-cache=
39 | echo # 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc
40 | echo # 预分配所需时间: none 《 falloc ? trunc 《 prealloc
41 | echo # falloc 和 trunc 则需要文件系统和内核支持
42 | echo # NTFS 建议使用 falloc, EXT3/4 建议 trunc, MAC 下需要注释此项
43 | echo file-allocation=falloc
44 | echo # 断点续传
45 | echo continue=true
46 | echo.
47 | echo ## 下载连接相关 ##
48 | echo.
49 | echo # 代理服务器
50 | echo all-proxy=http://127.0.0.1:7890
51 | echo # 最大同时下载任务数, 运行时可修改, 默认:5
52 | echo max-concurrent-downloads=5
53 | echo # 同一服务器连接数, 添加时可指定, 默认:1
54 | echo max-connection-per-server=16
55 | echo # 最小文件分片大小, 添加时可指定, 取值范围 1M -1024M, 默认:20M
56 | echo # 假定 size=10M, 文件为 20MiB 则使用两个来源下载; 文件为 15MiB 则使用一个来源下载
57 | echo # min-split-size=1M
58 | echo # 单个任务最大线程数, 添加时可指定, 默认:5
59 | echo # split=32
60 | echo # 整体下载速度限制, 运行时可修改, 默认:0
61 | echo #max-overall-download-limit=0
62 | echo # 单个任务下载速度限制, 默认:0
63 | echo #max-download-limit=0
64 | echo # 整体上传速度限制, 运行时可修改, 默认:0
65 | echo #max-overall-upload-limit=0
66 | echo # 单个任务上传速度限制, 默认:0
67 | echo #max-upload-limit=0
68 | echo # 禁用 IPv6, 默认:false
69 | echo # disable-ipv6=true
70 | echo # 防止出现CA版本低导致的下载失败
71 | echo # aria2 SSL/TLS handshake failure: unable to get local issuer certificate https://github.com/aria2/aria2/issues/1636
72 | echo check-certificate=false
73 | echo.
74 | echo ## 进度保存相关 ##
75 | echo.
76 | echo # 从会话文件中读取下载任务
77 | echo input-file=%BACKUP_DIR%\others\aria2\aria2.session
78 | echo # 在 Aria2 退出时保存 ` 错误 / 未完成 ` 的下载任务到会话文件
79 | echo save-session=%BACKUP_DIR%\others\aria2\aria2.session
80 | echo # 定时保存会话, 0 为退出时才保存, 需 1.16.1 以上版本, 默认:0
81 | echo save-session-interval=60
82 | echo.
83 | echo ## RPC 相关设置 ##
84 | echo.
85 | echo # 启用 RPC, 默认:false
86 | echo enable-rpc=true
87 | echo # 允许所有来源, 默认:false
88 | echo rpc-allow-origin-all=true
89 | echo # 允许非外部访问, 默认:false
90 | echo rpc-listen-all=true
91 | echo # 事件轮询方式, 取值:[epoll, kqueue, port, poll, select], 不同系统默认值不同
92 | echo #event-poll=select
93 | echo # RPC 监听端口, 端口被占用时可以修改, 默认:6800
94 | echo #rpc-listen-port=6800
95 | echo # 设置的 RPC 授权令牌, v1.18.4 新增功能, 取代 --rpc-user 和 --rpc-passwd 选项
96 | echo #rpc-secret=12345678
97 | echo # 设置的 RPC 访问用户名, 此选项新版已废弃, 建议改用 --rpc-secret 选项
98 | echo #rpc-user=《USER》
99 | echo #rpc-passwd=《PASSWD》
100 | echo.
101 | echo ## BT/PT 下载相关 ##
102 | echo.
103 | echo # 当下载的是一个种子(以.torrent 结尾) 时, 自动开始 BT 任务, 默认:true
104 | echo #follow-torrent=true
105 | echo # BT 监听端口, 当端口被屏蔽时使用, 默认:6881-6999
106 | echo listen-port=51413
107 | echo # 单个种子最大连接数, 默认:55
108 | echo #bt-max-peers=55
109 | echo # 打开 DHT 功能, PT 需要禁用, 默认:true
110 | echo enable-dht=true
111 | echo # 打开 IPv6 DHT 功能, PT 需要禁用
112 | echo #enable-dht6=true
113 | echo # DHT 网络监听端口, 默认:6881-6999
114 | echo #dht-listen-port=6881-6999
115 | echo # 本地节点查找, PT 需要禁用, 默认:false
116 | echo #bt-enable-lpd=false
117 | echo # 种子交换, PT 需要禁用, 默认:true
118 | echo enable-peer-exchange=false
119 | echo # 每个种子限速, 对少种的 PT 很有用, 默认:50K
120 | echo #bt-request-peer-speed-limit=50K
121 | echo # 客户端伪装, PT 需要
122 | echo peer-id-prefix=-TR2770-
123 | echo user-agent=Transmission/2.77
124 | echo # 当种子的分享率达到这个数时, 自动停止做种, 0 为一直做种, 默认:1.0
125 | echo seed-ratio=1.0
126 | echo # 强制保存会话, 即使任务已经完成, 默认:false
127 | echo # 较新的版本开启后会在任务完成后依然保留.aria2 文件
128 | echo #force-save=false
129 | echo # BT 校验相关, 默认:true
130 | echo #bt-hash-check-seed=true
131 | echo # 继续之前的 BT 任务时, 无需再次校验, 默认:false
132 | echo bt-seed-unverified=true
133 | echo # 保存磁力链接元数据为种子文件(.torrent 文件), 默认:false
134 | echo bt-save-metadata=true
135 |
136 | echo # 使用 UTF-8 处理 Content-Disposition, 默认:false
137 | echo content-disposition-default-utf8=true
138 | echo # 启用后台进程
139 | echo daemon=true
140 | echo user-agent=LogStatistic
141 | echo check-certificate=false
142 | )> %BACKUP_DIR%\others\aria2\aria2.conf
143 |
144 | @REM Tracker 服务器地址 https://trackerslist.com/#/zh
145 | call curl -s https://gitea.com/XIU2/TrackersListCollection/raw/branch/master/all_aria2.txt>%BACKUP_DIR%\others\aria2\trackerslist.txt
146 |
147 | @REM 不换行追加 https://blog.csdn.net/qq_45534098/article/details/111556785
148 | >>%BACKUP_DIR%\others\aria2\aria2.conf set /p="bt-tracker=" > %BACKUP_DIR%\others\aria2\aria2.conf
150 | del %BACKUP_DIR%\others\aria2\trackerslist.txt
151 |
152 | @REM https://learn.microsoft.com/zh-cn/powershell/module/microsoft.powershell.management/start-process?view=powershell-7.3
153 | powershell Start-Process -WindowStyle hidden aria2c.exe --conf-path=%BACKUP_DIR%\others\aria2\aria2.conf
154 |
--------------------------------------------------------------------------------
/scripts/backup.bat:
--------------------------------------------------------------------------------
1 | @REM ==================================================================
2 | @REM 备份,使用start是在新的终端同时进行的,call是按顺序依次
3 | @REM ==================================================================
4 | @echo off
5 | @REM 有的系统环境变量并没有设置 HOME, 无法直接进入只能手动设置了
6 | if not defined HOME set HOME=C:\Users\Weidows
7 | set BACKUP_DIR=%1
8 | if not defined BACKUP_DIR set BACKUP_DIR=backup
9 |
10 | @REM mkdir 不会覆盖已存dir; 第一次cd有可能切换盘符,加上/d
11 | mkdir %BACKUP_DIR% & cd /d %BACKUP_DIR%
12 | @REM ==================================================================
13 |
14 | @REM 备份到 backup/ !!!!!!!!!!!!! 务必把 backup 添加到 .gitignore !!!!!!!!!!!!!
15 | touch %BACKUP_DIR%\.gitignore
16 | cat %BACKUP_DIR%\.gitignore | findstr backup >nul || (
17 | echo backup>> %BACKUP_DIR%\.gitignore
18 | )
19 | mkdir backup & cd backup
20 |
21 | @REM 备份ssh 目录后都必须加个'\' (比如.ssh有可能是目录,也可能是文件,而.ssh\只可能是目录)
22 | xcopy %HOME%\.ssh\ .ssh\ /e/y/d
23 | xcopy %HOME%\_netrc . /y/d
24 |
25 | @REM other scripts with password params
26 | cmd /c backup.bat
27 |
28 | @REM 备份图床
29 | @REM ImageHub 备份
30 | @REM wget -nc -i images.txt -P ./ImageHub
31 | @REM # 增量备份 https://cloud.tencent.com/developer/ask/sof/34010
32 | @REM %~dp0.venv\Scripts\python.exe %~dp0scripts\hello.py "Weidows" %BACKUP_DIR%\backup\
33 |
34 | cd ..
35 |
36 |
37 | @REM 备份lists
38 | mkdir lists & cd lists
39 |
40 | @REM call xrepo scan > cpp\xrepo-scan.bak
41 |
42 | dir /b "D:\mystream" > dir\dir-software.bak
43 | dir /b "E:\mystream" > dir\dir-mystream.bak
44 | dir /b "F:\mystream" >> dir\dir-mystream.bak
45 |
46 | call gh repo list > github\repolist-Weidows.bak
47 | call gh repo list Weidows-projects > github\repolist-Weidows-projects.bak
48 |
49 | dir /b "%GOPATH%\bin" > golang\go-install.bak
50 | call go env > golang\go-env.bak
51 | call gvm ls > golang\gvm-ls.bak
52 |
53 | call pnpm list -g > node\pnpm-global.bak
54 | call yarn global list > node\yarn-global.bak
55 |
56 | call conda env list > python\conda-env-list.bak
57 | call conda env export -n base > python\conda-env-base.yaml
58 | @REM call pip freeze > python\pip-list.bak
59 | call pip list --format=freeze > python\pip-list.bak
60 | call pipx list > python\pipx-list.bak
61 |
62 | call scoop export -c > pkgs\scoop-export.bak
63 | call choco list -l > pkgs\choco-list-local.bak
64 | call winget export -o pkgs\winget-export.bak --include-versions --accept-source-agreements
65 | call cygwin apt-cyg list > pkgs\cygwin-apt-cyg-list.bak
66 | @REM call scoop bucket list > scoop\scoop-buckets.bak
67 | @REM 获取当前文件夹名称
68 | @REM for /f "delims=" %%i in ("%cd%") do set folder=%%~ni
69 | @REM 获取每个仓库git地址
70 | @REM set currentPath=%cd%
71 |
72 | @REM cd /d %%i
73 | @REM call git remote get-url origin >> %currentPath%\scoop\scoop-buckets.bak
74 | @REM )
75 | @REM cd /d %currentPath%
76 |
77 | cd ..
78 |
79 |
80 | @REM 备份其他
81 | mkdir others & cd others
82 |
83 | xcopy %SCOOP%\persist\Clash-for-Windows_Chinese\data\cfw-settings.yaml clash\ /e/y/d
84 | xcopy %windir%\System32\drivers\etc\ hosts\ /y/d
85 | xcopy %SCOOP%\persist\maven\conf\settings.xml maven\conf\ /e/y/d
86 | xcopy %SCOOP%\persist\pwsh\profile.ps1 .\pwsh\ /e/y/d
87 |
88 | @REM steam 经常遇到游戏本体存在但是不认亲的情况, so backup.
89 | xcopy %SCOOP%\persist\steam\steamapps\*.acf .\steam\ /y/d
90 | xcopy E:\mystream\steamapps\*.acf .\steam\ /y/d
91 | xcopy F:\mystream\steamapps\*.acf .\steam\ /y/d
92 |
93 | @REM xcopy "C:\Users\Administrator\AppData\Local\Microsoft\Windows Terminal\settings.json" .\WindowsTerminal\ /e/y/d
94 |
95 | cd ..
96 |
97 |
98 | @REM 备份 ~\
99 | mkdir dotfiles & cd dotfiles
100 |
101 | xcopy %HOME%\pip\ pip\ /e/y/d
102 | xcopy %HOME%\.continuum\ .continuum\ /e/y/d
103 | xcopy %HOME%\.npmrc . /y/d
104 | xcopy %HOME%\.wslconfig . /y/d
105 | @REM xcopy %HOME%\.yrmrc . /y/d
106 | xcopy %HOME%\.condarc . /y/d
107 | xcopy %HOME%\.gitconfig . /y/d
108 |
109 | @REM git-bash 样式
110 | xcopy %HOME%\.minttyrc . /y/d
111 | echo %PATH% | sed 's/;/\n/g' > .PATH
112 |
113 | cd ..
114 |
115 | @REM ssh
116 | @REM serv00 保活
117 | ssh serv00-Weidows exit
118 |
119 | @REM telegram
120 | mkdir backup\telegram & cd backup\telegram
121 |
122 | cmd /c telegram.bat
123 |
124 | cd ..
125 |
--------------------------------------------------------------------------------
/scripts/booter.bat:
--------------------------------------------------------------------------------
1 | @REM ==================================================================
2 | @REM 开机启动软件
3 | @REM 很多程序通过 start /b 会占用当前shell, 可以改用 powershell
4 | @REM ==================================================================
5 | @echo off
6 |
7 | @REM 配置和启动脚本目录 (空的就行)
8 | set BACKUP_DIR=%1
9 | if not defined BACKUP_DIR set BACKUP_DIR=%~dp0..\Programming-Configuration
10 |
11 | @REM 服务
12 | @REM sudo net start "Winmgmt"
13 |
14 | cd /d %appdata%\Microsoft\Windows\Start Menu\Programs\Scoop Apps
15 |
16 | @REM CPU 密集型
17 | @REM tasklist | find /i "GHelper" || powershell Start-Process "GHelper"
18 | tasklist | find /i "MouseInc" || powershell Start-Process "MouseInc"
19 | @REM tasklist | find /i "Steam++.exe" || powershell Start-Process "Steam++"
20 | @REM tasklist | find /i "RunCat.exe" || powershell Start-Process -WindowStyle hidden "RunCat"
21 | @REM tasklist | find /i "windhawk.exe" || powershell Start-Process -WindowStyle hidden "Windhawk"
22 | @REM tasklist | find /i "steam" || start /b steam -silent -noverifyfiles
23 | @REM tasklist | find /i "memreduct.exe" || powershell Start-Process -WindowStyle hidden "memreduct.exe"
24 | tasklist | find /i "keysound" || powershell Start-Process "KeySound"
25 | @REM tasklist | find /i "KuGou" || powershell Start-Process -WindowStyle hidden "kugou.exe"
26 | tasklist | find /i "WeChat" || powershell Start-Process -WindowStyle hidden "WeChat"
27 |
28 | @REM 磁盘唤醒 (deprecated) -> clash 子进程
29 | @REM cmd /c %~dp0disk-sleep-guard.bat D:\
30 | @REM 这里不要用 start, 虽然能跑起来, 但可能会出现某些未知异常
31 | @REM cmd /c %~dp0aria2.bat %BACKUP_DIR% E:\Download
32 | @REM tasklist | find /i "AudioRelay.exe" || powershell Start-Process -WindowStyle hidden "D:\mystream\AudioRelay\AudioRelay.exe"
33 |
34 | echo "Next to open other softs, or just close the window."
35 | @REM https://blog.miniasp.com/post/2009/06/24/Sleep-command-in-Batch
36 | @REM timeout /t 10
37 | tasklist | find /i "Dock_64" || start steam://run/1787090
38 | tasklist | find /i "Banana" || start steam://run/2923300
39 | tasklist | find /i "ShareX" || start steam://run/400040
40 | @REM tasklist | find /i "VPet" || start steam://run/1920960
41 | @REM tasklist | find /i "msedge.exe" || start /b microsoft-edge:
42 | @REM tasklist | find /i "rainmeter.exe" || powershell Start-Process -WindowStyle hidden "rainmeter.exe"
43 | tasklist | find /i "xyplorer" || powershell Start-Process -WindowStyle hidden "xyplorer.exe"
44 | @REM tasklist | find /i "n0vadesktop.exe" || powershell Start-Process -WindowStyle hidden "n0vadesktop"
45 | tasklist | find /i "wutils" || pm2 resurrect
46 |
47 | @REM timeout /t 10
48 | @REM pause
49 | @REM %~dp0 为脚本所在路径; %cd% 类似 pwd,当前路径
50 | cd /d %BACKUP_DIR%\backup
51 |
52 | @REM logger
53 | @REM 2022-04-24
54 | echo %date:~3,14%| sed -e 's/\//-/g' > log\last-run.txt
55 | set /p logFile=> log\last-run.txt
57 |
58 | @REM 2022-04-24.log
59 | set logFile=%BACKUP_DIR%\backup\log\tasks\%logFile%.log
60 |
61 | for /l %%i in (1 1 5) do echo.>> %logFile%
62 | time /T >> %logFile%
63 | echo =====================================================================>> %logFile%
64 |
65 | @REM https://github.com/521xueweihan/GitHub520
66 | @REM sudo cmd /c %~dp0GitHub520\GitHub520.bat | tee -a %logFile%
67 |
68 | @REM scoop-update
69 | @REM call scoop update | tee -a %logFile%
70 |
71 | @REM dailycheckin (cmd会由于Unicode报错)
72 | @REM call conda activate base
73 | @REM start powershell dailycheckin --include ACFUN CLOUD189 MUSIC163 TIEBA
74 |
75 | @REM 米游社
76 | @REM call python AutoMihoyoBBS/main.py
77 |
78 | @REM bilibili
79 | @REM cd BILIBILI-HELPER
80 | @REM call java -jar BILIBILI-HELPER.jar | tee -a %logFile%
81 | @REM cd ..
82 | @REM rd /S/Q D:\tmp
83 |
84 | @REM biliup
85 | @REM cd /d G:\Videos\录播\biliup
86 | @REM biliup --config ./config.toml --http start
87 |
--------------------------------------------------------------------------------
/scripts/convert-utils-win.sh:
--------------------------------------------------------------------------------
1 | mkdir -p build/scripts
2 | cp utils.bat build/
3 | cp scripts/*.* utils.bat build/scripts
4 |
5 | bat2exe.exe /y /source:D:\\Repos\\Weidows-projects\\Keeper\\build /target:D:\\Repos\\Weidows-projects\\Keeper
6 |
7 | rm -r build
8 |
--------------------------------------------------------------------------------
/scripts/disk-sleep-guard.bat:
--------------------------------------------------------------------------------
1 | @REM ==================================================================
2 | @REM
3 | @REM ==================================================================
4 | @echo off
5 | set FILE_PATH=%1
6 | if not defined FILE_PATH set FILE_PATH=F:\
7 |
8 | set DELAY=%2
9 | @REM 延时 30 秒
10 | if not defined DELAY set DELAY=30
11 | @REM ==================================================================
12 |
13 | :start
14 | choice /t %DELAY% /d y /n > %FILE_PATH%.dsg
15 | goto :start
16 | goto :eof
17 |
--------------------------------------------------------------------------------
/scripts/docker/docker-compose-test.yml:
--------------------------------------------------------------------------------
1 | version: "3.3"
2 | services:
3 | # =================================数据库=================================
4 | # appsmith:
5 | # image: index.docker.io/appsmith/appsmith-ce
6 | # container_name: appsmith
7 | # ports:
8 | # - "80:80"
9 | # - "443:443"
10 | # volumes:
11 | # - ./data/appsmith/stacks:/appsmith-stacks
12 | # restart: unless-stopped
13 | # # Uncomment the lines below to enable auto-update
14 | # #labels:
15 | # # com.centurylinklabs.watchtower.enable: "true"
16 |
17 | # fireboom:
18 | # image: fireboomapi/fireboom_server
19 | # container_name: fireboom
20 | # ports:
21 | # - "9123:9123"
22 | # - "9991:9991"
23 | # restart: unless-stopped
24 |
--------------------------------------------------------------------------------
/scripts/docker/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3.3"
2 | # volumes:
3 | # example-volume:
4 | # 需要手动创建, 没有的话报错
5 | # external: true
6 |
7 | services:
8 | # =================================数据库=================================
9 | redis: # 无密码
10 | image: redis:latest
11 | restart: unless-stopped
12 | container_name: "redis-app"
13 | command: redis-server /usr/local/etc/redis/redis.conf
14 | ports:
15 | - 6379:6379
16 | volumes:
17 | - ./data/redis:/data/redis
18 | # 容器启动时把 ./data/redis/redis.conf 挂载到 /usr/local/etc/redis/redis.conf
19 | - ./data/redis/redis.conf:/usr/local/etc/redis/redis.conf
20 |
21 | mongo: # root-2333
22 | image: mongo:latest
23 | restart: unless-stopped
24 | container_name: "mongo-app"
25 | environment:
26 | MONGO_INITDB_ROOT_USERNAME: root
27 | MONGO_INITDB_ROOT_PASSWORD: 2333
28 | ports:
29 | - 27017:27017
30 | volumes:
31 | - ./data/mongo:/etc/mongo
32 |
33 | mariadb: # root-2333
34 | image: mariadb:latest
35 | restart: unless-stopped
36 | container_name: "mariadb-app"
37 | ports:
38 | # 端口映射
39 | - 3306:3306
40 | volumes:
41 | # 容器与宿主机时间同步
42 | # - ./data/mariadb/localtime:/etc/localtime
43 | # 数据库目录映射
44 | - ./data/mariadb/mariadb:/var/lib/mysql
45 | # (推荐)如果要使用自定义的MySQL配置,则可以在主机上的目录中创建备用配置文件,然后将该目录位置/etc/mysql/conf.d安装在mariadb容器内。自己所需的配置文件可以放在自己服务器 ./data/mysql.conf 里面
46 | - ./data/mariadb/conf.d:/etc/mysql/conf.d
47 | environment:
48 | TIME_ZONE: Asia/Shanghai
49 | MYSQL_ROOT_PASSWORD: 2333
50 |
51 | # mysql:
52 | # image: mysql:latest
53 | # container_name: "mysql-app"
54 | # environment:
55 | # MYSQL_ROOT_PASSWORD: 2333
56 | # command:
57 | # --default-authentication-plugin=mysql_native_password
58 | # --character-set-server=utf8mb4
59 | # --collation-server=utf8mb4_general_ci
60 | # --explicit_defaults_for_timestamp=true
61 | # --lower_case_table_names=1
62 | # ports:
63 | # - 3306:3306
64 | # volumes:
65 | # - ./data/mysql:/var/lib/mysql
66 |
67 | # https://blog.csdn.net/Blanchedingding/article/details/89890663
68 | neo4j:
69 | image: neo4j:latest
70 | volumes:
71 | - ./data/neo4j/data:/data
72 | # - ./data/neo4j/conf:/var/lib/neo4j/conf
73 | - ./data/neo4j/mnt:/var/lib/neo4j/import
74 | - ./data/neo4j/plugins:/plugins
75 | - ./data/neo4j/logs:/var/lib/neo4j/logs
76 | # restart: always
77 | ports:
78 | # 数据库前端管理界面
79 | - 7474:7474
80 | # 数据库后端端口, 手动转发这个之后, 后端才能登录
81 | - 7687:7687
82 | environment:
83 | - NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
84 | - NEO4J_dbms_memory_heap_maxSize=4G
85 | #修改默认密码, 用户名必须是 neo4j 不能改
86 | - NEO4J_AUTH=neo4j/2333
87 |
88 | # =================================管理=================================
89 | qing-long: # 青龙面板 Weidows-2333
90 | image: whyour/qinglong:latest
91 | container_name: "qinglong-app"
92 | # restart: always
93 | volumes:
94 | - ./data/ql/config:/ql/config
95 | - ./data/ql/db:/ql/db
96 | - ./data/ql/log:/ql/log
97 | - ./data/ql/repo:/ql/repo
98 | - ./data/ql/scripts:/ql/scripts
99 | ports:
100 | - "0.0.0.0:5700:5700"
101 | environment:
102 | - ENABLE_HANGUP=true
103 | - ENABLE_WEB_PANEL=true
104 | # restart:
105 | # no,默认策略,在容器退出时不重启容器,正确写法是不填,而不是restart:no
106 | # on-failure,在容器非正常退出时(退出状态非0),才会重启容器
107 | # on-failure:3,在容器非正常退出时重启容器,最多重启3次
108 | # always,在容器退出时总是重启容器
109 | # unless-stopped,在容器退出时总是重启容器,但是不考虑在Docker守护进程启动时就已经停止了的容器
110 |
111 | # portainer:
112 | # #image: portainer/portainer # 官方版
113 | # image: 6053537/portainer # 汉化版
114 | # container_name: portainer
115 | # restart: unless-stopped
116 | # ports:
117 | # - 9090:9000
118 | # volumes:
119 | # - ./data/portainer:/data/portainer
120 | # - /var/run/docker.sock:/var/run/docker.sock
121 |
122 | auto_update:
123 | image: containrrr/watchtower:latest-dev
124 | volumes:
125 | - /var/run/docker.sock:/var/run/docker.sock
126 | # Update check interval in seconds.
127 | command: --schedule "0 0 * ? * *" --label-enable --cleanup
128 | restart: unless-stopped
129 | # depends_on:
130 | # - appsmith
131 | environment:
132 | - WATCHTOWER_LIFECYCLE_HOOKS=true
133 |
134 | # =================================应用=================================
135 | # 需要手动转发 80 端口, 本地跑的所以 443 端口无法访问
136 | # appsmith:
137 | # image: index.docker.io/appsmith/appsmith-ce
138 | # container_name: appsmith
139 | # ports:
140 | # - "80:80"
141 | # - "443:443"
142 | # volumes:
143 | # - ./data/appsmith/stacks:/appsmith-stacks
144 | # restart: unless-stopped
145 | # # Uncomment the lines below to enable auto-update
146 | # #labels:
147 | # # com.centurylinklabs.watchtower.enable: "true"
148 |
149 | # 点云标注
150 | # SUSTechPOINTS:
151 | # image: juhaoming/sustechpoints:v1.0.0
152 | # # restart: always
153 | # ports:
154 | # - 8081:8081
155 | # volumes:
156 | # - ./data/SUSTechPOINTS:/root/SUSTechPOINTS/data
157 |
158 | # 跑不起来
159 | # docker-osx:
160 | # devices:
161 | # - /dev/kvm
162 | # ports:
163 | # - "50922:10022"
164 | # volumes:
165 | # - "/tmp/.X11-unix:/tmp/.X11-unix"
166 | # environment:
167 | # - DISPLAY=${DISPLAY:-:0.0}
168 | # - GENERATE_UNIQUE=true
169 | # - "MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist"
170 | # image: "sickcodes/docker-osx:latest"
171 | # restart: unless-stopped
172 |
173 | # AutoBangumi:
174 | # image: "ghcr.io/estrellaxd/auto_bangumi:latest"
175 | # container_name: AutoBangumi
176 | # volumes:
177 | # - ./data/AutoBangumi/config:/app/config
178 | # - ./data/AutoBangumi/data:/app/data
179 | # ports:
180 | # - "7892:7892"
181 | # restart: unless-stopped
182 | # dns:
183 | # - 223.5.5.5
184 | # network_mode: bridge
185 | # environment:
186 | # - TZ=Asia/Shanghai
187 | # - PGID=$(id -g)
188 | # - PUID=$(id -u)
189 | # - UMASK=022
190 |
191 | # https://github.com/dockur/windows
192 | windows:
193 | image: dockurr/windows
194 | container_name: windows
195 | devices:
196 | - /dev/kvm
197 | cap_add:
198 | - NET_ADMIN
199 | ports:
200 | - 8006:8006
201 | - 3389:3389/tcp
202 | - 3389:3389/udp
203 | stop_grace_period: 2m
204 | restart: on-failure
205 | environment:
206 | VERSION: "win11"
207 | RAM_SIZE: "4G"
208 | CPU_CORES: "8"
209 |
--------------------------------------------------------------------------------
/scripts/docker/test/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM debian:buster-slim
2 | ARG UPX_VER
3 | ARG UPLOADER_VER
4 | ENV export UPX_VER=${UPX_VER:-4.0.0}
5 | ENV export UPLOADER_VER=${UPLOADER_VER:-v0.9.1}
6 |
7 | RUN
8 | DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
9 | curl \
10 | wget \
11 | git \
12 | build-essential \
13 | zip \
14 | xz-utils \
15 | jq \
16 | ca-certificates \
17 | && rm -rf /var/lib/apt/lists/*
18 |
--------------------------------------------------------------------------------
/scripts/hello.py:
--------------------------------------------------------------------------------
1 | '''
2 | ?: *********************************************************************
3 | Author: Weidows
4 | Date: 2022-03-30 15:58:40
5 | LastEditors: Weidows
6 | LastEditTime: 2023-07-14 01:04:15
7 | FilePath: \Keeper\scripts\hello.py
8 | Description: Hello 图床多线程增量备份脚本
9 |
10 | 命令行启动示例:
11 | python "scripts\hello.py" "username" .\
12 | 参数说明:
13 | 第一个参数: 你的用户名
14 | 第二个参数: 备份路径 (注意末尾带个 '\')
15 |
16 | 注意:
17 | 要在开了代理的终端环境下运行, 否则可能报错
18 | HTTPSConnectionPool(host='www.helloimg.com', port=443): Max retries exceeded
19 | !: *********************************************************************
20 | '''
21 |
22 | from concurrent.futures import ThreadPoolExecutor
23 | import json
24 | import os
25 | import sys
26 | import requests
27 | import threading
28 | import multiprocessing
29 |
30 |
31 | class Utils:
32 | BASE_URL = "https://www.helloimg.com/get-user-images/"
33 |
34 | # D:\Repos\Weidows-projects\Keeper\Programming-Configuration\backup\Weidows
35 | BACKUP_PATH = ""
36 |
37 | # Weidows
38 | USER_NAME = ""
39 |
40 | # 不带 agent 的话会被防火墙拦截: 拒绝非浏览器请求
41 | HEADER = {
42 | 'User-Agent': 'Apifox/1.0.0 (https://www.apifox.cn)',
43 | 'Accept': '*/*',
44 | 'Host': 'www.helloimg.com',
45 | 'Connection': 'keep-alive'
46 | }
47 |
48 | LOCK = threading.Lock()
49 |
50 | DATAS = []
51 |
52 | CPU_COUNT = multiprocessing.cpu_count()
53 |
54 | @staticmethod
55 | def getResponseJson(url, method):
56 | try:
57 | if method == "GET":
58 | # url, headers=Utils.HEADER, verify=False)
59 | responseData = requests.get(url, headers=Utils.HEADER)
60 | elif method == "POST":
61 | responseData = requests.post(url, headers=Utils.HEADER)
62 | return json.loads(responseData.text)
63 | except Exception as e:
64 | print(e)
65 | return None
66 |
67 |
68 | def multi_downloader():
69 | while True:
70 | Utils.LOCK.acquire()
71 | if Utils.DATAS.__len__() == 0:
72 | Utils.LOCK.release()
73 | return
74 | # https://www.helloimg.com/images/2022/02/26/GVROC6.png
75 | url = Utils.DATAS.pop()["image"]
76 | Utils.LOCK.release()
77 |
78 | # 2022-02
79 | date = url[32:39].replace("/", "-")
80 | # GVROC6.png
81 | # 2022-02/GVROC6.png
82 | path = date + '/' + url[43:]
83 |
84 | is_exists = False
85 | if not os.path.exists(path):
86 | if not os.path.exists(date):
87 | os.mkdir(date)
88 | pic = requests.get(url, headers=Utils.HEADER)
89 | with open(path, 'wb') as f:
90 | f.write(pic.content)
91 | f.flush()
92 | else:
93 | is_exists = True
94 |
95 | Utils.LOCK.acquire()
96 | print(
97 | f"{path} is_exists:{is_exists} {threading.current_thread().name} backuped"
98 | )
99 | Utils.LOCK.release()
100 |
101 |
102 | if __name__ == '__main__':
103 | argv = sys.argv[1:]
104 | # argv = [
105 | # "Weidows", "D:/Repos/Weidows-projects/Keeper/Programming-Configuration/backup/"
106 | # ]
107 |
108 | try:
109 | Utils.USER_NAME = argv[0]
110 | Utils.BACKUP_PATH = argv[1] + "hello"
111 | except IndexError:
112 | print("请正确输入参数中: 用户名 备份路径")
113 |
114 | if os.path.exists(Utils.BACKUP_PATH):
115 | print("备份文件夹已存在: " + Utils.BACKUP_PATH)
116 | else:
117 | os.mkdir(Utils.BACKUP_PATH)
118 | os.chdir(Utils.BACKUP_PATH)
119 |
120 | Utils.DATAS = Utils.getResponseJson(Utils.BASE_URL + Utils.USER_NAME,
121 | "GET")
122 |
123 | try:
124 | os.remove("response.json")
125 | except FileNotFoundError:
126 | pass
127 |
128 | with open("response.json", 'wb') as f:
129 | f.write(json.dumps(Utils.DATAS).encode())
130 | f.flush()
131 |
132 | with ThreadPoolExecutor(max_workers=Utils.CPU_COUNT) as executor:
133 | for i in range(Utils.CPU_COUNT):
134 | executor.submit(multi_downloader)
135 |
--------------------------------------------------------------------------------
/scripts/win-flush-icon-cache.bat:
--------------------------------------------------------------------------------
1 | @REM https://www.bilibili.com/video/BV1JK411x7YN/
2 | ::打开图标缓存文件夹
3 | ::cd %localappdata%
4 | cd /d %userprofile%\AppData\Local
5 |
6 | ::删除图标缓存文件
7 | del IconCache.db /a
8 |
9 | ::终止进程资源管理器
10 | taskkill /f /im explorer.exe
11 |
12 | ::启动资源管理器
13 | start explorer.exe
14 |
--------------------------------------------------------------------------------
/utils.bat:
--------------------------------------------------------------------------------
1 | @REM ==================================================================
2 | @REM 速查表: 一些现在没用到但可能会用到的命令
3 | @REM ==================================================================
4 | @REM taskkill /F /IM sharemouse.exe
5 | @REM net stop "ShareMouse Service"
6 | @REM net start "ShareMouse Service"
7 | @REM start /b cmd /c "C:\Program Files (x86)\ShareMouse\ShareMouse.exe"
8 |
9 | @REM ==================================================================
10 | @REM Initialization
11 | @REM ==================================================================
12 | @echo off
13 |
14 | @REM 执行时涉及到中文,cmd 默认按照 GBK/GB2312 解析(VScode强行按UTF-8),所以不开启的话会出现:显示没错但存储时乱码这种问题
15 | chcp 65001
16 |
17 | @REM 设置代理, 不然 hello 图床无法访问报错.
18 | @REM set http_proxy=http://127.0.0.1:7890 & set https_proxy=http://127.0.0.1:7890
19 |
20 | @REM !!!!一定要注意等号'='前后不要加空格!!!!
21 | @REM 备份默认存放在keeper内的 Programming-Configuration, 路径支持含空格
22 | set BACKUP_DIR=
23 | if not defined BACKUP_DIR set BACKUP_DIR=%~dp0Programming-Configuration
24 |
25 |
26 |
27 |
28 | @REM ==================================================================
29 | @REM main入口
30 | @REM ==================================================================
31 | :circle
32 | @REM 清屏
33 | cls
34 |
35 | @REM 改色
36 | set /a COLOR=%random%%%10
37 | color 0%COLOR%
38 |
39 | echo .::::.
40 | echo .::::::::.
41 | echo :::::::::::
42 | echo ..:::::::::::'
43 | echo '::::::::::::'
44 | echo .::::::::::
45 | echo '::::::::::::::..
46 | echo ..::::::::::::.
47 | echo ``::::::::::::::::
48 | echo ::::``:::::::::' .:::.
49 | echo ::::' ':::::' .::::::::.(7)
50 | echo .::::' :::::: .:::::::'::::. (6)
51 | echo .:::' ::::::: .:::::::::' ':::::. (5)
52 | echo .::' ::::::.:::::::::' ':::::. (4)backup
53 | echo .::' :::::::::::::::' ``::::. (3)boot-starter
54 | echo ...::: :::::::::::::' ``::. (2)test / change color
55 | echo ````':. ':::::::::' ::::.. (1)exit
56 | echo 输入选项: '.:::::' ':'```:..
57 | CHOICE /C 12345678
58 | echo =============================================================================
59 |
60 |
61 | if %errorlevel%==1 exit
62 | if %errorlevel%==2 call :test
63 | if %errorlevel%==3 cmd /c %~dp0scripts\booter.bat %BACKUP_DIR%
64 | if %errorlevel%==4 cmd /c %~dp0scripts\backup.bat %BACKUP_DIR%
65 |
66 |
67 | @REM 暂停-查看程序输出-自循环; 视 goto 优先级过高只在 main 中用,其他的 只用 call
68 | pause & goto :circle
69 | goto :eof
70 |
71 |
72 |
73 | @REM ==================================================================
74 | @REM 测试
75 | @REM ==================================================================
76 | :test
77 | echo Testing...
78 | @REM call nvm list
79 | goto :eof
80 |
--------------------------------------------------------------------------------
/utils.sh:
--------------------------------------------------------------------------------
1 | ###
2 | # @?: *********************************************************************
3 | # @Author: Weidows
4 | # @Date: 2022-08-12 18:53:31
5 | # @LastEditors: Weidows
6 | # @LastEditTime: 2023-12-20 23:08:59
7 | # @FilePath: \Blog-privated:\Repos\Weidows-projects\Keeper\utils.sh
8 | # @Description:
9 | # 此文件换行符需要用LF, CRLF是Windows下的
10 | # TODO 迁移 bat 到 sh
11 | # @!: *********************************************************************
12 | ###
13 |
14 | # ==================================================================
15 | # Initialization
16 | # ==================================================================
17 | BACKUP_DIR=
18 | # dirname $0 脚本所在路径
19 | if [ ! "$BACKUP_DIR" ]; then BACKUP_DIR=$(dirname "$0")/Programming-Configuration; fi
20 |
21 | # if [ -d "$HOME/backup" ]; then
22 | # BACKUP_DIR="$HOME/backup"
23 | # else
24 | # BACKUP_DIR="$HOME/backup"
25 | # fi
26 | # if [ ! -d "${BACKUP_DIR}" ]; then
27 | # mkdir -p ${BACKUP_DIR}
28 | # cd ${BACKUP_DIR}
29 |
30 |
31 |
32 |
33 |
34 |
35 | # ==================================================================
36 | # 备份
37 | # ==================================================================
38 | backup (){
39 | mkdir -p "${BACKUP_DIR}" && cd "${BACKUP_DIR}" || exit
40 |
41 | # lists
42 | mkdir lists & cd lists || exit
43 |
44 | # Homebrew
45 | brew list > pkgs/brew-list.bak
46 |
47 | cd ..
48 |
49 |
50 | # 其他
51 | mkdir others & cd others || exit
52 |
53 | cp /etc/hosts hosts/hosts.mac
54 |
55 | cd ..
56 |
57 |
58 | # ~/
59 | mkdir dotfiles & cd dotfiles || exit
60 |
61 | # 会覆盖掉之前的
62 | cp ~/.zshrc .
63 | }
64 |
65 |
66 |
67 |
68 |
69 |
70 | # ==================================================================
71 | # main入口, shell 函数只能定义后调用, 且不调用不执行
72 | # ==================================================================
73 | # backup() 加括号调用会报错
74 | backup
75 |
--------------------------------------------------------------------------------