How to set Apache start at boot time on Linux

If you feel lazy to restart the httpd service everytime your machine boot up, just do following simple steps:

  1. Enter below command to show the runlevel information of the httpd service
    chkconfig –list | grep httpd
  2. You get something like this:
    httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
  3. Then, set up httpd to start at boot time.
    chkconfig httpd on
  4. Now to can verify by reviewing the runlevel information of the httpd service
    chkconfig –list | grep httpd
  5. Output should be.
    httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
  6. You’ve done !

If you just want to enable the servive for a certain runlevel (e.g. graphic mode or non graphic mode), you can use below command instead where 3 indicates the runlevel.

  • chkconfig –level 3 httpd

This method can be applied to enable/disable other services at boot time. So, to list available services on your machine, run the command:

  • chkconfig –list

Thanks for this simple solution.

March 29, 2012 at 12:55 am Leave a comment

AMD Opens Up Heterogeneous Computing


HSA, which until recently was know as the Fusion architecture, is AMD’s platform design for integrating CPU and GPU cores onto the same chip. But HSA is more than AMD’s attempt to define an architecture for internal use, as was the case for Fusion. Rather HSA is an open specification that AMD wants the industry to adopt as the de facto platform for heterogenous computing…”

For full article, visit this link:

March 14, 2012 at 10:21 pm Leave a comment

DDN solutions now available through Penguin Computing

DataDirect Networks (DDN) has announced that Penguin Computing has signed an agreement to offer DDN’s award-winning suite of HPC and Big Data storage solutions to its global customer base. Effective immediately, customers will be able to source DDN products from Penguin Computing, including the SFA storage platforms, the GRIDScaler and EXAScaler parallel file storage systems, NAS Scaler, DDN’s enterprise scale-out NAS platform, and WOS, the company’s hyperscale object storage system.

For full article, visit here:

March 14, 2012 at 10:11 pm Leave a comment

OpenCL Gains Ground On CUDA

As the two major programming frameworks for GPU computing, OpenCL and CUDA have been competing for mindshare in the developer community for the past few years. Until recently, CUDA has attracted most of the attention from developers, especially in the high performance computing realm. But OpenCL software has now matured to the point where HPC practitioners are taking a second look.

For full article, please visit:

March 1, 2012 at 9:48 am Leave a comment

The Portland Group Ships OpenCL Compiler for Multi-core ARM

PORTLAND, Feb. 28 — The Portland Group (PGI), a wholly-owned subsidiary of STMicroelectronics and the leading independent supplier of compilers and tools for high-performance computing, today announced the general availability of the PGI OpenCL framework for ARM-based ST-Ericsson NovaThor platforms. The framework includes a PGI OpenCL compiler for multi-core ARM CPUs as a compute device and complements OpenCL for GPUs. NovaThor is a highly integrated complete mobile product platform with performance and power optimized multi-core ARM Cortex™ A-series CPUs, advanced graphics processors, powerful multimedia engines, and the latest mobile broadband and connectivity technologies. With this announcement, The Portland Group extends its product line to encompass both OpenCL and multi-core ARM-based microprocessors.

For full article, please visit:

March 1, 2012 at 9:45 am Leave a comment

Facebook Shakes Hardware World With Own Storage Gear

Just read the article “Facebook Shakes Hardware World With Own Storage Gear” at As a fast growing company as Facebook, such hardware requirements are obviously. However, reading through the commends of this article is kind of fun.

“Facebook already built its own data center and its own servers. And now the social-networking giant is building its own storage hardware — hardware for housing all the digital stuff uploaded by its more than 845 million users.

Like the web’s other leading players — including Google and Amazon — Facebook runs an online operation that’s well beyond the scope of the average business, and that translates to unprecedented hardware costs — and hardware complications. If you’re housing 140 billion digital photos, you need a new breed of hardware.

In building its own data center on the Oregon high desert, Facebook did away with electric chillers, uninterruptible power supplies, and other terribly inefficient gear. And in working with various hardware manufacturers to build its own servers, the company not only reduced power consumption, it stripped thee systems down to the bare essentials, making them easier to repair and less expensive. Frankovsky and his team call this “vanity free” engineering, and now, they’ve extended the philosophy to storage hardware….”

For full article, visit this link

February 26, 2012 at 12:29 am Leave a comment

Linux shell scripting: /bin/sh : bad interpreter: No such file or directory

I usually get the below message when creating a Linux shell script with text editors like Notepad or Wordpad on Windows PC and executing it on Linux box:
“: /path/to/scriptfile:/bin/sh^M: bad interpreter: No such file or directory”
The top of the script is a line specifying the shell program by which the script is interpreted: 
Double-check if there is any typo in the script file or the /bin/sh exists on the Linux machine. It sounds like everything is OK. Now, I am sure the error caused by the text editor used to create the script file. In fact, text editors of different platforms like Mac, PC, Linux can create text files with different formats and this is the reason of the error.  In our case, line ending characters by the text editor on Windows are different from the ones on Linux which cause the shell scripted not be interpreted in a right way. To fix the error, do following steps at Linux command line:
  • Open the script using vi program

vi /path/to/scriptfile

  • When file is opened, change the format of the script to the right one by entering

: set fileformat=unix

or just simply

: set ff=unix

  • Finally, save the script for the new format taking effect and exit the vi program by entering

: x

Now, the script is working fine without any error. An easy way this avoid this problem is creating scripts directly on Linux with vi program.
Please note that using text files of another operating system on Linux may result in similar problems. For example, some errors when compiling your source code files or a program can not read data text files. These problems can be solved using the solution in this post.

January 6, 2012 at 11:57 am 2 comments

How to fix: locate: can not open `/var/lib/mlocate/mlocate.db’: No such file or directory

You got the message “locate: can not open `/var/lib/mlocate/mlocate.db’: No such file or directory” when using locate command ?

To fix it just simply use updatedb command.

For example:

[root@xyz ]# locate

[root@xyz ]# locate: can not open `/var/lib/mlocate/mlocate.db’: No such file or directory

[root@xyz ]# updatedb

[root@xyz ]# locate






August 12, 2011 at 11:45 am Leave a comment

CPU affinitity – Why need and How to ?

CPU affinity  ( or processor affinity ) is an ability provided by operating systems such as Windows or Linux that allows you to select  specific CPUs or processors to run your program/application on. In a multi-core and multi-processor system, the assignment of a process to a CPU/processor is automatically decided by the OS via its scheduler. However, you still can interfere in this scheduling task by specifying a CPU that your program will be run on.

Why CPU affinity is needed ?

You may ask “Why do I need it if OS is hanlding everything for me?”. You are right. In most cases, you won’t need this function. However, if the runtime performance is your concern,  in some cases, it’s worth a try to decide whether to use CPU affinity. For demonstration, I wrote a simple parallel program doing some computations using multi-cores. When I ran this program on a 12-core machine (two prossesors , six cores per processor) with/without CPU affinity, I got below runtime performance.

CPU affinity improves the  runtime performance because it optimizes cache performance by reducing cache miss. In a NUMA system, setting CPU affinity and allocating memory also on the faster RAM can speed up the process as well.

How to ?

There are two ways to set the CPU affinity in both Linux and Windows.

In Windows:
Method 1: Set the CPU affinity using Task manager

  • Open Task manager by pressing Ctrl + Alt + Delete and selecting the Task manager
  • Select Processes tab 
  • Right click on the process that you want to set CPU affinity
  • Select “Set affinity…” from the drop down menu
  • Set the CPUs that you want your program to run on

Method 2: Second, program from your source code
 You can use the Windows API SetProcessAffinityMask to set the CPU affinity from your program code

In Linux:

Method 1: Launch the program from the command line using settask
The below command will launch gedit in CPU 1 & 4 (or 0 and 3).

taskset -c 0,3 gedit

Method 2: Second, program from your source code
You can use the function sched_setaffinity in sched.h to manage CPU affinity from your code

August 5, 2011 at 2:40 pm 1 comment

Fix the error ” make: execvp: Permission denied “

” make: execvp: <YOUR FILE NAME>: Permission denied … ”

You got this error message? In my case, I got this message when trying to compile a software in my Linux box. To fix this issue, just simply change file access permissions using chmod command.

$ chmod  755 /path/to/yourfile

 If you want to change file access permissions for a folder and all files in that folder, you can add the -R option to the chmod command

$ chmod   755  -R /path/to/yourfolder

August 5, 2011 at 1:23 pm Leave a comment

Older Posts Newer Posts

Recent Posts

/openmp AMD app fixing dead pixel iphone C++ cmd program CPU C sharp dead pixels directory download ibm synthetic data generator Dynamic Dynamic Memory Allocation Edit Environment Variables in Windows Environment Variables error lnk2019: unresolved external symbol _getprocessmemoryinfo@12 referenced in function error lnk2019: unresolved external symbol _ getprocessmemoryinfo@12 referenced in function "void __cdecl printmemoryinfo(unsigned long example code Fixing Dead Pixels and Gray Lines on the iPhone Screen Fixing Dead Pixels on the iPhone Screen Fixing Gray Lines on the iPhone Screen Fix iPhone getprocessmemoryinfo GPU Gray Line iPhone Screen gray lines gray pixels green pixels GUI how to "new" a two-dimension array in C++ how to use ibm quest synthetic data generator ibm data generator ibm quest data generator ibm quest data generator exe ibm quest data mining project ibm quest market-basket synthetic data generator ibm quest market basket market-basket synthetic data generator ibm quest synthetic data generator ibm quest synthetic data generator linux ibm synthetic data generator ibm synthetic generator Intel iPhone Iphone 3G iPhone 3GS iPhone 4 iphone gray lines on startup iphone pixel damage iPhone Screen iPhone screen damage Linux market-basket synthetic data generator Memory Allocation Multicore multithread multi thread multi threaded multithreading mysql extract data into file new OpenCL Path processor quest data generator quest synthetic data generator R SAS Set Environment Variables Set Environment Variables in Windows souce code source code stuck pixels system file two dimension array Windows 7 Windows Vista