forked from hugcabbage/shared-lede
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
812c18c
commit 6bce7ee
Showing
25 changed files
with
226 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: clean workflow runs | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
period: | ||
description: "the amount of days to hold" | ||
default: "0" | ||
required: false | ||
repo: | ||
required: false | ||
|
||
jobs: | ||
clean-logs: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: write | ||
steps: | ||
- uses: dmvict/clean-workflow-runs@v1 | ||
with: | ||
save_period: ${{ inputs.period}} | ||
save_min_runs_number: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
**/__pycache__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
PyYAML~=6.0 | ||
PyYAML~=6.0 | ||
py-purecrypt~=0.0.3 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# 生成密文凭证 | ||
def crypt_root(plaintext): | ||
import time | ||
from purecrypt import Crypt, Method | ||
salt = Crypt.generate_salt(Method.MD5) | ||
ciphertext = Crypt.encrypt(plaintext, salt).replace('\\', '\\\\') | ||
part1 = 'root' | ||
part2 = ciphertext | ||
part3 = int(time.time()) // 86400 | ||
part_end = '0:99999:7:::' | ||
login_cred = f'{part1}:{part2}:{part3}:{part_end}' | ||
return login_cred |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# 执行终端命令,形参为各文件路径 | ||
def gen_dot_config(clone: str, config: str): | ||
import subprocess | ||
commands = [ | ||
f'chmod +x {clone} && ./{clone}', | ||
'./scripts/feeds update -a && ./scripts/feeds install -a', | ||
f'mv -f {config} .config && make defconfig', | ||
f'cp -f .config {config}' | ||
] | ||
for cmd in commands: | ||
subprocess.run(cmd, shell=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# 简化.config,仅保留应用和主题 | ||
def simplify_config(file: str, *, backup=True, remain_text=None): | ||
inxheader = () | ||
inxapp = () | ||
inxtheme = () | ||
header_flag = True | ||
with open(file) as f: | ||
text = f.readlines() | ||
if backup: | ||
with open(file + '.fullbak', 'w') as f: | ||
f.writelines(text) | ||
for (index, value) in enumerate(text): | ||
if value.startswith('CONFIG_TARGET') and '=y' in value and header_flag: | ||
inxheader += (index,) | ||
if len(inxheader) == 3: | ||
header_flag = False | ||
elif '. Applications' in value: | ||
inxapp += (index,) | ||
elif '. Themes' in value: | ||
inxtheme += (index,) | ||
header = ['# Target\n'] | ||
for i in inxheader: | ||
header += [text[i]] | ||
apps = list(filter(lambda x: x.strip('#\n') and '# Configuration' not in x and '# end of' not in x, text[inxapp[0]:inxapp[1]])) | ||
apps = list(map(lambda x: '# Applications\n' if '. Applications' in x else x, apps)) | ||
themes = list(filter(lambda x: x.strip('#\n') and '# end of' not in x, text[inxtheme[0]:inxtheme[1]])) | ||
themes = list(map(lambda x: '# Themes\n' if '. Themes' in x else x, themes)) | ||
for part in header, apps: | ||
part.append('\n') | ||
if remain_text: | ||
remain_text.append('\n') | ||
text = header + remain_text + apps + themes | ||
else: | ||
text = header + apps + themes | ||
with open(file, 'w') as f: | ||
f.writelines(text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.