getty相关知识
-
Getty – Java NIO 框架设计与实现原文链接前言Getty是我为了学习 Java NIO 所写的一个 NIO 框架,实现过程中参考了 Netty 的设计,同时使用 Groovy 来实现。虽然只是玩具,但是麻雀虽小,五脏俱全,在实现过程中,不仅熟悉了 NIO 的使用,还借鉴了很多 Netty 的设计思想,提升了自己的编码和设计能力。至于为什么用 Groovy 来写,因为我刚学了 Groovy,正好拿来练手,加上 Groovy 是兼容 Java 的,所以只是语法上的差别,底层实现还是基于 Java API的。Getty 的核心代码行数不超过 500 行,一方面得益于 Groovy 简洁的语法,另一方面是因为我只实现了核心的逻辑,最复杂的其实是解码器实现。脚手架容易搭,摩天大楼哪有那么容易盖,但用来学习 NIO 足以。线程模型Getty 使用的是 Reactor 多线程模型有专门一个 NIO 线程- Acceptor 线程用于监听服务端,接收客户端的 TCP 连接请求,然后将连接分配给工作线程,由工作线程来监听读写事件。网络 IO 操作-读/
-
CentOS下/etc 目录详解/etc目录 包含很多文件.许多网络配置文件也在/etc 中. /etc/rc or/etc/rc.d or/etc/rc*.d 启动、或改变运行级时运行的scripts或scripts的目录. /etc/passwd 用户数据库,其中的域给出了用户名、真实姓名、家目录、加密的口令和用户的其他信息. /etc/fdprm 软盘参数表.说明不同的软盘格式.用setfdprm 设置./etc/fstab 启动时mount -a命令(在/etc/rc 或等效的启动文件中)自动mount的文件系统列表.Linux下,也包括用swapon -a启用的swap区的信息./etc/group 类似/etc/passwd ,但说明的不是用户而是组. /etc/inittab init 的配置文件. /etc/issue getty在登
-
Windows 赢了桌面,而 Linux 赢得整个世界最坚决推行 Linux 桌面系统项目的城市正在转回 Windows 阵营,但 Linux 的命运已经不再与 PC 休戚相关。慕尼黑的 Linux 项目只是开源软件故事中的一小部分 图片: Getty Images/iStockphoto在实施从 Windows 系统迁移到 Linux 系统这一项目接近十年之久后,慕尼黑却突然走上了一条戏剧性的转弯。据说是到 2021 年,该城市的地方议会就会开始用 Windows 10 替换运行 LiMux (Ubuntu 的一种自定义版本)的 PC 机。若是回到 15 或者 20 年前,人们可能会争论什么时候 Linux 将会在桌面上取代 Windows。例如,当 Ubuntu 于 2004 年问世时,它是带着 终结 Windows 的抱负 而被设计为标准的桌面操作系统的。剧透:这一切并没有发生。桌面上的 Linux 在今天占有约为 2% 的市场,很多人都认为它复杂晦涩。与此同时,Windows 则航行无虞,在 PC 市场笑傲群雄,天下十有其九。但在商业领域中总还有些许
-
Mysql中的find_in_set的使用方法介绍使用举例:用户表(user)中的一个字段(purview)代表该用户的权限将用户的所有权限id存入此字段。比如有:1,2,3,4,5这样的五个权限查找哪些用户拥有权限id为1的权限复制代码 代码如下:select * from user where find_in_set('1',purview); sql语句sql解释:查出所有拥有1这个权限的所有用户的信息。这样设计数据表的目的是减少表的数量,但是会增加更新的难度!
getty相关课程
getty相关教程
- 3.3 实现 #!/bin/bash# Description: service check# Auth: kaliarch# Email: kaliarch@163.com# function: sys check# Date: 2020-04-11 14:00# Version: 1.0[ $(id -u) -gt 0 ] && echo "请用root用户执行此脚本!" && exit 1sysversion=$(rpm -q centos-release|cut -d- -f3)line="-------------------------------------------------"[ -d logs ] || mkdir logsservice_check_file="logs/service-`date +%Y%m%d`.txt"# 获取服务信息function get_service_info() { port_listen=$(netstat -lntup|grep -v "Active Internet") kernel_config=$(sysctl -p 2>/dev/null) if [ ${sysversion} -gt 6 ];then service_config=$(systemctl list-unit-files --type=service --state=enabled|grep "enabled") run_service=$(systemctl list-units --type=service --state=running |grep ".service") else service_config=$(/sbin/chkconfig | grep -E ":on|:启用" |column -t) run_service=$(/sbin/service --status-all|grep -E "running") ficat <<EOF服务启动配置:${service_config}${line}运行的服务:${run_service}${line}监听端口:${port_listen}${line}内核参考配置:${kernel_config}EOF}function sys_check() { get_service_info echo ${line}}# 执行主函数将输出重定向到文件中sys_check > ${sys_check_file}# 执行测试[root@xuel-terraform-cvm-0 ~]# bash sys_check.sh[root@xuel-terraform-cvm-0 ~]# cat logs/10.0.1.15-20200329.txt[root@master grep]# cat logs/service-20200411.txt 服务启动配置:auditd.service enabledautovt@.service enabledceph-mon@.service enabledceph-osd@.service enabledchronyd.service enabledcrond.service enableddbus-org.freedesktop.NetworkManager.service enableddbus-org.freedesktop.nm-dispatcher.service enableddocker.service enabledetcd.service enabledgapd.service enabledgetty@.service enabledirqbalance.service enabledkdump.service enabledkubelet.service enabledmicrocode.service enabledNetworkManager-dispatcher.service enabledNetworkManager.service enabledpostfix.service enabledrpcbind.service enabledrsyslog.service enabledsmarteye-server-agent.service enabledsshd.service enabledsystemd-readahead-collect.service enabledsystemd-readahead-drop.service enabledsystemd-readahead-replay.service enabledtuned.service enabled-------------------------------------------------运行的服务:auditd.service loaded active running Security Auditing Serviceceph-mon@master.service loaded active running Ceph cluster monitor daemonceph-osd@0.service loaded active running Ceph object storage daemonchronyd.service loaded active running NTP client/servercrond.service loaded active running Command Schedulerdbus.service loaded active running D-Bus System Message Busdocker.service loaded active running Docker Application Container Engineetcd.service loaded active running etcd docker wrappergapd.service loaded active running guest agent for pitrixgetty@tty1.service loaded active running Getty on tty1gssproxy.service loaded active running GSSAPI Proxy Daemonirqbalance.service loaded active running irqbalance daemonkubelet.service loaded active running Kubernetes Kubelet ServerNetworkManager.service loaded active running Network Managerpolkit.service loaded active running Authorization Managerpostfix.service loaded active running Postfix Mail Transport Agentrpcbind.service loaded active running RPC bind servicersyslog.service loaded active running System Logging Servicesmarteye-server-agent.service loaded active running The Smarteye Monitoring of serversshd.service loaded active running OpenSSH server daemonsystemd-journald.service loaded active running Journal Servicesystemd-logind.service loaded active running Login Servicesystemd-udevd.service loaded active running udev Kernel Device Managertuned.service loaded active running Dynamic System Tuning Daemon-------------------------------------------------监听端口:Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:9099 0.0.0.0:* LISTEN 10444/calico-node tcp 0 0 172.16.60.2:2379 0.0.0.0:* LISTEN 1321/etcd tcp6 0 0 :::9353 :::* LISTEN 2058/node-cache udp 0 0 0.0.0.0:37811 0.0.0.0:* 610/dhclient udp 0 0 169.254.25.10:53 0.0.0.0:* 2058/node-cache udp 0 0 0.0.0.0:68 0.0.0.0:* 610/dhclient udp 0 0 0.0.0.0:111 0.0.0.0:* 1/systemd udp 0 0 0.0.0.0:123 0.0.0.0:* 530/chronyd udp 0 0 127.0.0.1:323 0.0.0.0:* 530/chronyd udp 0 0 0.0.0.0:703 0.0.0.0:* 535/rpcbind udp6 0 0 :::35267 :::* 610/dhclient udp6 0 0 :::111 :::* 1/systemd udp6 0 0 ::1:323 :::* 530/chronyd udp6 0 0 :::703 :::* 535/rpcbind -------------------------------------------------内核参考配置:net.ipv4.ip_forward = 1net.bridge.bridge-nf-call-ip6tables = 1net.bridge.bridge-nf-call-iptables = 1net.ipv4.ip_local_reserved_ports = 30000-32767net.bridge.bridge-nf-call-arptables = 1-------------------------------------------------可以看到利用了一个函数来获取系统的信息,主函数将输出利用重定向方式保存到文件中。
- 2.4 测试 [root@master workspace]# bash sys_check.sh [root@master workspace]# lslogs sys_check.sh[root@master workspace]# cat logs/172.16.60.2-20200419.txt CPU信息:物理CPU个数: 4逻辑CPU个数: 4每CPU核心数: 1CPU型号: QEMU Virtual CPUCPU架构: x86_64-------------------------------------------------内存信息: total used free shared buff/cache availableMem: 16047 12536 179 885 3331 2007Swap: 0 0 0-------------------------------------------------IP信息:系统公网地址: 4x.xxx.xxx.18系统私网地址: 172.16.60.2网关地址: 172.16.60.1MAC地址: 52:54:73:7b:c9:11路由信息:Kernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface0.0.0.0 172.16.60.1 0.0.0.0 UG 100 0 0 eth010.233.88.192 172.16.60.5 255.255.255.192 UG 0 0 0 tunl0172.16.60.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0DNS 信息:nameserver 10.17.50.3nameserver 1.2.4.8-------------------------------------------------磁盘信息:Disk /dev/vda: 21.5 GBDisk /dev/vdb: 8589 MB磁盘使用:Filesystem Type Size Used Avail Use% Mounted on/dev/vda1 ext4 20G 5.0G 14G 27% /devtmpfs devtmpfs 7.9G 0 7.9G 0% /dev/dev/vdc ext4 197G 46G 142G 25% /data/dev/vdd xfs 500G 53G 448G 11% /var/local/osd0inode信息:Filesystem Inodes IUsed IFree IUse% Mounted on/dev/vda1 1.3M 54K 1.2M 5% /devtmpfs 2.0M 398 2.0M 1% /dev/dev/vdc 13M 1.3M 12M 11% /data/dev/vdd 250M 14K 250M 1% /var/local/osd0overlay 13M 1.3M 12M 11% 2c99089efbac12ffc5d7a8f6ccf99d95ab3c1674b441205a61829ebe635/merged系统: GNU/Linux发行版本: CentOS Linux release 7.4.1708 (Core)系统内核: 3.10.0-693.el7.x86_64主机名: masterselinux状态: Permissive系统语言: en_US.UTF-8系统当前时间: Sun Apr 19 12:34:35 CST 2020系统最后重启时间: 2020-03-18 16:15系统运行时间: 31 days系统负载: 1.55, 1.73, 1.95-------------------------------------------------服务启动配置:auditd.service enabledautovt@.service enabledceph-mon@.service enabledetcd.service enabledgapd.service enabledgetty@.service enabledirqbalance.service enabledkdump.service enabledkubelet.service enabledmicrocode.service enabledNetworkManager-dispatcher.service enabledNetworkManager.service enabledpostfix.service enabledrpcbind.service enabledrsyslog.service enabledsmarteye-server-agent.service enabledsshd.service enabledsystemd-readahead-collect.service enabledsystemd-readahead-drop.service enabledsystemd-readahead-replay.service enabledtuned.service enabled-------------------------------------------------运行的服务:auditd.service loaded active running Security Auditing Serviceceph-mon@master.service loaded active running Ceph cluster monitor daemonceph-osd@0.service loaded active running Ceph object storage daemonchronyd.service loaded active running NTP client/servercrond.service loaded active running Command Schedulerdbus.service loaded active running D-Bus System Message Busdocker.service loaded active running Docker Application Container Engineetcd.service loaded active running etcd docker wrappergapd.service loaded active running guest agent for pitrixgetty@tty1.service loaded active running Getty on tty1gssproxy.service loaded active running GSSAPI Proxy Daemonirqbalance.service loaded active running irqbalance daemonkubelet.service loaded active running Kubernetes Kubelet ServerNetworkManager.service loaded active running Network Managerpolkit.service loaded active running Authorization Managerpostfix.service loaded active running Postfix Mail Transport Agentrpcbind.service loaded active running RPC bind servicersyslog.service loaded active running System Logging Servicesmarteye-server-agent.service loaded active running The Smarteye Monitoring of serversshd.service loaded active running OpenSSH server daemonsystemd-journald.service loaded active running Journal Servicesystemd-logind.service loaded active running Login Servicesystemd-udevd.service loaded active running udev Kernel Device Managertuned.service loaded active running Dynamic System Tuning Daemon-------------------------------------------------监听端口:Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:9099 0.0.0.0:* LISTEN 10444/calico-node tcp 0 0 172.16.60.2:2379 0.0.0.0:* LISTEN 1321/etcd tcp 0 0 127.0.0.1:2379 0.0.0.0:* LISTEN 1321/etcd tcp 0 0 172.16.60.2:9100 0.0.0.0:* LISTEN 2868/./kube-rbac-pr tcp 0 0 127.0.0.1:9100 0.0.0.0:* LISTEN 2314/node_exporter tcp 0 0 172.16.60.2:2380 0.0.0.0:* LISTEN 1321/etcd tcp 0 0 172.16.60.2:10255 0.0.0.0:* LISTEN 1222/kubelet tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd tcp 0 0 0.0.0.0:6800 0.0.0.0:* LISTEN 850/ceph-osd tcp 0 0 0.0.0.0:6801 0.0.0.0:* LISTEN 850/ceph-osd tcp 0 0 0.0.0.0:6802 0.0.0.0:* LISTEN 850/ceph-osd tcp 0 0 0.0.0.0:179 0.0.0.0:* LISTEN 10755/bird tcp 0 0 0.0.0.0:6803 0.0.0.0:* LISTEN 850/ceph-osd tcp 0 0 169.254.25.10:53 0.0.0.0:* LISTEN 2058/node-cache tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 552/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 786/master tcp 0 0 127.0.0.1:40416 0.0.0.0:* LISTEN 1222/kubelet tcp 0 0 172.16.60.2:6789 0.0.0.0:* LISTEN 661/ceph-mon tcp 0 0 169.254.25.10:9254 0.0.0.0:* LISTEN 2058/node-cache tcp 0 0 127.0.0.1:10248 0.0.0.0:* LISTEN 1222/kubelet tcp 0 0 127.0.0.1:10249 0.0.0.0:* LISTEN 2854/kube-proxy tcp 0 0 172.16.60.2:10250 0.0.0.0:* LISTEN 1222/kubelet tcp6 0 0 :::10251 :::* LISTEN 12358/kube-schedule tcp6 0 0 :::6443 :::* LISTEN 1929/kube-apiserver tcp6 0 0 :::10252 :::* LISTEN 12366/kube-controll udp6 0 0 :::111 :::* 1/systemd udp6 0 0 ::1:323 :::* 530/chronyd udp6 0 0 :::703 :::* 535/rpcbind -------------------------------------------------内核参考配置:net.ipv4.ip_forward = 1net.bridge.bridge-nf-call-ip6tables = 1net.bridge.bridge-nf-call-iptables = 1net.ipv4.ip_local_reserved_ports = 30000-32767net.bridge.bridge-nf-call-arptables = 1-------------------------------------------------系统登录用户:root:x:0:0:root:/root:/bin/bash-------------------------------------------------ssh 配置信息:HostKey /etc/ssh/ssh_host_rsa_keyHostKey /etc/ssh/ssh_host_ecdsa_keyHostKey /etc/ssh/ssh_host_ed25519_keySyslogFacility AUTHPRIVAuthorizedKeysFile .ssh/authorized_keysPasswordAuthentication yesChallengeResponseAuthentication noGSSAPIAuthentication noGSSAPICleanupCredentials noUsePAM yesX11Forwarding yesAcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGESAcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENTAcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGEAcceptEnv XMODIFIERSSubsystem sftp /usr/libexec/openssh/sftp-serverPermitRootLogin yesPermitEmptyPasswords noUseDNS no-------------------------------------------------sudo 配置用户:root ALL=(ALL) ALL%wheel ALL=(ALL) ALL-------------------------------------------------定时任务配置:root@weekly /usr/bin/docker system prune -f*/30 * * * * /opt/etcd_back/etcd_backup.sh-------------------------------------------------hosts 信息:127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost6 localhost6.localdomain6 localhost6.localdomain172.16.60.2 master172.16.60.3 node01172.16.60.4 node02172.16.60.5 node03172.16.60.2 master.cluster.local master172.16.60.3 node01.cluster.local node01172.16.60.4 node02.cluster.local node02172.16.60.5 node03.cluster.local node03172.16.60.2 harbor.devops.kubesphere.local172.16.60.2 gitlab.devops.kubesphere.local-------------------------------------------------CPU占用top10: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1222 root 20 0 1401200 142324 19560 S 11.8 0.9 6197:32 kubelet 7119 root 20 0 144632 16016 4840 S 5.9 0.1 263:45.19 coredns 9761 1001 20 0 133952 19360 3444 S 5.9 0.1 589:46.42 jaeger-operator12366 root 20 0 821212 130924 21304 S 5.9 0.8 20:30.77 kube-controller15129 root 20 0 169104 39880 6176 S 5.9 0.2 212:52.15 mixs15251 root 20 0 157848 2148 1408 R 5.9 0.0 0:00.02 top19934 root 20 0 10.074g 26564 4612 S 5.9 0.2 342:47.40 etcd 1 root 20 0 194876 6912 2996 S 0.0 0.0 7:21.74 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:09.02 kthreadd 3 root 20 0 0 0 0 S 0.0 0.0 20:13.67 ksoftirqd/0内存占用top10: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1929 root 20 0 1667544 832556 23912 S 11.8 5.1 5571:22 kube-apiserver12967 root 20 0 9.914g 6.834g 1580 S 5.9 43.6 3672:00 java28651 polkitd 20 0 4161568 217472 2180 S 5.9 1.3 185:46.09 java 1321 root 20 0 10.188g 170880 18380 S 11.8 1.0 2154:47 etcd12366 root 20 0 821212 130924 21304 S 5.9 0.8 20:30.78 kube-controller 661 ceph 20 0 463516 67048 4476 S 5.9 0.4 280:35.51 ceph-mon17654 root 20 0 167812 11044 2808 S 5.9 0.1 9:13.12 envoy 1 root 20 0 194876 6912 2996 S 0.0 0.0 7:21.74 systemd15255 root 20 0 157848 2152 1408 R 11.8 0.0 0:00.03 top14093 polkitd 20 0 288608 6848 4208 S 5.9 0.0 0:00.02 postgres
- 你负责了哪块 给Java中级工程师进阶突围
- Spring DI(依赖注入)之XML配置 功能强大,性能卓越的轻量级企业开发框架
- 消息队列基础能力 给Java中级工程师进阶突围
- 计算密集型与IO密集型 每个后端开发者都需要学习的编程原理课
getty相关搜索
-
g area
gamma函数
gcc 下载
generic
genymotion
gesture
getattribute
getchar
getdocument
getelementbyid
getelementsbytagname
getmonth
getproperty
gets
getty
git clone
git pull
git push f
git 命令
git 使用