autoDevops,CI,CD
 
0
How To: Network / TCP / UDP TuningThis is a very basic step by step description of how to improve the performancenetworking (TCP & UDP) on Linux 2.4+ for high-bandwidth applications. These settings are especiallyimportant for GigE links. Jump to Quick Step or All The Steps.AssumptionsThis howto assumes that the machine being tuned is involved in supporting high-bandwidthapplications. Making these modifications on a machine that supports multiple users and/ormultiple connections is not recommended - it may cause the machine to deny connectionsbecause of a lack of memory allocation.The StepsMake sure that you have root privleges.Type: sysctl -p | grep memThis will display your current buffer settings. Save These! You may want toroll-back these changesType: sysctl -w net.core.rmem_max=8388608 This sets the max OS receive buffer size for all types of connections.Type: sysctl -w net.core.wmem_max=8388608 This sets the max OS send buffer size for all types of connections.Type...
tag@cwtdb2 ~]$ free -g-bash: fork: Cannot allocate memoryThere is also /proc/sys/kernel/pid_max file, which specifies the value at which PIDs wrap around (i.e., the value in this file is one greater than the maximum PID). The default value for this file, 32768, results in the same range of PIDs as on earlier kernels (<=2.4). The value in this file can be set to any value up to 2^22 (PID_MAX_LIMIT, approximately 4 million). Increasing the value will help on large Linux system or clusters to ease process identification and process management. You can easily prevent fork() failures error message with this hack. Display Current Process Identifiers Limit On a Linux Based SystemsType the following command at shell prompt: $ sysctl kernel.pid_max OR $ cat /proc/sys/kernel/pid_max OR $ sysctl kernel.pid_max Sample outputs:kernel.pid_max = 32768Allow for more PIDs on a Linux based systemsup to 222 = 4,194,304Type the following command: # sysctl -w kernel.pid_max=4194303 OR # echo 4194303 ...
 
0

时间戳和标准时间的互转

发表者:admin分类:Devops2017-03-02 15:22:34 阅读[2528]
Linux时间戳和标准时间的互转在LINUX系统中,有许多场合都使用时间戳的方式表示时间,即从1970年1月1日起至当前的天数或秒数。如/etc/shadow里的密码更改日期和失效日期,还有代理服务器的访问日志对访问时间的记录等等。Unix时间戳(Unix timestamp),或称Unix时间(Unix time)、POSIX时间(POSIX time),是一种时间表示方式,定义为从格林威治时间1970年01月01日00时00分00秒(北京时间1970年01月01日08时00分00秒)起至现在的总秒数。Unix时间戳不仅被使用在Unix系统、类Unix系统中(比如Linux系统),也在许多其他操作系统中被广泛采用。php中获取时间戳的方法是:time();Date();Linux中获取时间戳的方法是:date +%sLinux中将时间戳转换为日期: date -d "@<timestamp>" 下面介绍几种时间戳格式和标准时间格式转换的方法:1、分别以标准格式和时间戳来显示当前时间[root@365linux ~]# date    2010年 08月 10日 星期二 03:39:21 CST   [root@365linux ~]# date +%s 12813827752、显示指定时间的时间戳[root@365linux ~]# date -d "2010-07-20 10:25:30" +%s    1279592730 3...
内网Linux服务器巡检报告上传到FTP指定目录,通过smtp邮件发送139邮箱方法。水平有限,供参考,可以使用。具体服务器环境:20台服务器Centos6系统,全部位于防火墙后的内网环境中。其中一台主机A可以上外网。其它主机只能内网访问。具体方案:可上网的主机A,配置好smtp邮件客户端,并配置好vsftp功能。每台主机通过脚本收集巡检报告,然后通过定时任务,使用ftp将报告上传到A主机的ftp目录里面。最后将所有主机的报告打包发送到指定邮箱中。具体配置:A主机,配置vsftp功能,这里就不说了。指定FTP目录为:/home/ftp ,并配置好ftp账号与密码。然后给A主机配置好巡检报告脚本,可以根据自己情况修改检查项目,本例具体内容如下:[root@cw ~] #:vi /home/check/report.shreport_ip=`ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk 'NR==1 { print $1}'`report_time=`date`report_crond=`/etc/init.d/crond status`report_ntp=`cat /etc/crontab |grep ntpdate`report_cpu=`uptime`report_Mem=`free -g`report_Disk=`df -h`report_phy_disk=`/opt/MegaRAID/storcli/storcli64 /c0 show|grep DRIVE`report_Listen=`netstat -lntup |grep java`r...
Linux  too many open file与Resource temporarily unavailable解决方法Linux普通用户对打开文件最大数与最大用户进程数,有限制。[ct@hbyjsdb ~]$ ulimit -acore file size          (blocks, -c) 0data seg size           (kbytes, -d) unlimitedscheduling priority             (-e) 0file size               (blocks, -f) unlimitedpending signals                 (-i) 30439max locked memory       (kbytes, -l) 64max memory size         (kbytes, -m) unlimitedopen files                      (-n) 2048pipe size   &nbs...
SecureCRT连接到数据库服务器,提示的错误为Resource temporarily unavailable。应该是超出了系统当前设置的值。关于超出资源限制的事之前有碰到过,只不过不是这个错误,而是open files: cannot modify limit: Operation not permitted。下面描述一下关于Resource temporarily unavailable这个错误及其相关信息。ssh 命令使用普通用户连接服务器,然后就出现错误提示:Write failed: Broken pipe测试root用户连接正常,在root用户下切换普通用户报错:[root@snaqi-test3 bin]# su - oraclesu: cannot set user id: Resource temporarily unavailable bash: fork: retry: Resource temporarily unavailablebash: fork: retry: Resource temporarily unavailablebash: fork: retry: Resource temporarily unavailablebash: fork: retry: Resource temporarily unavailablebash: fork: Resource temporarily unavailable执行以下命令查看 ps -U oracle | wc -l lsof | grep oracle | wc -l用户打开文件资源数。这里就参照安装oracle时的配置参数修改下相对应的用户配置。 编辑系统环境配置文件/etc/profile,在最后添加以下内容if [ $USER = "oracle" ]; then&nbs...
漏洞描述 目前需要升级内核(RHEL6x,已经有升级包了)漏洞编号:CVE-2016-5195漏洞名称:脏牛(Dirty COW)漏洞危害:低权限用户利用该漏洞技术可以在全版本Linux系统上实现本地提权影响范围:Linux内核>=2.6.22(2007年发行)开始就受影响了,直到2016年10月18日才修复。                 360 Vulpecker Team:Android 7.0最新的10月补丁安全级别的系统上测试过漏洞POC,确认Android受影响为什么这个漏洞叫脏牛(Dirty COW)漏洞?Linux内核的内存子系统在处理写时拷贝(Copy-on-Write)时存在条件竞争漏洞,导致可以破坏私有只读内存映射。一个低权限的本地用户能够利用此漏洞获取其他只读内存映射的写权限,有可能进一步导致提权漏洞。近日Linux官方爆出了“脏牛”漏洞(代号:Dirty COW,漏洞编号:CVE-2016-5195),攻击者可利用该漏洞本地以低权限提升到root权限。为避免您的服务器受影响,请尽快检查您的内核版本是否受影响,并及时关注漏洞修复通告信息。【漏洞详情】:Linux内核的内存子系统在处理写入时复制(copy-on-write, COW)时产生了竞争条件(race condition)。恶...
Weblogic反序列化漏洞的解决方案基于网上给的方案有两种:第一种方案如下使用SerialKiller替换进行序列化操作的ObjectInputStream类;在不影响业务的情况下,临时删除掉项目里的 "org/apache/commons/collections/functors/InvokerTransformer.class"文件。ObjectInputStream类为JRE的原生类,InvokerTransformer.class为weblogic基础包中的类,对上 述两个类进行修改或删除,实在无法保证对业务没有影响。如果使用上述的修复方式,需要大量的测试工作。且仅仅删除 InvokerTransformer.class文件,无法保证以后不会发现其他的类存在反序列化漏洞。基于项目比较庞大用的比较多。我就果断使用了第二个方案关键是简单第一种方案如下1、打补丁p20780171_1036_Generic.zip2、打补丁22248372_1036012_Generic.zip3、打补丁。。。步骤如下:1、测试漏洞Java -jar  Test.jar weblogic  xxx.xxx.xxx.xxx 7001 F:/a.txt执行该操作后,如果该IP上的电脑生成a.txt文件,证明漏洞存在(此命令为window下操作,linux下修改文件路径,暂未测试)。2、到weblogic官网下载补丁包(p20780171_1036_Generic.zip、p22248372_1036012_Generic.zip)10.3.6对应的补丁包p22248372_1...
TCP端口大家都知道,比如80端口,可以使用 telnet ip 80,来验证端口是否正常监听,那UDP端口是否可以同样测试呢?详细如下:下面我们来进行测试。我们使用nc来进行测试,如下:先在服务器端用NC工具开通对应的UDP端口,然后监听对应的UDP端口。nc -lu  192.168.11.80 10014或是服务器系统安装对应的应用程序开启相应端口,然后通过客户端nc软件向服务器端端口发送数据nc -uvz 192.168.11.80 10014 < /var/log/messages 最后检查服务器端对应程序的日志,查看是否有日志数据输出。 nc命令用法:usage: nc [-46DdhklnrStUuvzC] [-i interval] [-p source_port][-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_version][-x proxy_address[:port]] [hostname] [port[s]]
IPMItool使用很多人希望使用IPMI做带外管理。如果直接使用是有问题的。在OS层面上,你是可以修改IPMI的设置。也就是说,对于linux来说,有专门的驱动,让你修改底层IPMI的设置,包括修改你的IPMI的用户名和密码。安装IPMItool无论是centos,还是ubuntu都可以直接安装,源里都有yum -y install ipmitoolapt-get -y install ipmitoolyum install OpenIPMI OpenIPMI-tools chkconfig ipmi on service ipmi start内核加载modprobe ipmi_msghandlermodprobe ipmi_devintfmodprobe ipmi_si这个时候,你就基本可以对IPMI进行各种设置,你web可以做到的,命令行下都应该可以实现。DELL的<channel_no>是1,HP的是2 ,超微的是1,如果提示你输入channel_no 就输入就可以。查看IPMI用户IPMItool,可以查看本地的BMC的设置,查看本地是不需要身份验证。如果查看远程,需要提供IPMI 的用户名和密码。# ipmitool user list 1 ID Name Callin Link Auth IPMI Msg Channel Priv Limit 2 ADMIN false false true ADMINISTRATOR 重设管理员密码,2表示管理员ID,后面pwadmin就是管理员的新密码ipmitool user set password 2 pwadmi...
    总共68页,当前第14页 | 页数:
  1. 4
  2. 5
  3. 6
  4. 7
  5. 8
  6. 9
  7. 10
  8. 11
  9. 12
  10. 13
  11. 14
  12. 15
  13. 16
  14. 17
  15. 18
  16. 19
  17. 20
  18. 21
  19. 22
  20. 23
  21. 24