Blogs
How to convert timezone in PHP
I noticed that many people tried to find how to convert timezone in PHP in this site but found none. I wrote this trick to help them simplify the problem using very basic feature of PHP. Generally, your server might be set in such a timezone, e.g. GMT+7, and your users may locate in another timzone, e.g. GMT-7. What you need is to allow users to customize view of date/time in webboard, portal, blog, or any interactive websites. This is very basic but impression idea to help user reading and understanding your content easier.
If you notice the characteristic of each timezone, there is a reference point or so called GMT or UTC. They are the same point. That means every timezones are relative to this reference point. Each point is represented by offset of hours and minutes in form "SHHMM" while S denotes the sign of this offset, HH denotes the offset in hour and MM denotes the offset in minutes. For example, Bangkok timezone is GMT+7 which represents by +0700. Don’t worry everybody know where they are. You can leave the task to choose appropriate timezone to the end-user. My trick is to convert offset string into second so that standard function time() can recognize that offset correctly.
- sugree's blog
- 2 comments
- Read more
- 6475 reads
How to import & export SAPscript form
You can import and export SAPscript form by using report ’RSTXSCRP’.
You can specify form name in field ’Object name’.
About mode options:
- thitima's blog
- Add new comment
- Read more
- 1584 reads
How to monitor network services using Nagios
Today in the morning, one of my friend asked me to help resolving network related problem. Actually, he didn’t know what the problem exactly was. All he know was just he could not access to network mapped drive. Let me describe this problem in detail in next paragraph.
There is an enterprise network with 2 servers: Microsoft Windows 2000 Advanced Server and RedHat Linux 8.0. He usually works on Microsoft Windows XP using shared data and database on Windows 2000. Sometimes he encounters connection problem that he will be unable to access to the Windows 2000 for a while.
- sugree's blog
- Add new comment
- Read more
- 1174 reads
Port Forwarding for LevelOne WBR-3407A and WBR-3407B
LevelOne WBR-3407 series is a Wireless 54 Mbps ADSL2+ router with 4 port 10/100 Mbps. There are 2 models: WBR-3407A and WBR-3407B depending on country. Most LevelOne’s router do not support full-feature port forwarding, instead it supports limited virtual server concept. To set port forwarding in this router series, there are 2 choices.
- DMZ
- Virtual Servers
Choosing an appropriate choice depending on application you want to run. If the application is one of standard services such as web, ftp and e-mail, you can choose any choice. However, in case of you want to run BitTorrent or any P2P efficiently, you must choose DMZ instead.
- sugree's blog
- 10 comments
- Read more
- 6780 reads
Duplicate field name of nodewords and upload module in Drupal
According to my last patch to make nodewords module work on Drupal 4.7.x, it worked nearly perfect until I tried to attach a file to a node using standard upload module. Whenever I did it, I got following error messages.
Fatal error: Cannot create references to/from string offsets nor overloaded objects in /home/sugree/www/howforge4704/includes/form.inc on line 277
Sadly, I tried to fix this problem in form.inc with no luck. Eventually, by the help of var_dump(), I found that the actual problem is "description". There is other fields named description in upload fieldset so form builder always get confusing how to render this form.
- sugree's blog
- Add new comment
- Read more
- 792 reads
How to upgrade RAM properly (ECC or Non-ECC)
Yesterday I was asked to tune an old server-class machine running MS Windows 2000 Advanced Server and MS SQL 2000. Because of its age, nobody knows its exact specification. What they know is just it is Intel dual CPUs and 512 MB RAM. That’s all! They don’t even know how fast they are? They don’t know CPU’s model as well as its clock rate. This machine is used all the time so I could not turn it off to see what are inside. Fortunately, there are many software that capables to retrieve hardware information without opening the chassis. My most favorite tool is Everest Home Edition developed by Lavalys. Everest Home Edition is a freeware. However, Lavalys discontinued this product since last month. Anyway, I found lots of its mirror sites, e.g., Softpedia. The latest version is Everest Home Edition 2.20. By this powerful product, I found that there are already 2 memory modules 256 MB each. Both memory modules are the same model, ECC PC-133 256 MB. Everest didn’t clearly indicate what RAM can fit into this mainboard, instead it stated that the mainboard is Intel STL2 Server Board which was also discontinued. Below are what I found for compatible memory issue.
- sugree's blog
- Add new comment
- Read more
- 486 reads
Recent comments
2 years 11 weeks ago
2 years 16 weeks ago
2 years 16 weeks ago
2 years 17 weeks ago
2 years 17 weeks ago
2 years 19 weeks ago
2 years 19 weeks ago
2 years 19 weeks ago
2 years 20 weeks ago
2 years 20 weeks ago