磁盘被谁占满了
2018年11月25日 14:28
磁盘被占满了,想知道被谁占满,怎么办?首先想到的是搜索所有超过GB大小的文件。
查看超过1GB的文件
1 2 3 | #命令就是这样不用改别奇怪。查看/下所有单位是G的文件 du -h / | grep -E "G[[:space:]]" |
参考来源
1 2 3 | #命令就是这样不用改别奇怪。查看/下所有单位是G的文件 du -h / | grep -E "G[[:space:]]" |
1 2 | create user 'repl' @ '%' identified by 'password' ; grant replication slave on *.* to 'repl' @ '%' ; |
1 2 3 4 | #/etc/mysql/my.conf server- id =1 gtid_mode=ON enforce-gtid-consistency= true |
1 2 3 | server- id =2 #id不能重复 gtid_mode=ON enforce-gtid-consistency= true |
1 2 3 4 5 6 | change master TO master_host= '192.168.50.111' , master_port=3307, master_user= 'repl' , master_password= 'password' , master_auto_position=1; |
1 | start slave |
1 2 | #Slave_IO_Running/Slave_SQL_Running两个都是yes表示配置成功 show slave status; |
1 2 3 4 | admin@R6400-ACF7: /tmp # df -h Filesystem Size Used Available Use% Mounted on .... /dev/sda1 7.4G 144.8M 6.8G 2% /tmp/mnt/XIAOMI |
1 | umount /dev/sda1 |
1 | mkfs.ext4 /dev/sda1 |
1 | mount /dev/sda1 /tmp/mnt/XIAOMI |
1 2 3 4 5 | admin@R6400-ACF7: /tmp # free -h total used free shared buffers cached Mem: 255588 57412 198176 0 508 6396 -/+ buffers /cache : 50508 205080 Swap: 1048572 0 1048572 |
BBR是来自Google的黑科技,通过优化和控制TCP的拥塞,充分利用带宽并降低延迟,起到神奇的加速效果。
centos7.5
加速效果,没有那么跨张,但是下载从50K加速到400K
1 2 3 | rpm -- import https: //www .elrepo.org /RPM-GPG-KEY-elrepo .org rpm -Uvh http: //www .elrepo.org /elrepo-release-7 .0-3.el7.elrepo.noarch.rpm yum --enablerepo=elrepo-kernel install kernel-ml -y |
1 | rpm -qa | grep kernel |
1 2 3 | egrep ^menuentry /etc/grub2 .cfg | cut -f 2 -d \' grub2- set -default 0 # default 0 表示第一个内核设置为默认运行, 选择最新内核就对了 reboot |
1 | uname -r |
1 2 | modprobe tcp_bbr echo "tcp_bbr" | sudo tee --append /etc/modules-load .d /modules .conf |
1 2 3 | echo "net.core.default_qdisc=fq" | sudo tee --append /etc/sysctl .conf echo "net.ipv4.tcp_congestion_control=bbr" | sudo tee --append /etc/sysctl .conf sysctl -p |
1 2 | sysctl net.ipv4.tcp_available_congestion_control sysctl net.ipv4.tcp_congestion_control |
如果结果都有 bbr, 则证明你的内核已开启 bbr
1 | 执行 lsmod | grep bbr, 看到有 tcp_bbr 模块即说明 bbr 已启动 |
https://github.com/iMeiji/shadowsocks_install/wiki/%E5%BC%80%E5%90%AFTCP-BBR%E6%8B%A5%E5%A1%9E%E6%8E%A7%E5%88%B6%E7%AE%97%E6%B3%95
1 2 3 4 5 6 7 8 9 10 | version: "3.1" services: mysqlrepm: image: "mysql:8.0.12" #指定认证插件 command: --default-authentication-plugin=mysql_native_password environment: - MYSQL_ROOT_PASSWORD=111111 ports: - "3307:3306" |
1 | /opt/lampp startftp /stopftp/reloadftp |
1 | ftp : //ip 地址 |
1 | /opt/lampp/sbin/proftpd -n |
1 | python -m PyInstaller xxx.py -w |
1 2 3 4 | os.system( "xxx" ) #会调用cmd.exe,所以会出现黑色窗口 #改用subprocess,不会出现黑色窗口 subprocess.Popen( "xxx" , close_fds=True) |
1 2 3 4 | #xxx.py import os cmd = "xxxxx" os.system(cmd) |
1 2 | #编译完成,系统提示发现木马 python -m PyInstaller xxx.py --onefile |
1 | subprocess.Popen(cmd, close_fds=True) |
1 2 3 4 5 | dig www.google.com @192.168.0.111 -p 53 ; <<>> DiG 9.11.3-RedHat-9.11.3-4.fc27 <<>> www.google.com @192.168.0.111 -p 53 ;; global options: +cmd ;; connection timed out; no servers could be reached |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | [root@bogon ss] # docker-compose -f chinadns.yml up dns-dnsmasq Starting ss_dns-dnsmasq_1 ... done Attaching to ss_dns-dnsmasq_1 dns-dnsmasq_1 | dnsmasq: started, version 2.79 cachesize 150 dns-dnsmasq_1 | dnsmasq: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth no-DNSSEC loop-detect inotify dns-dnsmasq_1 | dnsmasq: using nameserver 192.168.0.111 #5354 dns-dnsmasq_1 | dnsmasq: read /etc/hosts - 7 addresses dns-dnsmasq_1 | dnsmasq: query[A] www.google.com from 192.168.0.111 # 请求发送给了上游dns服务器,无后续reply。再去看上游dns服务器,发现已经解析出了ip # 而dnsmasq还是无应答 dns-dnsmasq_1 | dnsmasq: forwarded www.google.com to 192.168.0.111 dns-dnsmasq_1 | dnsmasq: query[A] www.google.com from 192.168.0.111 dns-dnsmasq_1 | dnsmasq: forwarded www.google.com to 192.168.0.111 |
1 | 尝试了很多方法,很奇怪它为什么不能应答。dnsmasq也不大,放在宿主机上运行吧。 |