linux 替换 换行符

linux 替换 换行符 cat out | python -c "import sys; print sys.stdin.read().replace('.\n','.')" http://slash4.net/blog/python/sed-replace-newline-or-python-awk-tr-perl-xargs.html http://slash4.net/blog/python/sed-replace-newline-or-python-awk-tr-perl-xargs.html/embed#?secret=fepFl2MtVM

2018-10-10 · 1 min · 14 words · -

linux tools

linux tools Linux Performance Observability Tools https://hub.docker.com/r/nicolaka/netshoot https://linuxtools-rst.readthedocs.io/zh_CN/latest/tool/ldd.html ldd 作用: 用来查看程式运行所需的共享库,常用来解决程式因缺少某个库文件而不能运行的一些问题。 示例: 查看test程序运行所依赖的库: /opt/app/todeav1/test$ldd test libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00000039a7e00000) libm.so.6 => /lib64/libm.so.6 (0x0000003996400000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00000039a5600000) libc.so.6 => /lib64/libc.so.6 (0x0000003995800000) /lib64/ld-linux-x86-64.so.2 (0x0000003995400000)

2018-10-09 · 1 min · 33 words · -

PolarSSL, mbed-TLS、 SSL、 OpenSSL、TLS的区别

PolarSSL, mbed-TLS、 SSL、 OpenSSL、TLS的区别 https://blog.csdn.net/crjmail/article/details/79097348 一、关于PolarSSLmbed TLS (以前称为PolarSSL) 是TLS和SSL协议的实现,并且需要相应的加密算法和支持代码。这是双重许可与Apache许可证 2.0版 (与GPLv2许可也可) 。网站上指出,mbed TLS的目标是"易于理解,使用,集成和扩展"核心SSL 库用C编程语言编写,并实现SSL模块,基本加密功能并提供各种实用功能。与OpenSSL和TLS的其他实现不同,mbed TLS设计为适合小型嵌入式设备,最小完整的TLS堆栈需要60KB的程序空间和64KB的RAM。它也是高度模块化的: 每个组件,如加密函数,可以独立于框架的其余部分使用。版本也可用于Microsoft Windows和Linux。因为mbed TLS是用C编程语言编写的,没有外部依赖,PolarSSL的后期版本超过1.3.0,为内核分配和线程添加抽象层,以"支持与现有嵌入式操作系统的更好集成"——机器翻译的凑合着看。想看原版的自行Wikii现在叫MbedTSL,PolarSSL源码,也许是最小巧的ssl代码库。高效、便于移植和集成。尤其适合嵌入式应用。也就是说,无论是嵌入式还是桌面软件版的编程,只要你用的到AES,RSA等加密算法,你都可以直接拿过来源码放进你的工程中,进行编译管理,不用带着DLL,或者必须安装一些不必要的库,并且算法是标准库,所以你懂得。并且OpenSource。二、什么是OpenSSLOpenSSL 是一个强大的安全 socket 层密码库,囊括主要的密码算法、常用的密钥和证书封装管理功能及SSL协议,并提供丰富的应用程序供测试或其它目的使用。OpenSSL整个软件包大概可以分成三个主要的功能部分:SSL协议库、应用程序以及密码算法库。OpenSSL的目录结构自然也是围绕这三个功能部分进行规划的。作为一个基于密码学的安全开发包,OpenSSL提供的功能相当强大和全面,囊括了主要的密码算法、常用的密钥和证书封装管理功能以及SSL协议,并提供了丰富的应用程序供测试或其它目的使用。三、什么是SSLSSL是Secure Sockets Layer(安全套接层协议)的缩写,可以在Internet上提供秘密性传输。网景Netscape公司在推出第一个Web浏览器的同时,提出了SSL协议标准。其目标是保证两个应用间通信的保密性和可靠性,可在服务器端和用户端同时实现支持。已经成为Internet上保密通讯的工业标准。安全套接层协议能使用户/服务器应用之间的通信不被攻击者窃听,并且始终对服务器进行认证,还可选择对用户进行认证。SSL协议要求建立在可靠的传输层协议(TCP)之上。SSL协议的优势在于它是与应用层协议独立无关的,高层的应用层协议(例如:HTTP,FTP,TELNET等)能透明地建立于SSL协议之上。SSL协议在应用层协议通信之前就已经完成加密算法、通信密钥的协商及服务器认证工作。在此之后应用层协议所传送的数据都会被加密,从而保证通信的私密性。通过以上叙述,SSL协议提供的安全信道有以下三个特性:1 数据的保密性信息加密就是把明码的输入文件用加密算法转换成加密的文件以实现数据的保密。加密的过程需要用到密钥来加密数据然后再解密。没有了密钥,就无法解开加密的数据。数据加密之后,只有密钥要用一个安全的方法传送。加密过的数据可以公开地传送。2 数据的完整性加密也能保证数据的一致性。例如:消息验证码(MAC),能够校验用户提供的加密信息,接收者可以用MAC来校验加密数据,保证数据在传输过程中没有被篡改过。3 安全验证加密的另外一个用途是用来作为个人的标识,用户的密钥可以作为他的安全验证的标识。SSL是利用公开密钥的加密技术(RSA)来作为用户端与服务器端在传送机密资料时的加密通讯协定。四、SSL和TLS的区别SSL: (Secure Socket Layer,安全套接层协议) ,SSL协议位于TCP/IP协议与各种应用层协议之间,为数据通讯提供安全支持。SSL通过互相认证、使用数字签名确保完整性、使用加密确保机密性,以实现客户端和服务器之间的安全通讯。该协议由两层组成: SSL记录协议和SSL握手协议。Secure Socket Layer是Netscape于1994年开发的,目前有三个版本: SSL2.0、SSL3.0、SSL3.1,最常用的是1995年发布的第3版,已被广泛地用于Web浏览器与服务器之间的身份认证和加密数据传输。TLS: (Transport LayerSecurity,传输层安全协议),是IETF(工程任务组)制定的一种新的协议,它建立在SSL 3.0协议规范之上,是SSL 3.0的后续版本,目前有TLS 1.0,TLS1.1,TLS1.2等版本。 本文来自 crjmail 的CSDN 博客 ,全文地址请点击: https://blog.csdn.net/crjmail/article/details/79097348?utm_source=copy

2018-10-09 · 1 min · 45 words · -

pam config

pam config pam模块文件内容看,可以将pam配置文件分为四列, 第一列代表模块类型 第二列代表控制标记 第三列代表模块路径 第四列代表模块参数 Module_type 将为 Service_name 字段中的相应服务指定模块类型 (auth/account/session/passwd) 。 Control_flag 将指定模块的堆栈行为。它可以获取诸如 requisite、required、sufficient 和 optional 之类的值。 Module_path 将指定实现模块的库对象的路径名称。默认情况下,它将被设为 /lib/security。 Module_options/module_args (可选字段) 将指定可以传递给服务模块的选项或实参。 PAM模块接口(模块管理组) PAM为认证任务提供四种类型可用的模块接口,它们分别提供不同的认证服务: auth 表示鉴别类接口模块类型用于检查用户和密码,并分配权限; 这种类型的模块为用户验证提供两方面服务。让应用程序提示用户输入密码或者其他标记,确认用户合法性;通过他的凭证许可权限,设定组成员关系或者其他优先权。 account 表示账户类接口,主要负责账户合法性检查,确认帐号是否过期,是否有权限登录系统等; 这种模块执行的是基于非验证的帐号管理。他主要用于限制/允许用户对某个服务的访问时间,当前有效的系统资源 (最多可以多少用户) ,限制用户位置 (例如: root只能通过控制台登录) 。 多数情况下auth和account会一起用来对用户登录和使用服务的情况进行限制。这样的限制会更加完整。比如下面是一个具体的例子: login是一个应用程序。Login要完成两件工作——首先查询用户,然后为用户提供所需的服务,例如提供一个shell程序。通常Login要求用户输入名称和密码进行验证。当用户名输入的时候,系统自然会去比对该用户是否是一个合法用户,是否在存在于本地或者远程的用户数据库中。如果该账号确实存在,那么是否过期。这些个工作是由account接口来负责。 如果用户满足上述登录的前提条件,那么它是否具有可登录系统的口令,口令是否过期等。这个工作就要由auth接口来负责了,他通常会将用户口令信息加密并提供给本地 (/etc/shadow) 或者远程的(ldap,kerberos等)口令验证方式进行验证。 如果用户能够登录成功,证明auth和account的工作已经完成。但整个验证过程并没有完全结束。因为还有一些其他的问题没有得到确认。例如,用户能够在服务器上同时开启多少个窗口登录,用户可以在登录之后使用多少终端多长时间,用户能够访问哪些资源和不能访问哪些资源等等。也就是说登录之后的后续验证和环境定义等还需要其他的接口。这就是我们下面要提到的两组接口: password 口令类接口。控制用户更改密码的全过程。也就是有些资料所说的升级用户验证标记。 session - 会话类接口。实现从用户登录成功到退出的会话控制;处理为用户提供服务之前/后需要做的些事情。包括: 开启/关闭交换数据的信息,监视目录等,设置用户会话环境等。也就是说这是在系统正式进行服务提供之前的最后一道关口。 单个PAM库模块可以提供给任何或所有模块接口使用。例如,pam_unix.so提供给四个模块接口使用。 auth required pam_env.so //登录后的环境变量。 auth sufficient pam_fprintd.so //指纹认证。 auth sufficient pam_unix.so nullok try_first_pass //验证用户密码的有效性。如果使用nullok参数,用户不输入密码就可以获得系统提供的服务。同时,也允许用户密码为空时更改用户密码。try_first_pass尝试在提示用户输入密码前,使用前面一个堆叠的auth模块提供的密码认证用户。 auth requisite pam_succeed_if.so uid >= 500 quiet //允许uid大于500的用户在通过密码验证的情况下登录。 ...

2018-10-08 · 1 min · 211 words · -

创建/删除tun/tap设备

创建/删除tun/tap设备 ip tuntap add dev tun0 mode tun ip tuntap add dev tap0 mode tap ip tuntap del dev tun0 mode tun #for detail ip tuntap help https://my.oschina.net/dangzy/blog/221893

2018-10-06 · 1 min · 28 words · -

nftable, nft basic, nft commands

nftable, nft basic, nft commands 安装 nftables archlinux sudo pacman -S nftables sudo systemctl start nftables sudo systemctl enable nftables sudo systemctl status nftables centos 8 systemctl disable --now firewalld 表, table # 列出所有表 nft list tables # 列出某一个族的表 # 列出 inet 族的表 nft list tables inet # 列出 ip 族的表 nft list tables ip # 列出 table0 表的内容 nft list table ip table0 nft list table table0 # list table content with handle nft -a list table filter # 增加表, Adding tables # 命令行 # nft add table [family] <name> nft add table ip table0 # 族可以不写, 默认簇: ip nft add table table0 # 删除 ip 族的 table0 表 nft delete table ip table0 # 默认 ip 族 nft delete table table0 链, chain # 查看 table 的内容, 能看到 Table 里的 链 nft list table table0 # 创建链 # 创建一个常规链 # 将名为 chain0 的常规链添加到 ip 簇(默认) 中名为 table0 的表中 nft add chain table0 chain0 # 创建一个基本链 # nft add chain [<family>] <chain-name> { type <type> hook <hook> priority <value> \; [policy <policy>] } # 要和hook (钩子) 相关连 nft add chain table0 chain0 { type filter hook input priority 0 \; } nft add chain table0 chain0 { type filter hook output priority 0 \; } nft add chain ip table0 chain1 { type filter hook input priority 0\; } nft add chain table0 chain1 { type filter hook input priority 0\; } nft add chain table0 chain2 { type filter hook output priority 0\; } # 将默认表中的 input 链策略从 accept 更改为 drop nft chain ip table0 input { policy drop \; } 规则, rule # 列出所有规则 nft list ruleset # nft add rule [<family>] <table> <chain> <matches> <statements> # 添加一条规则把源端口是 1025 的包丢掉 # family = ip # table = table0 # chain = chain0 # matches = tcp sport 1025 drop nft add rule table0 chain0 tcp sport 1025 drop nft add rule table0 chain0 tcp dport 1025 drop nft add rule inet table0 chain0 tcp dport ssh accept nft replace rule [<family>] <table> <chain> [handle <handle>] <matches> <statements> nft replace rule ip table0 chain0 tcp sport 1025 drop nft replace rule table0 chain1 handle 4 tcp sport 1025 drop # list table content with handle nft -a list table table0 # nft delete rule [<family>] <table> <chain> [handle <handle>] nft delete rule ip table0 chain0 handle 2 # 清空所有规则, 清空所有 table, chain, rule nft flush ruleset 查 # 列出 ip 族 foo 表的内容 nft list table ip foo # 列出 foo 表的内容 nft list chain filter input # 列出 filter 表 input 链 增 增加表, Adding tables 命令行 ...

2018-10-05 · 3 min · 553 words · -

aliyun docker

aliyun docker https://cr.console.aliyun.com/cn-qingdao/mirrors 安装/升级Docker客户端 推荐安装1.10.0以上版本的Docker客户端,参考文档 docker-ce 配置镜像加速器 针对Docker客户端版本大于 1.10.0 的用户 您可以通过修改 daemon 配置文件 /etc/docker/daemon.json 来使用加速器 sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json «-‘EOF’ { “registry-mirrors”: [“https://xxxxxx.mirror.aliyuncs.com”] } EOF sudo systemctl daemon-reload sudo systemctl restart docker

2018-10-03 · 1 min · 35 words · -

golang程序在windows上,注册为服务

golang 程序在windows上,注册为服务 https://blog.csdn.net/yang8023tao/article/details/53332984 package main import ( "log" "net/http" "os" "github.com/jander/golog/logger" "github.com/kardianos/service" ) type program struct{} func (p *program) Start(s service.Service) error { go p.run() return nil } func (p *program) run() { // 代码写在这儿 } func (p *program) Stop(s service.Service) error { return nil } /** * MAIN函数,程序入口 */ func main() { svcConfig := &service.Config{ Name: "", //服务显示名称 DisplayName: "", //服务名称 Description: "", //服务描述 } prg := &program{} s, err := service.New(prg, svcConfig) if err != nil { logger.Fatal(err) } if err != nil { logger.Fatal(err) } if len(os.Args) > 1 { if os.Args[1] == "install" { s.Install() logger.Println("服务安装成功") return } if os.Args[1] == "remove" { s.Uninstall() logger.Println("服务卸载成功") return } } err = s.Run() if err != nil { logger.Error(err) } } 注册服务步骤 ...

2018-09-30 · 1 min · 133 words · -

visualbox share folder

visualbox share folder https://www.jianshu.com/p/21df1811133f 1.Windows创建一个共享文件 保存好目录,我的是D:\ virtualbox_share 2.打开共享文件夹选项 3.配置共享文件夹 选择固定分配,共享文件夹选择Windows的共享目录,我的是D:\ virtualbox_share。 共享文件夹名称,是你Ubuntu的共享文件夹名称,我的是virtualbox_share。 自动挂载,不要打钩,重点! 4.挂载: 新建Ubuntu共享文件夹: mkdir/mnt/share 挂载命 sudo mount -t vboxsf [你的windows共享目录] [Ubuntu共享目录] 我是的: sudo mount -t vboxsfvirtualbox_share /mnt/share/ 完成后,进入cd /mnt/share会看到你Windows共享的目录 5.实现开机自动挂载: 在sudo gedit /etc/fstab文件末添加一项: <共享名称> < Ubuntu共享目录> vboxsf defaults 0 0 我的是: virtualbox_share /mnt/share/ vboxsf defaults 0 0 网上说的填入 sharing /mnt/sharevboxsf defaults 0 0是错的,会导致开机时候不能进入桌面的!前面应该填入的是<共享名称>! 最后可参考askubuntu.com/questions/252853/how-to-mount-a-virtualbox-shared-folder-at-startup,还是google搜索出来的解决方法靠谱 作者: Janny238 链接: https://www.jianshu.com/p/21df1811133f 來源: 简书 简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

2018-09-30 · 1 min · 63 words · -

5W1H

5W1H 5W1H 分析法是我们工作中经常被使用到的方法, 但是, 你知道 5W1H 法是怎样产生的吗? 5W 5W1H 的前身是 5W 模式, 这个模式是 1948 年美国著名政治学家、传播学奠基者哈罗德·拉斯维尔 (Harold .Lasswell) 在他的论文《传播在社会中的结构与功能》中提出。在这篇论文中,拉斯维尔提出了沟通的一般模式,即"什么人说什么, 由什么路线传至什么人,达到什么结果。" 这个模式中产生了五大传播要素: Who: 谁 What: 说什么 Which: 通过什么渠道 Whom: 给谁 What effect: 取得什么效果 这被许多沟通和公共关系学者称为"最早和最具影响力之一的通信模式"。在传播学史上,第一次比较详细、科学的分解了传播的过程,为传播学搭建了一个比较完整、全面的理论构架,从而使传播学的最终确立成为可能。 做为一种沟通模式,“5W"无疑为人们提供了非常好结构性思考框架。而这一模式可以运用于各种类型的信息沟通活动中,使沟通者按照沟通目的以及沟通过程模式提供的因素进行选择,并设计沟通过程与沟通方式。于是,经过不断演化形成了今天我们所看到的5W1H分析法或5W2H分析法。 5W1H 分析法 Why: 目的、原因 What: 对象, 做什么 Where: 地点, 在哪做、从哪里入手 When: 什么时候做、什么时间完成 Who: 人员, 谁来完成、由谁承担 How: 方法, 怎么做、方法怎样 5W2H 分析法 Why What Where When Who How How mach: 花费多少、做到什么程度 这两种最常见的沟通模式中, 5W2H 模式所提供的要素最齐全, 适用于"任何事”。让我们来看看在不同的场景中是如何发挥作用的。 汇报工作: 和谁 (who) 用了什么方法 (how) 做了什么事情 (what) 到了什么程度 (how much) ,期间遇到什么问题 (what problem) ,准备怎么解决 (how) ,预计完成时间 (when) 。 ...

2018-09-29 · 1 min · 123 words · -

resolv.conf, search, domain, nameserver, DNS

‘resolv.conf, search, domain, nameserver, DNS’ http://www.ttlsa.com/linux/resolv-conf-desc/ resolv.conf 是 resolver 类库使用的配置文件, 每当一个程序需要通过域名来访问 internet 上面的其它主机时, 需要利用该类库将域名转换成对应的IP, 然后才可进行访问. resolv.conf 文件的配置选项不多, 从 man 文档中看了半天,不理解 domain 和 search 使用来干嘛的。 这里做个解释, 防止以后忘了 (环境: ubuntu12.04) : nameserver x.x.x.x 该选项用来制定 DNS 服务器的, 可以配置多个 nameserver 指定多个 DNS。 domain mydomain.com 这个用来指定本地的域名, 在没有设置 search 的情况下, search 默认为 domain 的值。 这个值可以随便配, 目前在我看来, domain 除了当 search 的默认值外, 没有其它用途。也就说一旦配置 search, 那 domain 就没用了。 search google.com baidu.com 该选项可以用来指定多个域名,中间用空格或tab键隔开。它是干嘛的呢? 如: 在没有配置该选项时,执行 ping new sping: unknown host news ...

2018-09-25 · 1 min · 169 words · -

裴讯N1

裴讯N1 斐讯N1折腾记: 降级及刷入官改 https://forum.khadas.com/t/burning-tools-for-linux-pc/1832 https://github.com/khadas/utils

2018-09-25 · 1 min · 5 words · -

centos audit.log

centos audit.log ansible all -m yum -a 'name=audit state=present' ansible all -m yum -a 'name=audit-libs state=present' ansible all -m service -a 'name=auditd state=restarted'

2018-09-25 · 1 min · 23 words · -

Execute bash script from URL

Execute bash script from URL bash <(curl -s http://mywebsite.com/myscript.txt) curl -s https://myurl.com/script.sh | bash /dev/stdin param1 param2 Directly run bash scripts in Github Gists locally in Terminal. Get the raw version of it and copy the link. Now we are going to curl that link to get the content in the file and then pass that content to bash. https://stackoverflow.com/questions/5735666/execute-bash-script-from-url

2018-09-24 · 1 min · 60 words · -

redis docker

redis docker podman run \ -d \ --name redis \ -p 6379:6379 \ -v /etc/localtime:/etc/localtime:ro \ redis docker run -it --rm redis redis-cli -c -h 192.168.1.xxx #创建并启动容器 sudo docker run --name redis-x -p 6379:6379 -d redis #启动 sudo docker start redis-x sudo docker exec -it redis-x redis-cli http://www.runoob.com/docker/docker-install-redis.html

2018-09-21 · 1 min · 48 words · -

tomcat autoDeploy="false" deployOnStartup="false"

’tomcat autoDeploy=“false” deployOnStartup=“false”' https://stackoverflow.com/questions/26884335/tomcat-deploy-only-manager-on-startup From the Apache 6 documentation: https://tomcat.apache.org/tomcat-6.0-doc/config/context.html in the Attributes section of Context, the documentation for the path attribute specifies: This attribute must only be used when statically defining a Context in server.xml. In all other circumstances, the path will be inferred from the filenames used for either the .xml context file or the docBase. Even when statically defining a Context in server.xml, this attribute must not be set unless either the docBase is not located under the Host’s appBase or both deployOnStartup and autoDeploy are false. If this rule is not followed, double deployment is likely to result. ...

2018-09-19 · 1 min · 126 words · -

Archlinux, Pixelbook, chromeos, Crostini

Archlinux, Pixelbook, chromeos, Crostini https://wiki.archlinux.org/title/Chromebook_Pixel_2 https://wiki.archlinux.org/index.php/Chrome_OS_devices/Crostini Enabling Linux support Settings > Linux > Enable Delete the Debian container (optional) vmc destroy termina vmc start termina Install an Arch linux container Open a new terminal in Chrome (Ctrl + Alt + T) vmc container termina arch https://us.images.linuxcontainers.org archlinux/current vsh termina lxc list lxc exec arch -- bash passwd $(grep 1000:1000 /etc/passwd|cut -d':' -f1) pacman -S sudo visudo # Uncomment this line: %wheel ALL=(ALL) ALL usermod -aG wheel $(grep 1000:1000 /etc/passwd|cut -d':' -f1) exit lxc console arch # enter user name root ip -4 a show dev eth0 # config arch pacman mirror # install yay yay -S cros-container-guest-tools-git sudo pacman -S wayland sudo pacman -S xorg-server-xwayland # 第一次执行如果报错,尝试停掉container重启 lxc stop arch lxc start arch systemctl --user enable sommelier@0 systemctl --user enable sommelier-x@0 systemctl --user start sommelier@1 systemctl --user start sommelier-x@1 systemctl --user status sommelier@0 systemctl --user status sommelier@1 systemctl --user status sommelier-x@0 systemctl --user status sommelier-x@1 lxc stop --force arch lxc stop --force penguin lxc rename penguin debian lxc rename arch penguin lxc start penguin https://tedyin.com/posts/archlinux-on-pixelbook/ ...

2018-09-08 · 2 min · 274 words · -

dnsmasq config 配置

‘dnsmasq config 配置’ DNSmasq是一个小巧且方便地用于配置DNS和DHCP的工具,适用于小型网络。它提供了DNS功能和可选择的DHCP功能可以取代dhcpd(DHCPD服务配置)和bind等服务,配置起来更简单,更适用于虚拟化和大数据环境的部署。 检查一下no-hosts前面是不是已经有了#号,默认的情况下是有的,dnsmasq 会首先寻找本地的 hosts 文件再去寻找缓存下来的域名, 最后去上游dns 服务器寻找。 install ubuntu apt install dnsmasq docker docker run \ --name dnsmasq \ -d \ -p 30053:53/udp \ -p 35380:8080 \ -v dnsmasq-config:/etc/dnsmasq.conf \ --log-opt "max-size=100m" \ -e "HTTP_USER=foo" \ -e "HTTP_PASS=bar" \ --restart always \ jpillora/dnsmasq docker run \ -d \ --name dnsmasq \ --cap-add=NET_ADMIN \ -p 53:53/udp \ -v /etc/localtime:/etc/localtime:ro \ -v dnsmasq-config:/etc/dnsmasq.d \ --restart=always \ andyshinn/dnsmasq mkdir /etc/dnsmasq.d echo 'conf-dir=/etc/dnsmasq.d' >> /etc/dnsmasq.conf http://debugo.com/dnsmasq/ dhcp服务 其中一些关键的配置如下,配置文件/etc/dnsmasq.conf 中的注释已经给出了非常详细的解释。 vim /etc/dnsmasq.conf # 配置上游服务器地址 # resolv-file配置Dnsmasq额外的上游的DNS服务器,如果不开启就使用Linux主机默认的/etc/resolv.conf里的nameserver。 # 通过下面的选项指定其他文件来管理上游的DNS服务器 resolv-file=/etc/resolv.dnsmasq.conf # 服务监听的网络接口地址 # If you want dnsmasq to listen for DHCP and DNS requests only on # specified interfaces (and the loopback) give the name of the # interface (eg eth0) here. # Repeat the line for more than one interface. #interface= # Or you can specify which interface _not_ to listen on #except-interface= # Or which to listen on by address (remember to include 127.0.0.1 if # you use this.) listen-address=192.168.97.1,127.0.0.1 # dhcp动态分配的地址范围 # Uncomment this to enable the integrated DHCP server, you need # to supply the range of addresses available for lease and optionally a lease time dhcp-range=192.168.97.10,192.168.97.20,48h # dhcp服务的静态绑定 # Always set the name and ipaddr of the host with hardware address # dhcp-host=00:0C:29:5E:F2:6F,192.168.1.201 # dhcp-host=00:0C:29:5E:F2:6F,192.168.1.201,infinite 无限租期 dhcp-host=00:0C:29:5E:F2:6F,192.168.97.201,os02 dhcp-host=00:0C:29:15:63:CF,192.168.97.202,os03 vim /etc/resolv.dnsmasq.conf nameserver 223.5.5.5 nameserver 223.6.6.6 DNSMasq支持泛域名,比如在hosts中需要配2000条 apple app store ...

2018-09-07 · 2 min · 324 words · -

archlinux clean

archlinux clean # pacman 缓存 目录 /var/cache/pacman/pkg # 查看缓存目录大小 du -sh /var/cache/pacman/pkg # remove cached packages that are not currently installed pacman -Sc # remove all files from the cache pacman -Scc # 定时删除 pacman 缓存 pacman -S pacman-contrib # dry run paccache -d # 软件包保留最近的两个版本 paccache -dk2 paccache -rk2 # 删除已经卸载的软件包 paccache -ruk0 # 启用 paccache timer 每周清理 systemctl enable paccache.timer pacman -Qtdq du -sh ~/.cache du -sh ~/.config du -sh ~/.local/share # clean Trash pacman -S rmlint rmlint /home/wiloon # 命令行的磁盘空间管理工具 pacman -S ncdu # 图形化的磁盘空间管理工具 pacman -S filelight https://bynss.com/linux/471439.html ...

2018-09-03 · 1 min · 122 words · -

vscode basic,vscode, visual studio code

vscode basic,vscode, visual studio code linux vscode 配置 echo "--enable-features=UseOzonePlatform --ozone-platform=wayland" >> ~/.config/code-flags.conf debian install visual studio code install from repo https://linuxize.com/post/how-to-install-visual-studio-code-on-debian-9/ download deb https://code.visualstudio.com/# vscode 列编辑 Alt+Shift+鼠标左键拖动, 选中拖动的区域内容 https://blog.csdn.net/u011127019/article/details/74039598 vscode remote ssh, A> ssh> B A 安装插件 “Remote - SSH” 在 B 主机上配置ssh 公钥 私钥放在 C:\Users\user0\.ssh 里 A, 点击 vscode左下角,选择 remote-ssh: connect to host 字体 打开 VSCode,Windows 下按 Ctrl + ,,macOS 下按 Cmd + ,,进入设定。在上方搜索框搜索 editor.fontFamily,在 Editor: Font Family Controls the font family. 下方的框框填入 font-family 即可。 ...

2018-09-01 · 2 min · 302 words · -