ก๊วนซอฟท์แวร์ </softganz> SoftGang (Gang Software)

Web &amp; Software Developer Gang.

603 items|« First « Prev 48 49 (50/61) 51 52 Next » Last »|
โดย Little Bear on 18 มิ.ย. 52 03:27

แก้ไขไฟล์ config.inc.php

$cfg['SaveDir']= '/tmp';

เพิ่มบรรทัด

$GLOBALS["saveonserver"]=true;

แล้วจะมีปุ่มให้คลิก Save on server in /tmp/ directory ตอน export

ปล. มีเวลาจะมาอธิบายอย่างละเอียดอีกที

ที่มา : www.planet-source-code.com

โดย Little Bear on 15 มิ.ย. 52 23:52

ปกติก็ใช้แต่ theme เดิม ๆ ของ Ubuntu ซึ่งก็ยังไม่เบื่อ อาจจะเป็นเพราะมันเรียบง่ายดีก็เป็นได้

แต่ก็อยากลองของใหม่ จึงลองดู theme สวย ๆ ของ Ubuntu หรือจาก ต้นฉบับ ดูบ้าง คงจะแก้เบื่อ แก้เซ็งไปได้สักพัก

ตัวอย่างเช่น

Tropical

exotic

โดย Little Bear on 14 มิ.ย. 52 19:04

ไมโครซอฟท์เริ่มแคมเปญ Browser for the Better ร่วมกับ Feeding America www.feedingamerica.org ซึ่งเป็นหน่วยงานการกุศลที่จัดอาหารให้กับผู้ยากไร้

แคมเปญก็คือ เมื่อดาวน์โหลด IE8 ผ่านเว็บไซต์ Browser for the Better หนึ่งครั้ง ไมโครซอฟท์จะบริจาคเงินให้กับ Feeding America เป็นจำนวน 1.15 ดอลลาร์ ไมโครซอฟท์จะบริจาคเงินสูงสุด 1 ล้านดอลลาร์สหรัฐ แคมเปญนี้จะสิ้นสุดวันที่ 8 เดือน 8 และเงินจากไมโครซอฟท์จะถูกเปลี่ยนเป็นอาหารไปเรื่อยๆ จนถึงเดือน มิ.ย. ปี 2010

ผู้ใช้ต้องดาวน์โหลดผ่านเว็บไซต์ Browser for the Better เท่านั้น (ที่อื่นไม่นับ) และต้องดาวน์โหลดจนเสร็จสมบูรณ์ด้วย ผมพยายามหาแล้วไม่เจอข้อจำกัดว่าต้องเป็นการดาวน์โหลดจากในสหรัฐเท่านั้น ดังนั้นใครที่ยังไม่มี IE8 ก็สามารถไปช่วยเหลือเพื่อนมนุษย์กันได้

วิดีโอโฆษณา IE8 ในแคมเปญ Browser for the Better สองอันดูได้จาก Blognone

ที่มา - Blognone , Ars Technica

ปล. คือผมคาดว่าผมคงต้องโหลดไปลงในเครื่องของใครอีกหลาย ๆ คน เพราะเพื่อน ๆ อีกหลายคนยังคงใช้ IE6-7 อยู่ และอาจจะโหลดมา update เองไม่เป็นด้วยซ้ำ ไว้คงต้องทยอยทำให้เรื่อย ๆ

โดย Little Bear on 14 มิ.ย. 52 09:20

วันนี้เริ่มย้ายเว็บ http://softganz.com ไปอยู่บ้านใหม่ ซึ่งคงจะเป็นบ้านถาวรแล้ว ครานี้ย้ายมาอยู่ที่หาดใหญ่เลย ซึ่ง CAT-IDC Hatyai เพิ่งเปิดให้บริการ ผมเป็นลูกค้ารายที่ 2

ลง server DELL R200 1 เครื่อง กำลังทยอยย้ายเว็บอื่น ๆ มาในภายหลัง

โดย Little Bear on 10 มิ.ย. 52 08:55

เพิ่งติดตั้ง DirectAdmin บน CentOS5.3 เป็นครั้งแรกในชีวิต หลังจากที่ติดตั้งเสร็จก็มีสิ่งที่ต้องทำต่อ ตามนี้

ก่อนลง ลองเช็คเวลาและ timezone ต้องกำหนด timezone ให้เรียบร้อย บน CentOS สามารถใช้ system-config-date เพื่อกำหนด timezone ได้

Sync เวลากับ time server

หากไม่มี ntpdate ก็ติดตั้งด้วย

yum install ntp

หรือ

apt-get install ntpdate

กำหนดให้มีการ sync time จาก clock.nectec.or.th ด้วยการตั้งเวลาใน crontab

crontab -e

แล้วเพิ่มโค๊ดไว้ด้านล่างสุด

0 */4 * * * root ntpdate clock.nectec.or.th

Howto: Sync เวลากับใครและบ่อยแค่ไหนดี

หลังจากนั้นก็ดำเนินการติดตั้งและ config security ตามรายการ

  1. DirectAdmin Installation Guide

  2. Setting up DA with an SSL certificate

  3. DirectAdmin has been Installed on your Server!

  4. Basic system security

  5. HOW-TO: Mount /tmp with noexec or Secure Tmp Directadmin

  6. DirectAdmin Site Helper

  7. Step Security Unix/Linux - ฉบับ DirectAdmin และ บทความน่าอ่านจาก ThaiHostTalk

  8. Installing RPMforge

  9. Compile PHP 5.3 via CustomBuild in Direct Admin

  10. iptables - ติดตั้งไฟร์วอลเสีย และ DirectAdmin iptables , Shoutcast - not test

  11. Securing a Debian Box - เพิ่มความปลอดภัยให้

  12. Intrustion detection and prevention for Apache with mod-security - พยายามทำแล้ว แต่ยังไม่ได้ผล

ปิด allow _ url _ fopen โดยแก้ไข php.ini เปลี่ยนจาก on เป็น off

; Disable allow_url_fopen for security reasons
allow_url_fopen = Off

แก้ไขค่า default mysql เป็น MYISAM , utf8unicodeci โดยแก้ไขในไฟล์ /etc/my.cnf

# Add by softganz<br />
# Set default engin to MYISAM
# Set default collation to utf8_unicode_ci

default-storage-engine=MYISAM
collation-server = utf8_unicode_ci
character-set-server = utf8

บทความดี ๆ เกี่ยวกับ DirectAdmin

โดย Little Bear on 7 มิ.ย. 52 12:50

เพิ่งรู้ว่า Hosting Control Panel นั้นมีมากมายมหาศาลตอนที่เริ่มมี server เป็นของตนเอง ทำให้ต้องตัดสินใจเลือกว่าจะใช้ตัวไหนดี ซึ่งต้องลองดูหลาย ๆ ตัว ปวดหัวมาก ๆๆๆๆๆๆๆๆๆๆ

แบบที่ต้องจ่ายตังส์

แบบฟรี

เพิ่มเติมนิดหน่อยเป็นความรู้

โดย Little Bear on 6 มิ.ย. 52 14:07

ผมทดลองเปิดสถานีวิทยุออนไลน์ ซึ่งมีหลายสถานี (port) และต้องการให้มันเปิดแบบอัตโนมัติในตอนเปิด server ก็ไปเจอวิธีการและ code ในเว็บนี้

ลองทำตามโค๊ดข้างล่าง

#!/bin/bash
#
# chkconfig: 345  91 35
# description: Starts and stops sc_serv.<br />
#          You know, the mp3 streaming thang.
#
#   Version 1.3 (nov 4 2001)
#   Now with more revisions! System now checks for pid file before cat
#   to display so that we receive no error messages. System also displays
#   pids as we are killing old processes. Profanity was removed from the<br />
#   startup messages. Tests for a pid file before reporting success. Displays
#   the relay server name when we start the daemon up, so that we know
#   which servers are getting booted. Pushed the success marker over to the<br />
#   right and added [] because I am just a slave to fashion.
#
#   Version 1.2 (nov 3 2001)
#   Same exact shit, but runs as nobody for security reasons. Just
#   in case we are worried about buffer overflows or whatnot.
#   
#   Version 1.1 (nov 3 2001)
#   Starts stops and restarts jobs. Also checks for existing daemons
#   before calling a start, and exits without starting new ones. This
#   prevents you from being a dumbass and starting multiple listeners
#   on the same port. I would suggest using the restart command
#   in these cases. Also creates a shoutcast.pid file that can be used
#   to discover all of the (many) pids used by shoutcast when running.
#
#   Version 1.0 (nov 3 2001)<br />
#   Starts and stops successfully.<br />
#   Kills old jobs on start command. Dirty, but<br />
#   does the job well enough. Tested functional on
#   mandrake version 8.1 but should work on redhat<br />
#   or any other distro that supports a standard<br />
#   sysv startup script.
#
#   Instructions for use.
#   1: untargzip shoutcast into the directory of your choosing
#   2: copy sc_serv into the /usr/sbin directory<br />
#   3: Create the directory /etc/shoutcast
#   4: copy the shoutcast.conf file into your /etc/shoutcast dir.
#   5: Edit the shoutcast.conf file to match your needs.
#   6: Make as many more conf files as needed to support<br />
#      multiple streams. Be sure to edit these files so that
#      you are not starting multiple shoutcast servers that
#      are either listening or broadcasting on the same port.
#   7: Copy this file into the /etc/rc.d/init.d directory
#   8: chmod this file +x (chmod ug+x /etc/rc.d/init.d/shoutcast)
#   9: run chkconfig --add shoutcast from the /etc/rc.d/init.d dir.
#   10:Run /etc/rc.d/init.d/shoutcast start<br />
#   11:Drink a beer, or light one up, and enjoy the tunes.
#

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up. This line may cause an error on incompatible
# distributions. Remove it if necessary. Also remove if the startup always
# fails for no apparent reason.
[[ ${NETWORKING} = "no" ]] && exit 0<br />
<br />
<br />
stop (){
 <a class="hashtag" href="/tags/First">#First</a> we want to kill the original servers, so we don't get errors.
  echo "Killing old shoutcast servers."
  for oldpid in `ps -A | grep sc_serv | cut -c 0-6`; do
      kill -9 $oldpid
      if [[ $1 == "-v" ]]
      then
          echo $oldpid
      fi
  done
  rm -f /var/run/shoutcast.pid
}<br />
<br />
<br />
start (){
  <a class="hashtag" href="/tags/Now">#Now</a> we can start the servers up.
  if [[ $1 == "-v" ]]<br />
      then
          echo "Starting up the new shoutcast servers. Starting..."
      fi
    <br />
  servcount=`expr 0`
  for cfile in `ls /etc/shoutcast`; do
      echo -n $cfile
      echo -n " -> "
      grep ^RelayServer /etc/shoutcast/$cfile
      # This is the line where we actually run the shoutcast program!
      <a class="hashtag" href="/tags/sudo">#sudo</a> -u nobody /usr/bin/sc_serv /etc/shoutcast/$cfile > /dev/null &
      /usr/bin/sc_serv /etc/shoutcast/$cfile > /dev/null &
      let servcount=servcount+1
  done
  <a class="hashtag" href="/tags/Create">#Create</a> the pid file...
  ps -A | grep sc_serv | cut -c 0-6 > /var/run/shoutcast.pid
  <a class="hashtag" href="/tags/Done">#Done</a> now!
  echo "Started $servcount servers."
}<br />
<br />
<br />
case "$1" in
  start)    
  if [[ ! -e /var/run/shoutcast.pid ]]
  then
    start $2
    
    if [[ -e /var/run/shoutcast.pid ]]<br />
    then        
        echo "Startup                      [SUCCESS]"
    fi
    
  else
      if [[ $2 == "-v" ]]
      then
        echo "Shoutcast is already running these processes:"
        #Toldja! Checks before displaying pid file.
        if [[ -e /var/run/shoutcast.pid ]]
        then
            cat /var/run/shoutcast.pid
        fi
        echo "Try calling shoutcast restart in order to kill old processes."
    else
        echo "SC_SERV is already running. Try calling shoutcast restart."
    fi
    echo "Startup                      [FAILED]"
  fi
    ;;
  restart)
    stop $2
    if [[ $2 == "-v" ]]
        then
            echo "Waiting for the old servers to die..."
        fi

    sleep 4
    start $2
    if [[ -e /var/run/shoutcast.pid ]]<br />
    then        
        echo "Startup                      [SUCCESS]"
    fi
    ;;
  stop)
  if [[ -e /var/run/shoutcast.pid ]];
  then
    stop $2
    echo "Shoutcast shutdown                   [SUCCESS]"
  else
    echo "There are no registered shoutcast servers running right now. Attempting to kill anyways."
    stop $2
  fi
    ;;
  *)
    echo "Usage: shoutcast (start|stop|restart) [-v]"
    
esac

ขั้นตอนการติดตั้ง

  1. สร้างไฟล์ /etc/init.d/shoutcast แล้วเปลี่ยน attr เป็น 755
  2. copy ไฟล์ sc_serv (ที่ดาวน์โหลดมา) ไปไว้ที่ /usr/bin
  3. สร้างโฟล์เดอร์ /etc/shoutcast แล้วนำไฟล์คอนฟิกมาใส่ไว้ในนี้ จะกี่ไฟล์ก็ได้ ตอนเปิดเครื่องมันจะ start ให้หมด
โดย Little Bear on 5 มิ.ย. 52 12:22

ผมซื้อฮาร์ดดิสใหม่มาติดตั้งใน Ubuntu วิธีการติดตั้งดังนี้

1.ใช้ fdisk และ make.ext3 เพื่อกำหนดพาร์ทิชั่นให้กับฮาร์ดิสตัวใหม่

2.ทำการแบ่งพาร์ทิชั่นใหม่ (fdisk the partiion) บนฮาร์ดดินตัวใหม่โดยใช้โปรแกรม fdisk ตามขั้นตอนด้านล่าง

fdisk /dev/sdb
n
p
1
enter
enter
w

ระวัง หากพลาดจะทำให้ข้อมูลสูญหายทั้งหมดได้นะ

3.สร้าง ext3 filesystem ด้วยคำสั่ง

mkfs.ext3 /dev/sdb1

แล้วฮาร์ดดิสตัวใหม่ก็พร้อมที่จะถูก mount

ปล.อย่าลืมแก้ไขค่า /etc/fstab เพื่อเพิ่ม mount point ให้โดยอัตโนมัติหลังจากเปิดเครื่องซะด้วย

อ้างอิง

  1. install new harddisk on ubuntu box
  2. Ubuntu - How to add or create hard disk partition and make it automatically mount
โดย Little Bear on 4 มิ.ย. 52 23:04

ผมต้องการสำรองไฟล์ข้อมูลของ Express Accounting ทุกวัน โดยให้ใช้ชื่อวันเป็นชื่อไฟล์สำรอง

cd /home

สร้างไฟล์ /home/.backupdata ให้มีคำสั่งดังนี้

#!/bin/bash
DATE=`date +%a`  # Grab the day name of today
TARFILE=/tmp/backup-$DATE.tar.gz # Use it to create a filename
tar cvpfz $TARFILE Sharing > /tmp/backup-$DATE.log 2>&1

กำหนดสิทธิ์ให้เป็น rwxr-xr-x

chmod 755 .backupdata

กำหนดให้ crontab ทำการสำรองข้อมูลทุกวันเวลา 12.30 น. (เวลาพักเที่ยง)

crontab -e

กำหนดเวลาเป็น

30 12 * * *
603 items|« First « Prev 48 49 (50/61) 51 52 Next » Last »|