重庆XC60车友中坝野炊露营召集统计贴

都说重庆只有冬天和夏天,的确,重庆的冬天去得太迟,夏天来得太早,严重缩短了春天的距离。

之前就在xc60群里聊过,一起组织个车友活动,趁着春天好好肆意一番,这里介绍一下情况和安排,有意向的车友欢迎报名统计。

 

1.活动时间:2016年3月26日 周六( 下周),如遇雨顺延至下周六或周日

2.活动地点:重庆市巴南区鱼洞附近『中坝蔬菜基地』

3.活动形式:XC60自驾活动

4.活动安排:

①周六12点至鱼洞轻轨站集合,集合后前往活动地点(预计20分钟到达)

②到达地点后下午活动:烧烤、划船、羽毛球、越野等集体活动或自由活动(我就是晒晒太阳什么也不做)

③晚上18点:有条件露营车友,准备当天晚餐(火锅)和帐篷装备,安排回程车友先行撤退,露营车友第二日撤退。

5.活动费用:活动主要费用为烧烤菜品费用和装备费用,烧烤菜品人均100左右,装备如有无需采购,菜品的采购方式为自购,烧烤架等装备如无,可多车组合使用,下面写一个需要的装备表

 

6.装备需求表:

①野炊必备:野餐垫、烧烤架、调料包、一次性碗筷、烧烤刷、木炭、打火机、食材
野炊可选:便携式座椅、遮阳伞、鱼竿、皮划艇、麻将
②露营必备:帐篷、睡袋、地垫、露营灯或电筒

露营可选:充气床、移动厕所、个人清洁用品
注:可选装备为提升生活质量
活动注意事项:1.安全问题,本次活动旁边为长江水域,请务必注意安全问题,人生安全,自己负责。
附图:
1.地理

directadmin 2.0升级注意

1.升级directadmin 之前记得修改时区

2.记得处理开启短标签。

3.zend的处理

4.ddos.sh脚本的处理

5.csf的白名单

6.真实ip的处理

cd /usr/local/directadmin/custombuild
./build rewrite_confs

 

7.不晓得

Apache: No space left on device: Couldn’t create accept lock

This error completely stumped me a couple of weeks ago. Apparently someone was adjusting the Apache configuration, then they checked their syntax and attempted to restart Apache. It went down without a problem, but it refused to start properly, and didn’t bind to any ports.

Within the Apache error logs, this message appeared over and over:

[emerg] (28)No space left on device: Couldn't create accept lock

Apache is basically saying “I want to start, but I need to write some things down before I can start, and I have nowhere to write them!” If this happens to you, check these items in order:

1. Check your disk space
This comes first because it’s the easiest to check, and sometimes the quickest to fix. If you’re out of disk space, then you need to fix that problem. :-)

2. Review filesystem quotas
If your filesystem uses quotas, you might be reaching a quota limit rather than a disk space limit. Use repquota / to review your quotas on the root partition. If you’re at the limit, raise your quota or clear up some disk space. Apache logs are usually the culprit in these situations.

3. Clear out your active semaphores
Semaphores? What the heck is a semaphore? Well, it’s actually an apparatus for conveying information by means of visual signals. But, when it comes to programming, semaphores are used for communicating between the active processes of a certain application. In the case of Apache, they’re used to communicate between the parent and child processes. If Apache can’t write these things down, then it can’t communicate properly with all of the processes it starts.

I’d assume if you’re reading this article, Apache has stopped running. Run this command as root:

# ipcs -s

If you see a list of semaphores, Apache has not cleaned up after itself, and some semaphores are stuck. Clear them out with this command:

# for i in `ipcs -s | awk '/httpd/ {print $2}'`; do (ipcrm -s $i); done

Now, in almost all cases, Apache should start properly. If it doesn’t, you may just be completely out of available semaphores. You may want to increase your available semaphores, and you’ll need to tickle your kernel to do so. Add this to /etc/sysctl.conf:

kernel.msgmni = 1024
kernel.sem = 250 256000 32 1024

And then run sysctl -p to pick up the new changes.

 

 

Apache cannot be started:

[root@store conf]# service httpd start
Starting httpd :                                       [Failed]

The following error can be found in the Apache error log file (/var/log/httpd/error_log):

[Mon Oct 07 18:20:01 2013] [error] (28)No space left on device: Cannot create SSLMutex

Cause

Those errors means that there is a lack of inner-process communication resources in the system, such as semaphores or shared memory segments:

[root@store conf]# ipcs -us

------ Semaphore Status --------
used arrays = 126
allocated semaphores = 130

Resolution

  1. Increase the limits in “/etc/sysctl.conf“:
    kernel.msgmni = 1024
    kernel.sem = 250 256000 32 1024
    
  2. Load the new sysctl settings from “/etc/sysctl.conf
    [root@store conf]# sysctl -p
    

 

cron问题

cron中,servier httpd restart停止在启动的状态,导致http无法启动,最终卡死

查阅日志,一切正常。

原来是输出重定向的问题

设置即可

 

 

http://www.linuxidc.com/Linux/2012-06/61691.htm

1. 关联loop设备与虚拟客户机镜像文件(losetup命名)
[root@target ~]# losetup -f
/dev/loop0
#查看目前空闲的loop设备,使用losetup -a 命令可以查看使用的loop设备的关联情况

[root@target ~]# losetup /dev/loop0 /virhost/kvm_node/win8.img
#关联loop设备到虚拟机镜像文件win8.img;关闭关联命令为 losetup -d /dev/loop0

2. 映射分区(kpartx命令)
[root@target ~]# kpartx -av /dev/loop0
add map loop0p1 (253:4): 0 716800 linear /dev/loop0 2048
add map loop0p2 (253:5): 0 40853504 linear /dev/loop0 718848
#参数-a 表示添加映射关系,-v表示显示映射的对应关系
#映射成功的设备在/dev/mapper下面,比如/dev/mapper/loop0p1
#关闭映射 kpartx -dv /dev/loop0

3. 挂载
[root@target ~]# yum install fuse  -y
[root@target ~]# yum localinstall –nogpgcheck ntfs-3g-2011.1.15-1.fc15.i686.rpm
#Linux默认不能识别ntfs分区,需要先安装ntfs-3g软件ntfs-3g依赖fuse
#ntfs-3g下载页面 http://www.linuxidc.com/Linux/2012-02/52947.htm)

[root@target ~]# mount -t ntfs-3g /dev/mapper/loop0p2 /mnt
#挂载,linux分区挂载时注意LVM分区,防止vg和lv不要与系统本身冲突
[root@target ~]# ls /mnt
autoexec.bat  BOOTNXT     Documents and Settings  pagefile.sys  ProgramData    $Recycle.Bin  System Volume Information  Windows
bootmgr       config.sys  hiberfil.sys            PerfLogs      Program Files  swapfile.sys  Users
#挂载成功,能够直接查看虚拟机客户主机系统文件

shell记录

set -xv    #调试命令,在第二步中将其取消注释,即可进行调试

dos2unix $contents >/dev/null 2>&1    #对文件进行处理,转换为linux的行结束符

ipmi的东西

好东西还是保存到自己博客好

4.3. ipmitool – utility for controlling IPMI-enabled devices

4.3.1. ipmitool

4.3.1.1. ubuntu

确定硬件是否支持 IPMI

				
neo@monitor:~$ sudo dmidecode |grep -C 5 IPMI
[sudo] password for neo:
Handle 0x2000, DMI type 32, 11 bytes
System Boot Information
        Status: No errors detected

Handle 0x2600, DMI type 38, 18 bytes
IPMI Device Information
        Interface Type: KCS (Keyboard Control Style)
        Specification Version: 2.0
        I2C Slave Address: 0x10
        NV Storage Device: Not Present
        Base Address: 0x0000000000000CA8 (I/O)
				
sudo apt-get install openipmi

sudo apt-get install ipmitool

sudo mkdir -p /var/lock/subsys/ipmi

$ sudo /etc/init.d/openipmi start
 * Starting ipmi drivers                  [ OK ]

4.3.1.2. CentOS

# yum search ipmi
========================================== Matched: ipmi ===========================================
OpenIPMI.x86_64 : OpenIPMI (Intelligent Platform Management Interface) library and tools
OpenIPMI-devel.i386 : The development environment for the OpenIPMI project.
OpenIPMI-devel.x86_64 : The development environment for the OpenIPMI project.
OpenIPMI-gui.x86_64 : IPMI graphical user interface tool
OpenIPMI-libs.i386 : The OpenIPMI runtime libraries
OpenIPMI-libs.x86_64 : The OpenIPMI runtime libraries
OpenIPMI-perl.x86_64 : OpenIPMI Perl language bindings
OpenIPMI-python.x86_64 : OpenIPMI Python language bindings
OpenIPMI-tools.x86_64 : OpenIPMI utilities and scripts from ipmitool
collectd-ipmi.x86_64 : IPMI module for collectd
freeipmi.i386 : FreeIPMI
freeipmi.x86_64 : FreeIPMI
freeipmi-bmc-watchdog.x86_64 : FreeIPMI BMC watchdog
freeipmi-devel.i386 : Development package for FreeIPMI
freeipmi-devel.x86_64 : Development package for FreeIPMI
freeipmi-ipmidetectd.x86_64 : IPMI node detection monitoring daemon
openhpi.i386 : openhpi Hardware Platform Interface (HPI) library and tools
openhpi.x86_64 : openhpi Hardware Platform Interface (HPI) library and tools
ripmime.x86_64 : Extract attachments out of a MIME encoded email packages
watchdog.x86_64 : Software and/or Hardware watchdog daemon

# yum install OpenIPMI OpenIPMI-tools -y

4.3.2. sensor

# ipmitool -I open sensor list

4.3.3. ipmitool shell

# ipmitool shell

mc info

			
ipmitool> mc info
Device ID                 : 32
Device Revision           : 0
Firmware Revision         : 1.54
IPMI Version              : 2.0
Manufacturer ID           : 674
Manufacturer Name         : DELL Inc
Product ID                : 256 (0x0100)
Product Name              : Unknown (0x100)
Device Available          : yes
Provides Device SDRs      : yes
Additional Device Support :
    Sensor Device
    SDR Repository Device
    SEL Device
    FRU Inventory Device
    IPMB Event Receiver
    Bridge
    Chassis Device
Aux Firmware Rev Info     :
    0x00
    0x0f
    0x00
    0x00


ipmitool> lan print 1
Set in Progress         : Set Complete
Auth Type Support       : NONE MD2 MD5 PASSWORD
Auth Type Enable        : Callback : MD2 MD5
                        : User     : MD2 MD5
                        : Operator : MD2 MD5
                        : Admin    : MD2 MD5
                        : OEM      :
IP Address Source       : Static Address
IP Address              : 172.16.1.132
Subnet Mask             : 255.255.255.0
MAC Address             : 84:2b:2b:fd:e2:51
SNMP Community String   : public
IP Header               : TTL=0x40 Flags=0x40 Precedence=0x00 TOS=0x10
Default Gateway IP      : 172.16.1.254
Default Gateway MAC     : 00:00:00:00:00:00
Backup Gateway IP       : 0.0.0.0
Backup Gateway MAC      : 00:00:00:00:00:00
802.1q VLAN ID          : Disabled
802.1q VLAN Priority    : 0
RMCP+ Cipher Suites     : 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
Cipher Suite Priv Max   : aaaaaaaaaaaaaaa
                        :     X=Cipher Suite Unused
                        :     c=CALLBACK
                        :     u=USER
                        :     o=OPERATOR
                        :     a=ADMIN
                        :     O=OEM
			

4.3.4. ipmitool 访问远程主机

			
# ipmitool -H 172.16.1.155 -U root -P 123456 lan print 1
Set in Progress         : Set Complete
Auth Type Support       : NONE MD2 MD5 PASSWORD
Auth Type Enable        : Callback : MD2 MD5
                        : User     : MD2 MD5
                        : Operator : MD2 MD5
                        : Admin    : MD2 MD5
                        : OEM      :
IP Address Source       : Static Address
IP Address              : 172.16.1.15
Subnet Mask             : 255.255.255.0
MAC Address             : 84:2b:2b:fc:fb:cc
SNMP Community String   : public
IP Header               : TTL=0x40 Flags=0x40 Precedence=0x00 TOS=0x10
Default Gateway IP      : 172.16.1.254
Default Gateway MAC     : 00:00:00:00:00:00
Backup Gateway IP       : 0.0.0.0
Backup Gateway MAC      : 00:00:00:00:00:00
802.1q VLAN ID          : Disabled
802.1q VLAN Priority    : 0
RMCP+ Cipher Suites     : 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
Cipher Suite Priv Max   : aaaaaaaaaaaaaaa
                        :     X=Cipher Suite Unused
                        :     c=CALLBACK
                        :     u=USER
                        :     o=OPERATOR
                        :     a=ADMIN
                        :     O=OEM

			

4.3.5. Get chassis status and set power state

			
# ipmitool -I open chassis
Chassis Commands:  status, power, identify, policy, restart_cause, poh, bootdev, bootparam, selftest

# ipmitool -I open chassis status
System Power         : on
Power Overload       : false
Power Interlock      : inactive
Main Power Fault     : false
Power Control Fault  : false
Power Restore Policy : previous
Last Power Event     :
Chassis Intrusion    : inactive
Front-Panel Lockout  : inactive
Drive Fault          : false
Cooling/Fan Fault    : false
Sleep Button Disable : not allowed
Diag Button Disable  : allowed
Reset Button Disable : not allowed
Power Button Disable : allowed
Sleep Button Disabled: false
Diag Button Disabled : true
Reset Button Disabled: false
Power Button Disabled: false
			

4.3.6. Configure Management Controller

4.3.6.1. Management Controller status and global enables

				
# ipmitool -I open mc
MC Commands:
  reset <warm|cold>
  guid
  info
  watchdog <get|reset|off>
  selftest
  getenables
  setenables <option=on|off> ...
    recv_msg_intr         Receive Message Queue Interrupt
    event_msg_intr        Event Message Buffer Full Interrupt
    event_msg             Event Message Buffer
    system_event_log      System Event Logging
    oem0                  OEM 0
    oem1                  OEM 1
    oem2                  OEM 2
				

4.3.6.2. Configure LAN Channels

ipmitool -I open lan print 1                           	显示BMC通道的信息,如果不知道BMC使用的是哪个通道,请使用下面的命令确认:
ipmitool -I open channel info 1
ipmitool -I open lan set 1 ipsrc static                	设置本地BMC地址为静态,才能设置IP
ipmitool -I open lan set 1 ipaddr 172.16.0.2         	设置本地BMC的IP地址
ipmitool -I open lan set 1 netmask 255.255.255.0       	子网掩码,别忘了设
ipmitool -I open lan set 1 defgw ipaddr 172.16.0.254   	网关,可设可不设,不过一定要确保监控它的机器位于同一路由

4.3.6.3. Configure Management Controller users

				
ipmitool user list 1     			查看BMC的用户列表
ipmitool user set name 1 username 	对BMC的1号用户设置用户名username
ipmitool user set password 1 123456 对BMC的1号用户设置密码123456
				

4.3.6.4. Configure Management Controller channels

# ipmitool -I open channel info 1
Channel 0x1 info:
  Channel Medium Type   : 802.3 LAN
  Channel Protocol Type : IPMB-1.0
  Session Support       : multi-session
  Active Session Count  : 0
  Protocol Vendor ID    : 7154
  Volatile(active) Settings
    Alerting            : disabled
    Per-message Auth    : disabled
    User Level Auth     : enabled
    Access Mode         : always available
  Non-Volatile Settings
    Alerting            : disabled
    Per-message Auth    : disabled
    User Level Auth     : enabled
    Access Mode         : always available

4.3.7. Example for iDRAC

http://support.dell.com/support/edocs/software/smbmcmu/bmcmu_4_0/cs/ug/bmcugc0d.htm#wp1067804

4.3.7.1. 更改IP地址,子网掩码与网关

查看IP,子网掩码与网关

# ipmitool -I open lan print 1
Set in Progress         : Set Complete
Auth Type Support       : NONE MD2 MD5 PASSWORD
Auth Type Enable        : Callback : MD2 MD5
                        : User     : MD2 MD5
                        : Operator : MD2 MD5
                        : Admin    : MD2 MD5
                        : OEM      :
IP Address Source       : Static Address
IP Address              : 172.16.5.23
Subnet Mask             : 255.255.255.0
MAC Address             : 18:03:73:f5:ee:82
SNMP Community String   : public
IP Header               : TTL=0x40 Flags=0x40 Precedence=0x00 TOS=0x10
Default Gateway IP      : 172.16.5.254
Default Gateway MAC     : 00:00:00:00:00:00
Backup Gateway IP       : 0.0.0.0
Backup Gateway MAC      : 00:00:00:00:00:00
802.1q VLAN ID          : Disabled
802.1q VLAN Priority    : 0
RMCP+ Cipher Suites     : 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
Cipher Suite Priv Max   : aaaaaaaaaaaaaaa
                        :     X=Cipher Suite Unused
                        :     c=CALLBACK
                        :     u=USER
                        :     o=OPERATOR
                        :     a=ADMIN
                        :     O=OEM

设置IP,子网掩码与网关

/usr/bin/ipmitool -I open lan set 1 ipaddr 172.16.8.200
/usr/bin/ipmitool -I open lan set 1 netmask 255.255.255.0
/usr/bin/ipmitool -I open lan set 1 defgw ipaddr 172.16.8.254
/usr/bin/ipmitool -I open lan set 1 access on

4.3.7.2. 更改 iDRAC LCD 显示屏

# ipmitool delloem lcd set mode userdefined test
# ipmitool delloem lcd info
LCD info
    Setting: User defined
    Text:    test

4.3.7.3. 更改 iDRAC 密码

# ipmitool user list 2
ID  Name	     Callin  Link Auth	IPMI Msg   Channel Priv Limit
2   root             true    true       true       ADMINISTRATOR
# ipmitool user set password 2 "mypasswd"

4.3.7.4. 关机/开机

服务器关机
#ipmitool -I lan -U root -P secpass -H 10.10.0.5 power off

服务器开机
#ipmitool -I lan -U root -P secpass -H 10.10.0.5 power on

服务器 reset
#ipmitool -I lan -U root -P secpass -H 10.10.0.5 power reset

4.3.7.5. 启动列表

ipmitool -I lan -H 10.10.0.5 -U ADMIN -P ADMIN chassis bootdev pxe

php关闭错误输出

error_reporting 设定错误讯息回报的等级
2047我记得应该是E_ALL。

php.ini 文件中有许多配置设置。您应当已经设置好自己的php.ini 文件并把它放在合适的目录中,就像在 Linux 上安装PHP和 Apache 2 的文档说明中所示的那样(请参阅 参考资料)。在调试PHP应用程序时,应当知道两个配置变量。下面是这两个变量及其默认值:
display_errors = Off
error_reporting = E_ALL

E_ALL能从不良编码实践到无害提示到出错的所有信息。E_ALL 对于开发过程来说有点太细,因为它在屏幕上为一些小事(例如变量未初始化)也显示提示,会搞糟浏览器的输出
所以不建议使用2047,最好把默认值改为:error_reporting = E_ALL & ~E_NOTICE

PHP .ini中display_errors = Off失效的解决
问题:
PHP 设置文件php .ini中明明已经设置display_errors = Off,但是在运行过程中,网页上还是会出现错误信息。
解决:
经查log_errors= On,据官方的说法,当这个log_errors设置为On,那么必须指定error_log文件,如果没指定或者指定的文件没有权限写入,那么照样会输 出到正常的输出渠道,那么也就使得display_errors 这个指定的Off失效,错误信息还是打印了出来。于是将log_errors = Off,问题就解决了。

经常见到error_reporting(7)直意为:设定错误讯息回报的等级。

value   constant
1   E_ERROR
2   E_WARNING
4   E_PARSE
8   E_NOTICE
16   E_CORE_ERROR
32   E_CORE_WARNING
64   E_COMPILE_ERROR
128   E_COMPILE_WARNING
256   E_USER_ERROR
512   E_USER_WARNING
1024   E_USER_NOTICE
2047   E_ALL
2048   E_STRICT
然而7=1+2+4
就是出错时显示1 E_ERROR    2 E_WARNING      4 E_PARSE
<?php
//禁用错误报告
error_reporting(0);
//报告运行时错误
error_reporting(E_ERROR | E_WARNING | E_PARSE);
//报告所有错误
error_reporting(E_ALL);
?>

 

另附

问:
可否关闭PHP的错误提示?我不希望让别人看到我程序的报错。

答:
由于PHP.ini中的设置是全局性的,我们不能为您单独某个用户直接修改全局配置信息,但您可以通过error_reporting这个php函数来调整您所运行的脚本的错误信息输出,例如:

error_reporting(E_ALL^E_NOTICE^E_WARNING);

可以关闭所有notice 和 warning 级别的错误。

把这个语句放在您脚本的功用包含文件中,通常为config.php 或者conn.php 中就可以控制输出了。

centos 6 关闭启动进度条,显示详细信息

root用户修改 /boot/grub/grub.conf 文件。
vim /boot/grub/grub.conf

将”rhgb”和 “quiet”去掉,保存即可

重启系统观察是不是和CentOS 5.xxx 启动过程一样了。

“rhgb”表示”redhat graphics boot”,就是图形进度条模式。
“quiet”表示在启动过程中只显示重要启动信息,类似硬件自检之类的消息不会显示,可以有选择地选用。