Category: Linux

forget mySQL root password

By , 19 กรกฎาคม 2010 15:31

หายหน้าไปน๊านนาน หลายท่านคงนึกว่าคนเขียน ม่องไปล่ะ
ป่าวครับไปเตรียมตัวกับหุ้นส่วน(เพื่อนกาก) เตรียมเปิด กิจการที่ถนัด กันอยู่
ซักพักคงได้เห็นกันวันนี้ก็มีปัญหา แล้วก็หาข้อมูลจนทำได้เลยนำมาให้เพื่อน ๆ ดูน่ะครับ
เป็นปัญหาของตัว mysql ที่มีคนแย่งไป (ได้ยังไงไม่รู้) เลยต้องไปเอาคืนมาเพื่อให้มันทำงานได้ปกติสุข
วันนี้เลยเป็นวันที่ แจ่มอุราอีกวัน ทำงานได้อย่างฟลุ๊ก ๆ  :D จัดไปลุ๊ยยย
เพิ่ม ลงไปในไฟล์ my.cnf ตามตัวอย่าง

[mysqld]
skip-grant-table 

จากนั้นให้ restart service mysql
ต่อด้วยคำสั่ง

 ... อ่านต่อ ... 'forget mySQL root password'»

วิทยุออนไลน์ – ShoutCast

By , 24 กรกฎาคม 2009 15:17

วันนี้ก็โดดงานมานั่งหาข้อมูลทำ วิทยุออนไลน์
และแล้วก็พบหนทางที่จะจัดตั้งสถานีแล้ว
ก็ไม่รอช้าคับ จัดเพลงทันที แต่ตอนนี้ยังอยู่ในช่วง ปรับปรุงระบบครับ
เอา Bit rate กันสูง ๆ ไปเลย ฮิ้ว ๆ
ฟังได้จาก ลิงค์นี้คับ

http://202.44.52.82:8000/listen.pls

ให้เครดิตเว็บ ผู้ที่ค้นผบก่อน

นี่คับ http://sorawee.bangpreang.com/?p=379
ลงค์ อื่น ๆ ตามกันเองน่ะคับ ผมตามหาไม่เจอต้นฉบับขอรับ … อ่านต่อ … 'วิทยุออนไลน์ – ShoutCast'»

Crontab backup database

By , 27 กุมภาพันธ์ 2009 15:16

จากเมื่อวาน << คลิ๊กเพื่อดูเรื่องที่ต่อเนื่อง

วันนี้จะบอกวิธีการติดตั้ง Crontab กันน่ะคับ
เริ่มจากการสร้างไฟล์ Crontab ขึ้นมาก่อนน่ะคับ

15 4 * * * php -q /home/backup/rbackup.php > /dev/null 2>&1

backup_crontab

ความหมายของมันก็คือ ทุก ๆ วัน เวลา ตี 4.15 ให้ทำการ รัน สริปต์ ที่ชื่อว่า rbackup.php
เมื่อสร้างเสร็จแล้ว คราวนี้ก็มาดูผลการทำงาน ของ script กันน่ะคับ … อ่านต่อ … 'Crontab backup database'»

PHP Script Backup Database

By , 26 กุมภาพันธ์ 2009 20:17

วันนี้ผมจะมานำเสนอ การ Backup database โดยใช้ php น่ะคับ

เป็นการ backup ข้อมูลผ่าน สริปต์ โดยใช้ ตัว crontab ใน Linux เป็นตัวเรียก สริปต์นี้

ใ้ห้ทำงานน่ะคับ วันนี้จะนำเสนอ ในเรื่องของ สริปต์กันก่อนน่ะคัีบ

ผมได้ เรียนรู้บางคำสั่ง จาก อาจารย์ เปิ้ล แอบ เซิฟ  และ การโค้ดดิ้ง แนะแนวโดยพี่แม๊กมอไซค์คับ

โดยการ backup ในครั้งนี้ เมื่อทำการแบ๊กอัพ เสร็จแล้ว มันจะส่งเมล์ไปบอก ยัง ผู้ดูแลระบบ
ในครั้งต่อไปผมจะ นำ คำสั่ง พร้อมกับ ภาพ มาประกอบให้ดูกันน่ะคับ
ขอบคุณทุกท่าน ที่ดูแล้ว จะนำไปให้ให้เกิดประโยชน์ต่อไป
ขอบคุณทุกท่าน ที่เอาไปใช้แล้วให้เครดิตผม

สังคมน่าอยู่เพราะว่ามีคนมีน้ำใจ … อ่านต่อ … 'PHP Script Backup Database'»

SSH

By , 28 มกราคม 2009 15:35
Linux / Unix Command: ssh
Command Library

NAME

ssh – OpenSSH SSH client (remote login program)

SYNOPSIS

ssh [-l login_name ] hostname | user@hostname [command ]
ssh [-afgknqstvxACNTX1246 ] [-b bind_address ] [-c cipher_spec ] [-e escape_char ] [-i identity_file ] [-l login_name ] [-m mac_spec ] [-o option ] [-p port ] [-F configfile ] [-L port host hostport ] [-R port host hostport ] [-D port ] hostname | user@hostname [command ]

วิธีการใช้งาน ssh -l username hostname,ipaddress

credit : http://linux.about.com/od/commands/l/blcmdl1_ssh.htm

553 could not create file

By , 28 มกราคม 2009 15:29

เมื่อเกิดปัญหา 553 colude not create file

เกิดจาก ไม่สามารถย้ายไฟล์ไปยังจุดหมายปลายทางได้เนื่องจากสิทธิ์ไม่พึ่งกระทำ


Macintosh:~ steffentchr$ ftp ftp.dummy.com
Connected to ftp.dummy.com.
220 (vsFTPd 2.0.3)
Name (ftp.dummy.com):steffentchr): steffen
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
226 Directory send OK.
ftp> put Desktop/stc1
local: Desktop/stc1 remote: Desktop/stc1
229 Entering Extended Passive Mode (|||64727|)
553 Could not create file.

วิธีการแก้ไขปัญหานี้คับ

chmod 750  ไปยัง directory ที่จะทำการย้ายไฟล์คับก็จะไม่เกิดปัญหานี้คับผม

ให้เครดิตผมด้วยน่ะคับ www.sudej.com

คำสั่งเบื้องต้น vsftpd

By , 28 มกราคม 2009 15:26

credit : http://www.davelozinski.com/tutorials/ftp/index.php?1233128757977

Commands:

  • ftp [host] – open an ftp session with the specified host machine.
    Examples:
    C:\> ftp neserve0
    C:\> ftp erols.erols.com
  • open [host] – Establish a connection to the specified host when you’re already at an ftp prompt.
    Examples:
    ftp> open neserve0
    ftp> open erols.erols.com
  • user [username] – Log into an ftp server when you’re already connected in an ftp session.
    Examples:
    ftp> user dlozinsk
    ftp> user anonymous
  • ls [remote-directory] – Print a listing of the contents of remote-directory on the remote machine. The listing includes any system-dependent information that the server chooses to include.
    Examples:
    ftp> ls
    ftp> ls /usr/local/bin
  • dir [remote-directory] [local-file] – Print a listing of the contents in the directory remote-directory, and optionally, placing the output in local-file.
    Examples:
    ftp> dir
    ftp> dir /usr/local/bin
  • help [command] – Print an informative message about the meaning of command. If no argument is given, ftp prints a list of the known commands.
    Examples:
    ftp> help
    ftp> help dir
  • ? – synonym for help.
    Examples:
    ftp> ?
    ftp> ? dir
  • pwd – Print the name of the current working directory on the remote machine.Often times this includes printing the full path.
    Example:
    ftp pwd>
  • cd [remote-directory] – Change the working directory on the remote machine to remote-directory.
    Examples:
    ftp> cd /tmp
    ftp> cd ../..
  • lcd [directory] – Change the working directory to directory on the local machine. If no directory is specified, the user’s home directory is used.
    Examples:
    ftp> lcd c:\temp
    ftp> lcd ../..
  • ascii – Set the file transfer type to ASCII . Only use this transfer method for text-files. That is, files ending in .txt, html files, and/or perl programs.
    Example:
    ftp> ascii
  • binary – Set the file transfer type to support binary file transfer. Use this transfer method for anything other than a textfile. For example, Word documents, pdf files, gifs, jpgs, java class files, etc.
    Example:
    ftp> binary
  • put [local-file] – Put (upload) local-file to the remote machine. No wildcards!
    Examples:
    ftp> put index.html
    ftp> put test.txt
  • get [remote-file] – Retrieve (download) remote-file and store it on the local machine. No wildcards! Can only get one file at a time.
    Examples:
    ftp> get index.html
    ftp> get /tmp/readme.txt
  • mput [local-files] – Expand wild cards in the list of local-files given as arguments and do a put for each file in the resulting list. The list of files should be separated by spaces.
    Examples:
    ftp> mput *
    ftp> mput *.html
    ftp> mput *.html test.txt README
  • mget [multiple files and/or wildcards] – Expand wild cards in the list of remote files given as arguments and do a get for each file in the resulting list. The list of files should be separated by spaces.
    Examples:
    ftp> mget *
    ftp> mget *.gif
    ftp> mget *.doc image.gif salaries*
  • prompt – Toggle interactive prompting. Interactive prompting occurs during multiple file transfers to allow the user to selectively retrieve or store files. If prompting is turned off, any mget or mput will transfer all files, and any mdelete will delete all files.
    Example:
    ftp> prompt
  • bell – Arrange that a bell be sounded after each file transfer command is completed.
    Example:
    ftp> bell
  • delete [remote-file] – Delete the remote-file on the remote machine.
    Examples:
    ftp> delete test.doc
    ftp> delete /tmp/temporary_file.txt
  • mkdir [new-directory-name] – create a directory new-directory-name on the remote machine.
    Examples:
    ftp> mkdir temp
    ftp> mkdir /tmp/dave
  • rmdir [directory-name] – Delete the directory entitled directory-name on the remote machine.
    Examples:
    ftp> rmdir temporary_directory
    ftp> rmdir /tmp/test_dir
  • rename [old-file-name] [new-file-name] – Rename the file old-file-name on the remote machine, to the file new-file-name.
    Examples:
    ftp> rename index.htm homepage.html
    ftp> rename /tmp/readme.txt /tmp/README_NOW.txt
  • bye – Terminate the FTP session with the remote server and exit ftp. On Unix, an end of file should also terminate the session and exit.
    Example:
    ftp> bye
  • quote site chmod xxx [file name] – Change the permission modes of the file file-name on the remote system to xxx mode. Note that the chmod command is not always implemented.
  • get [file-name] “|more” – Instead of downloading and saving the file file-name on the local machine, you view its contents. Only recommended to use with text files.

ปรับแต่ง vsftpd

By , 28 มกราคม 2009 15:25

เป็นการ เพิ่ม สิทธิต่าง ๆ และ กำหนด กลุ่มและ สิทธิ์ผู้ใช้งาน ของ vsftpd


[root@sudej home]# groupadd ftp-users
[root@sudej home]# mkdir /home/ftp-docs
[root@sudej home]# chmod 750 /home/ftp-docs
[root@sudej home]# chown root:ftp-users /home/ftp-docs
[root@sudej home]# useradd -g ftp-users -d /home/ftp-docs user1
[root@sudej home]# passwd user1

vsftpd

By , 28 มกราคม 2009 15:21

อ้างอิงจาก http://rd.cc.psu.ac.th/content/view/20/46/

เป็นคำแนะนำติดตั้งจัดการปรับแต่ง ftp server
ต้นแบบทดสอบด้วย linux ubuntu 6.06, fedora core 5,4

วิธีติดตั้ง ftp server ด้วยโปรแกรม vsftpd

  1. ติดตั้งโปรแกรม vsftpd
    หากเป็น ubuntu ให้ติดตั้งด้วยคำสั่ง
    apt-get install vsftpd

    หากเป็น fedora ให้ติดตั้งด้วยคำสั่ง
    yum install vsftpd

  2. หากเป็น fedora แก้ไขให้ทำงานทุกครั้งที่บูทเครื่อง
    chkconfig vsftpd on
  3. สั่งให้ทำงานด้วยคำสั่งว่า
    /etc/init.d/vsftpd start … อ่านต่อ … 'vsftpd'»

การตั้งค่า utf8

By , 21 มกราคม 2009 18:33

สำหรับท่านที่ เปลี่ยนมาใช้ utf-8 แล้วเกิดปัญหา
เวลา Browser เปิดข้อมูลแล้วเกิดปัญหาตัวอักษรไม่แสดงผล
ตามที่เราตั้งค่าไว้
21-1-2552-18-24-16

ปัญหามันเกิดมาจาก ตัว Content-Type:text/html; ไม่ยอมเรียกค่า ปกติมันออกมา

เราก็มีวิธีแก้ปัญหาดังนี้คับ

สำหรับคนใช้ Linux fedora, redhat น่ะคับ
อับดับแรกก็ไปแก้ไข ไฟล์ที่ชื่อว่า httpd.conf … อ่านต่อ … 'การตั้งค่า utf8'»

Panorama Theme by Themocracy