Online photo editor

張貼在 Online resources | 發表留言

a tons of mails to postmaster for error from mrtg cronjob

MRTG is a very popular open source tool for server statistics. Wether you use it for traffic, CPU load, or whatever.

This package is part of standard tools for CentOS. Same counts for Perl, SNMP, etcetera.
Whenever you decide to use an additional repository for server maintenance, e.g. The Atomic Rocket Turtle repo, then you might run into some problems these days.

The rocket turtle has released an update for Perl-IO-Socket-INET6, which is used in MRTG. This might bring some problems like following:

Depending on how often your CRON job is configured for running web statistics MRTG, you may receive following error:

Subroutine SNMPv1_Session::AF_INET6 redefined at /usr/lib/perl5/5.8.8/ line 65.
at /usr/bin/../lib64/mrtg2/ line 594
Subroutine main::AF_INET6 redefined at /usr/lib/perl5/5.8.8/ line 65.
at /usr/bin/mrtg line 97

This already is an old bug in MRTG:
There are several ways to fix this, like re-installing Perl, roll back your update (if you configured that).
I choose following fix:

Edit: /usr/bin/mrtg

Then find “import Socket6″ (note: without the “;") and replace it with:

Socket6->import(qw(pack_sockaddr_in6 inet_pton getaddrinfo));

Also edit: /usr/lib64/mrtg2/

Then find “import Socket6;"  (note: with the “;")

note: there are 2 instances

replace them both again, like above.

張貼在 Linux | 發表留言

How to rebuild the SYSVOL tree and its content in a domain

On a single domain controller, configure the SYSVOL replica set to be authoritative. This reference domain controller will contain the authoritative copy of the SYSVOL tree for all other members of the replica set. For example, other domain controllers in the domain will directly or transitively replicate from this reference domain controller.

Choose the reference domain controller based on connectivity and physical server resources. This domain controller will be known as the “reference domain controller" in all subsequent steps.

To configure the SYSVOL replica set to be authoritative, follow these steps:
Click Start, click Run, type regedit, and then click OK.
Locate and then click the BurFlags entry under the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NtFrs\Parameters\Cumulative Replica Sets\GUID
GUID is the GUID of the domain system volume replica set that is shown in the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NtFrs\Parameters\Replica Sets\GUID
Right-click BurFlags, and then click Modify.
Type D4 in the Value Data field (HexaDecimal), and then click OK.

張貼在 Windows Server | 標記 , , , | 發表留言

CentOS 5.2 使用 YUM 將 PHP 5.1.6 更新到 5.2.6


CentOS 5.2 版內建的 PHP 版本為 5.1.6,甚至於 5.3 版仍舊是 5.1.6 版本。

基於系統元件的完整,我就不採用編譯的方式來更新 PHP,而是計畫使用 YUM 來進行 PHP的更新。但是,使用 YUM 更新時卻又發現 CentOS 官網或映設站台的 PHP 仍舊是 5.1.6 版,參拜了 Google 大神後,發現國外論壇有人提供下載更新的套件,安裝後可以透過 YUM 更新。不過,因為是公司的主機,所以必須注重安全性,對於不明來源的下載網址,通常得拒於千里之外。

繼續參拜 Google 大神後,終於找到一篇討論文章,修改 YUM 設定後,就可以透過 YUM 從官網更新 PHP 到 5.2.6 版。



name=CentOS-5 Testing

上述設定網址都指向官方網站,我可以放心更新 PHP。存檔後,下達更新命令:

# yum update php*

更新完畢後以 PHP命令檢視版本:

# php -v

PHP 5.2.6 (cli) (built: Sep 15 2008 20:41:01)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

張貼在 Linux, PHP | 標記 , , | 發表留言

Day 3 Launching native apps with openURL


– (IBAction)pressTel:(id)sender;
– (IBAction)pressSMS:(id)sender;
– (IBAction)pressemail:(id)sender;
– (IBAction)pressMap:(id)sender;
– (IBAction)pressInternet:(id)sender;


– (IBAction)pressTel:(id)sender
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://18503″]];

– (IBAction)pressSMS:(id)sender
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms://98765432″]];

– (IBAction)pressemail:(id)sender
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://"]];

– (IBAction)pressMap:(id)sender
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@""]];

– (IBAction)pressInternet:(id)sender
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@""]];

張貼在 Objective C | 標記 , | 發表留言

Day 2 Animating with the UIImageView

    UIImageView *campFireView = [[[UIImageView alloc]initWithFrame:self.view.frame]autorelease];
    campFireView.animationImages = [NSArray arrayWithObjects:    
                                    [UIImage imageNamed:@"campFire01.gif"],
                                    [UIImage imageNamed:@"campFire02.gif"],
                                    [UIImage imageNamed:@"campFire03.gif"],
                                    [UIImage imageNamed:@"campFire04.gif"],
                                    [UIImage imageNamed:@"campFire05.gif"],
                                    [UIImage imageNamed:@"campFire06.gif"],
                                    [UIImage imageNamed:@"campFire07.gif"],
                                    [UIImage imageNamed:@"campFire08.gif"],
                                    [UIImage imageNamed:@"campFire09.gif"],
                                    [UIImage imageNamed:@"campFire10.gif"],
                                    [UIImage imageNamed:@"campFire11.gif"],
                                    [UIImage imageNamed:@"campFire12.gif"],
                                    [UIImage imageNamed:@"campFire13.gif"],
                                    [UIImage imageNamed:@"campFire14.gif"],
                                    [UIImage imageNamed:@"campFire15.gif"],
                                    [UIImage imageNamed:@"campFire16.gif"],
                                    [UIImage imageNamed:@"campFire17.gif"], nil];
    campFireView.animationDuration = 1.75;
    campFireView.animationRepeatCount = 0;
    [campFireView startAnimating];
    [self.view addSubview:campFireView];
張貼在 Objective C | 標記 , | 發表留言