我不是一个随便的人,我随便起来不是人 首页 | 搜索 | 相册 | 评论 | 链接 | 注册 | 登陆
浏览模式: 标准 | 列表全部文章

I DONT KNOW EITHER

大小: 28.09 K
尺寸: 400 x 258
浏览: 3 次
点击打开新窗口浏览全图

刘若英

大小: 39.24 K
尺寸: 400 x 400
浏览: 1 次
点击打开新窗口浏览全图

PHP5时区问题

今天在PHP5下用date("H:i:s")时,发现参数"H"取出的时间与window下的时间不对。查了一下资料,发现是PHP5的php.ini里面默认设置为:
[Date]
; Defines the default timezone used by the date functions
;date.timezone =
如此一来,按照默认的时间便为GMT时间。而我们一般是使用北京时间,可以设置为:date.timezone = Asia/Shanghai。即:
[Date]
; Defines the default timezone used by the date functions
date.timezone = Asia/Shanghai
记得不要设置为"Asia/Beijing",老外好象对上海感兴趣点,呵呵。
如果没有权限改php.ini,可以用函数date_default_timezone_set('Asia/Shanghai');
这个函数用于设定所有日期时间函数的默认时区。手册上如此说明:“自 PHP 5.1.0 起(此版本日期时间函数被重写了),如果时区不合法则每个对日期时间函数的调用都会产生一条 E_NOTICE 级别的错误信息”。但是“本函数永远返回 TRUE(即使 timezone_identifier 参数不合法)。”
在此再学习一下函数:string date_default_timezone_get ( void )。这个函数的目的是取得一个脚本中所有日期时间函数所使用的默认时区。
这个函数的返回值遵循以下顺序:1:用 date_default_timezone_set() 函数设定的时区(如果设定了的话)。2:TZ 环境变量(如果非空)。3:date.timezone 配置选项(如果设定了的话)。4:自己推测(如果操作系统支持)。5:如果以上选择都不成功,则返回 UTC
再深入学习一下什么是UTC:
协调世界时(UTC):
一种称为协调世界时的折衷时标于1972年面世。为了确保协调世界时与世界时(UT1)相差不会超过0.9秒,有需要时便会在协调世界时内加上正或负闰秒。因此协调世界时与国际原子时(TAI)之间会出现若干整数秒的差别。位于巴黎的国际地球自转事务中央局(IERS)负责决定何时加入闰秒。

UTC = Coordinated Universal Time. 中文名称为协调世界时.
GMT = Greenwich Mean Time. 中文名称为格林尼治(平)时(这里的"w"是不发音的,而且"Green"要读成"Gren")
UTC = GMT +/- 0.9 s
因此 UTC 间中需要进行 "闰秒" 以控制两者相差。

沿三环半圈

深秋,无聊,骑车沿三环而行,风吹黄叶满天飞。约3个小时,冷,结束。

北京二环路为北京市的一条环城道路,全程32.7公里,建有29座立交桥,全线为全立交、全隔离的城市快速道路。
北京三环路全长48公里,共建有41座立交桥,是北京市城区的一条的环形城市快速路。
北京四环路全长65.3公里,全线共建设大小桥梁147座,并设有完善的交通安全设施。主路双向八车道,全封闭、全立交.
五环路全长98.58公里
北京六环路全长192公里,是一条联系北京郊区卫星城镇和疏导市际过境交通的高速公路。

大小: 138.6 K
尺寸: 400 x 342
浏览: 3 次
点击打开新窗口浏览全图

莲的心事

Debian安装NFS

服务器端安装,在NFS服务器上执行下面的命令即可
# apt-get install nfs-common nfs-kernel-server portmap
在客户端则需要安装:
# apt-get install nfs-common portmap

3.3 服务的启动与停止
启动服务
# /etc/init.d/nfs-kernel-server start
停止服务
# /etc/init.d/nfs-kernel-server stop
重启服务
# /etc/init.d/nfs-kernel-server restart

# mkdir /home/share
# chown nobody.nogroup /home/share
[共享的目录] [主机名1或IP1(参数1,参数2)] [主机名2或IP2(参数3,参数4)]
下面是一些NFS共享的常用参数:
ro 只读访问
rw 读写访问
sync 所有数据在请求时写入共享
async NFS在写入数据前可以相应请求
secure NFS通过1024以下的安全TCP/IP端口发送
insecure NFS通过1024以上的端口发送
wdelay 如果多个用户要写入NFS目录,则归组写入(默认)
no_wdelay 如果多个用户要写入NFS目录,则立即写入,当使用async时,无需此设置。
hide 在NFS共享目录中不共享其子目录
no_hide 共享NFS目录的子目录
subtree_check 如果共享/usr/bin之类的子目录时,强制NFS检查父目录的权限(默认)
no_subtree_check 和上面相对,不检查父目录权限
all_squash 共享文件的UID和GID映射匿名用户anonymous,适合公用目录。
no_all_squash 保留共享文件的UID和GID(默认)
root_squash root用户的所有请求映射成如anonymous用户一样的权限(默认)
no_root_squas root用户具有根目录的完全管理访问权限
anonuid=xxx 指定NFS服务器/etc/passwd文件中匿名用户的UID
anongid=xxx 指定NFS服务器/etc/passwd文件中匿名用户的GID

# showmount -e 192.168.102.47
Export list for 192.168.102.47:
/home/share (everyone)

6.1 启动时自动挂栽
修改客户机的 /etc/fstab文件,加入类似如下行:
192.168.102.47:/home/share /mnt nfs rsize=8192,wsize=8192,timeo=14,intr
重启客户机,即可实现系统启动时自动挂栽共享资源

6.2 使用 autofs 实现资源挂栽
autofs 使用 automount 守护进程来管理你的挂载点,它只在文件系统被访问时才动态地挂载它们。 autofs 查询主配置文件 /etc/auto.master 来决定要定义哪些挂载点。然后,它使用适用于各个挂载点的参数来启动 automount 进程。主配置中的每一行都定义一个挂载点,然后用单独的配置文件定义在该挂载点下要挂载的文件系统。

安装 autofs
# aptitude install autofs
修改/etc/auto.master文件, 加入如下内容:
/mnt /etc/auto.nfs
创建 /etc/auto.nfs 文件内容如下:
nfs -rw,soft,intr,rsize=8192,wsize=8192 192.168.102.47:/home/share
这样,每当您进入 /mnt/nfs 目录时,系统都会尝试将服务器的共享资源挂栽到该目录上。应当注意nfs目录是由 automount 动态地创建的,它不应该在客户机器上实际存在。
tonybox2:/# cd /mnt
tonybox2:/mnt# ls
tonybox2:/mnt# cd nfs
tonybox2:/mnt/nfs# ls
123
tonybox2:/mnt/nfs# ls -l
total 4
-rw-r--r-- 1 nobody nogroup 6 2006-08-22 07:50 123
tonybox2:/mnt/nfs#
如果修改了/etc/auto.master主配置文件,则需要运行
#/etc/init.d/autofs reload
对其进行重新加载

Debian 4 apache2 install ssl

apt-get update
apt-get install apache2

apt-get install openssl
openssl req -new -x509 -days 3650 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.pem

a2enmod ssl
cp default ssl

NameVirtualHost *:443
<VirtualHost *:443>

SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem

a2ensite ssl
vi /etc/apache2/ports.conf
Listen 443

/etc/init.d/apache2 restart

About Ian Murdock

http://ianmurdock.com/about/

Ian MurdockI’m Vice President of Developer and Community Marketing at Sun Microsystems, where I’m responsible for overall developer strategy, marketing and programs for Sun’s developer tools (NetBeans, Sun Studio), Sun Developer Network (SDN), Sun Tech Days developer events, Sun’s open source communities, StarOffice and OpenOffice, the Java Communications Suite, and the Network.com web scale computing platform.

Prior to joining Sun, I was CTO of the Linux Foundation (formed through the merger of OSDL and the Free Standards Group, where I was CTO) and chair of the Linux Standard Base (LSB), the Linux platform interoperability standard.

Prior to joining the Free Standards Group, I was cofounder, chairman, and chief strategist of Progeny, a Linux distribution vendor that built custom Linux platforms for companies building server appliances and other Linux powered products.

I founded Debian in 1993 and led the project from its inception to 1996. (The name “Debian” is a concatenation of “Deb” and “Ian”.) Debian was one of the first Linux distributions and arguably the first open source project that explicity set out to be developed in a decentralized fashion by a group of volunteers. Today, over 1,000 volunteers are involved in Debian’s development, and there are millions of Debian users worldwide.

It’s easy to forget how radical many of the ideas behind Debian were at the time, but this article, published in the October 1994 issue of Linux Journal, serves as an excellent glimpse into Linux past. (Note that Red Hat and SuSE are not listed as “major distributions”, as they didn’t exist or barely existed at the time.)

As described in this article, we were among the first to see that the development model, more than the technology, was what made Linux special; that this distributed approach to building software had many positive qualities when compared to more traditional, centralized approaches; that careful software engineering and modularity were key to success in a distributed software development effort; that standards were important to guarantee interoperability between different Linux distributions; that packages were an elegant way to approach the problems of software installation and maintenance; and that one of the most useful properties of a modular system design was its impact on system upgradability.

My Debian retrospective, published on the 10th anniversary of Debian’s founding, is available here.

I’ve been a Linux user and developer since the early days, and I’ve been involved in numerous Linux and open source organizations and projects. Among other things, I was a founding director of Linux International (1993-1995) and the Open Source Initiative (1998-2001).

I received my B.S. in Computer Science from Purdue University in 1996.

From 1997 to 2000, I was at the University of Arizona, where I was a staff programmer and occasional graduate student in the Department of Computer Science. The view from my office looked something like this (sigh). I left the U of A to start Progeny with John Hartman.

I live in Indianapolis and work in Menlo Park, CA, which means I spend a ridiculous amount of time at the W Silicon Valley. Yes, contrary to popular belief (at least in the tech industry), there is a world between the coasts, and people do actually choose to live here. I have three wonderful children (Regan, Keely, and Nolan). My hobbies include reading, history, politics, music, investing, and gardening.

More formal bio here.

Contact Me

Email: imurdock imurdock com, ian.murdock sun com

克服失眠的心理调适方法

  一、保持乐观、知足长乐的良好心态。对社会竞争、个人得失等有充分的认识,避免因挫折致心理失衡。
  二、建立有规律的一日生活制度,保持人的正常睡—醒节律。
  三、创造有利于入睡的条件反射机制。如睡前半小时洗热水澡、泡脚、喝杯牛奶等,只要长期坚持,就会建立起“入睡条件反射”。
  四、白天适度的体育锻炼,有助于晚上的入睡。
  五、养成良好的睡眠卫生习惯,如保持卧室清洁、安静、远离噪音、避开光线刺激等;避免睡觉前喝茶、饮酒等。
  六、自我调节、自我暗示。可玩一些放松的活动,也可反复计数等,有时稍一放松,反而能加快入睡。
  七、限制白天睡眠时间,除老年人白天可适当午睡或打盹片刻外,应避免午睡或打盹,否则会减少晚上的睡意及睡眠时间。
  另外,对于部分较重的患者,应在医生指导下,短期、适量地配用安眠药或小剂量抗焦虑、抑郁剂。这样可能会取得更快、更好的治疗效果。

This is SUN

大小: 175.02 K
尺寸: 400 x 296
浏览: 4 次
点击打开新窗口浏览全图

Records:40312345678910»