count process in linux
[root@spkn ~]# ps -C php-fpm –no-heading | wc -l
941
[root@spkn ~]# ps -C nginx –no-heading | wc -l
14
[root@spkn ~]# ps -C php-fpm –no-heading | wc -l
941
[root@spkn ~]# ps -C nginx –no-heading | wc -l
14
เรามี subdomain แบบนี้
/home/nginx/files.sourcode.com/htdocs/ /home/nginx/project.sourcode.com/htdocs/ /home/nginx/threee.sourcode.com/htdocs/ /home/nginx/xxx.sourcode.com/htdocs/ /home/nginx/yes.sourcode.com/htdocs/ /home/nginx/intel.sourcode.com/htdocs/ /home/nginx/th.sourcode.com/htdocs/
เราจะโยน robots.txt เข้าไปใน htdocs ของแต่ละ subdomain
เราทำแบบนี้
$ echo /home/nginx/*sourcode.com/htdocs/ | xargs -n 1 cp robots.txt
Like a magic !
ปัญหาแบบนี้
$ mv item_display/* ../item_display/ bash: /bin/mv: Argument list too long
แก้โดย
find /path/to/file -type f | xargs -i mv “{}” /path/to/move
หรือ
find /path/to/file -type f -name '*' -exec mv {} /path/to/move/. \;
หรือแบบยากๆเลย
พยายามหาตั้งนานว่า Austin มันใช้ timezone อะไร ….
จนพบว่า
# ln -s /usr/share/zoneinfo/US/Central /etc/localtime
เมื่อท่านพบกับข้อความเหล่านี้!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = “en_US.UTF-8”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
ก็ขอให้แก้ตามนี้
# locale-gen en_US en_US.UTF-8 en_US.UTF-8
# dpkg-reconfigure locales
en_US en_US.UTF-8 en_US.UTF-8 เทียบได้กับ LANGUAGE = “en_US”, LC_ALL = “en_US.UTF-8”, LANG = “en_US.UTF-8”
ถ้าอยากแก้เป็นอย่างอื่นก็สามารถแก้ได้ตามสะดวก