上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 55 下一页
摘要: --is-inside-work import subprocess, os repo_dir = os.path.expanduser('~/git/dchelper') command = ['git', 'rev-parse', '--is-inside-work-tree'] process 阅读全文
posted @ 2022-10-26 23:35 ascertain 阅读(41) 评论(0) 推荐(0) 编辑
摘要: Disable screen lock: Settings -> Privary -> Screen Lock -> Disable cursor blinking: Method 1: Turn on/off Blinking Cursor via GNOME Settings Settings 阅读全文
posted @ 2022-10-20 20:27 ascertain 阅读(15) 评论(0) 推荐(0) 编辑
摘要: ProxyCommand: 阅读全文
posted @ 2022-10-17 12:42 ascertain 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 向处于CLOSE_WAIT的socket发送数据是OK的, 向CLOSED状态的socket发数据触发,BrokenPipeError, 此时fd没有被释放,client此socket没有close, 调用close后, lsof显示连接被释放, 在调用send时, 报OSError 阅读全文
posted @ 2022-10-16 20:29 ascertain 阅读(27) 评论(0) 推荐(0) 编辑
摘要: history相关环境变量 HISTIGNORE export HISTIGNORE='pwd:ls:ls -l:exit' will not log command pwd ls, ls -a会记录, 即加参数会记录 HISTCONTROL export HISTCONTROL='ignoredu 阅读全文
posted @ 2022-10-16 18:20 ascertain 阅读(24) 评论(0) 推荐(0) 编辑
摘要: __format__ 在format(object,format_spec:str), f-string, ''.format()生效 format_spec [[fill]align][sign][#][0][minimumwidth][.precision][type] class Superf 阅读全文
posted @ 2022-10-12 10:22 ascertain 阅读(23) 评论(0) 推荐(0) 编辑
摘要: groupby: import typing, operator, itertools class GroupBy: def __init__(self, iterable: typing.Iterable, key=None): if key is None: key = lambda v: v 阅读全文
posted @ 2022-10-10 13:41 ascertain 阅读(33) 评论(0) 推荐(0) 编辑
摘要: echo $(id -nu):amortize | chpasswd # current user echo parallels:amortize | chpasswd # specific user 阅读全文
posted @ 2022-10-04 20:17 ascertain 阅读(83) 评论(0) 推荐(0) 编辑
摘要: Linux: source /etc/bash_completion.d/git souirce /usr/share/bash-completion/completions/git apt-get install git-core bash-completion source "$(pkg-con 阅读全文
posted @ 2022-10-02 23:19 ascertain 阅读(43) 评论(0) 推荐(0) 编辑
摘要: wc -l will not count a final "line" if it doesn't end with a newline. Because a file (or stream) of zero lines can be distinguished from a file of one 阅读全文
posted @ 2022-10-02 02:54 ascertain 阅读(21) 评论(0) 推荐(0) 编辑
摘要: ClientAliveInterval 60 ClientAliveCountMax 2TCPKeepAlive yes ClientAliveInterval: Sets a timeout interval in seconds after which if no data has been r 阅读全文
posted @ 2022-09-30 15:00 ascertain 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 1.通过进程替换 #!/bin/bash expect <(cat <<-delimiter set timeout 3 spawn ssh -l root 192.168.8.12 expect { "password" { send "exuberant\n" } } interact deli 阅读全文
posted @ 2022-09-28 19:34 ascertain 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 函数 #!/bin/bash function b(){ for i in `seq 1 $2`;do echo -n "$1" done } b = 1 printf printf '=%.0s' {1..10} printf %10s | tr ' ' = seq tr seq -s= 10 | 阅读全文
posted @ 2022-09-28 17:28 ascertain 阅读(66) 评论(0) 推荐(0) 编辑
摘要: dchelper.sh #!/bin/bash # global variables # scriptDir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) scriptDir='' repositoryDir='' devopsHost='' dbHos 阅读全文
posted @ 2022-09-28 16:06 ascertain 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 1: 修改Windows启动项 bootice EasyBCD EasyUEFI 2: 网络安全 acunetix kubeadm init \ --kubernetes-version=v1.21.3 \ --apiserver-advertise-address=192.168.8.11 \ - 阅读全文
posted @ 2022-09-28 12:31 ascertain 阅读(229) 评论(0) 推荐(0) 编辑
摘要: sshd: ~/.ssh/environment client连接进来时, 会有此环境变量, sshd必须设置PermitUserEnvironment yes, 默认no client发送本地session的环境变量至sshd /etc/ssh/sshd_config /etc/ssh/ssh_c 阅读全文
posted @ 2022-09-28 11:56 ascertain 阅读(83) 评论(0) 推荐(0) 编辑
摘要: import os import numpy as np import pandas as pd import string, random def random_string(n: int): return ''.join(random.choices(string.ascii_letters, 阅读全文
posted @ 2022-09-23 06:22 ascertain 阅读(49) 评论(0) 推荐(0) 编辑
摘要: import time def dubious(): print(f"\033[32;40;7m{'dubious start'}\033[0m") while True: send_value = yield if send_value is None: break commence = time 阅读全文
posted @ 2022-09-19 16:11 ascertain 阅读(19) 评论(0) 推荐(0) 编辑
摘要: __slots__ 定义为类属性, 约束实例属性, 类定义__slots__后, 实例就没有__dict__ 子类和父类都定义__slots__后, 子类可有全部__slots__属性 父类存在__slots__,子类没有定义__slots__时, 子类存在__dict__ 定义__slots__后 阅读全文
posted @ 2022-09-19 14:08 ascertain 阅读(16) 评论(0) 推荐(0) 编辑
摘要: super不带任何参数,必须在类中使用, 等价于第一参数为当前类,第二参数为当前函数第一参数(self) super(type) 一个参数时 没什么用, 不能调用任何方法 super(type,type2) requires issubclass(type2,type) 未绑定方法, 以type2的 阅读全文
posted @ 2022-09-16 16:47 ascertain 阅读(15) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 55 下一页