zoukankan      html  css  js  c++  java
  • linux基础优化

    [root@moban oldboy]# for oldboy in `chkconfig --list |grep "3:on" |awk '{print $1}' |grep -vE "crond|network|sshd|rsyslog"`;do chkconfig $oldboy off;done

    [root@moban oldboy]# chkconfig --list |grep "3:on"

    crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off

    network         0:off   1:off   2:on    3:on    4:on    5:on    6:off

    rsyslog         0:off   1:off   2:on    3:on    4:on    5:on    6:off

    sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off

    这个思想是把打开的服务都找出来,把需要的排除外,然后其他的都关闭掉

    在oldboy目录下创建一个oldboy命令,然后加入到系统环境中才可以执行

    [root@BaseServer /]# chmod +x /oldboy/oldboy

    [root@BaseServer /]# echo 'PATH="/oldboy/:$PATH"' >>/etc/profile

    [root@BaseServer /]# source /etc/profile

    root用户全局生效/etc/profile

    普通用户生效~/.bash_profile或者~/.bashrc

    Linux中文设置

    [root@BaseServer ~]# cat /etc/sysconfig/i18n

    LANG="zh_CN.GB18030"

    Linux系统时间同步

    [root@BaseServer oldboy]# /usr/sbin/ntpdate time.nist.gov

    文件描述符加大进程运行的空间,不然空间小了有的进程起不来

    查看大小[root@BaseServer oldboy]# ulimit -n

    root@BaseServer oldboy]# vi /etc/security/limits.conf

    在后面加上*                -       nofile          65535

    [root@BaseServer oldboy]# source /etc/security/limits.conf

    然后退出重新登录就可以了

  • 相关阅读:
    Android Service 与 Activity使用Pending Intent通信
    Android四大组件之Service(一)
    Android中的进程和线程
    Java虚拟机结构(二)
    Java虚拟机结构(一)
    Android四大组件之Activity(一)
    一阶规则学习
    规则学习
    算法链接
    41. First Missing Positive
  • 原文地址:https://www.cnblogs.com/chenshoubiao/p/4850520.html
Copyright © 2011-2022 走看看