一些PHP日期格式转换和计算的总结

$t1 = time(); //获取当前时间为 1441865485
$t2 = ‘2015-09-03 10:10:00’;
$t22 = strtotime($t2); //转换字符串格式的时间为UNIX标准时间 1441246200
$t12 = date(‘Y-m-d H:i:s’,$t1); //将UNIX标准时间转换为字符串时间 2015-09-10 14:11:25
$t221 = date(‘Y-m-d H:i:s’,strtotime(‘-1 Day’,$t22)); //前一天时间 2015-09-02 10:10:00
$t222 = date(‘Y-m-d[……]

阅读全文

网络安装Red Hat Enterprise Linux 7.0

网络安装RHEL的文档,网络上比较多了。这里主要说的是,在通过网络安装时,7.0和以前的系统相比,需要在APPEND后面通过inst.repo指定安装源,否则会出现如下错误:

dracut-initqueue[530]:mount no media found on /dev/sr0
dracut-initqueue[530]:warning couldn't mount /dev/sr0
dracut-initqueue[530]:warning no suitable image
dracut-initqueue[530]:warning could not boo[……]

阅读全文

用cx_Oracle在Python中连接Oracle数据库

1. 首先下载cx_Oracle,下载地址:http://sourceforge.net/projects/cx-oracle/
2. 下载Oracle客户端程序instantclient,下载地址(可能有变化,建议百度一下instantclient):http://www.oracle.com/technetwork/cn/database/features/instant-client/index-092699-zhs.html
3. 安装instantclient
4. cx_Oracle的使用方法参见 $Python_Home\cx_Oracle-doc\html\index.h[……]

阅读全文

Solaris 下新启用一个网口

    通常情况下,Sun服务器都配置了多个网口,如果要新启用一个未用的网口,需要激活网口和设置IP地址。
我在Sun Netra240上的操作步骤如下:
 

1. 查看网口名称

# dladm show-link

bge0            类型: 非 vlan   mtu: 1500       设备: bge0

bge1            类型: 非 v[……]

阅读全文