Archive for the 'Linux' Category
As default Ubuntu has no password set for the root user. To gain root access you have to type in your own user password. This is the password you set for the first user while installing Ubuntu. To manually set a password for the root user, type in the following in the shell: After that you are asked to type in the new root password twice. Finally, your root user has its own password.sudo passwd
สวัสดีครับ วันนี้(จริงๆเห็นนานแล้ว)เห็น มีเพื่อนๆบางคนมีปัญหา เวลาเปิดคอมแล้วมันขึ้นว่า
NTLDR is missing
Press Ctrl+Alt+Del to Restart
พอทำการ Restart มันก็ขึ้นแบบนั้น โครตเซ็งเลย งานในเครื่องก็เยอะ ที่สำคัญก็แยะ
เห็นแล้วให้นึกโครตเกลียดบิลเกตเลย บทความต่อไปนี้ ผมลอกเขามาให้ เืผือจะเป็นประโยชน์ แกผู้ที่ีมีปัญหาแบบนี้ ลองทำตามดูนะครับ

การแก้ไขปัญหาของการเกิด NTLDR is Missing สาเหตุส่วนใหญ่จะเกิดจากไฟล์บางไฟล์ที่ไดร์ฟ C: ใน Windows XP (เช่น ไฟล์ AUTOEXEC.BAT, boot.ini, NTDETECT.COM, ntldr) ไฟล์ใดไฟล์หนึ่งเกิดความเสียหายนั่นเอง
ซึ่งอาจจะเกิดจากการทำงานที่ผิดพลาดของตัววินโดวส์เอง หรืออาจจะเกิดจากการก่อกวนของไวรัสก็เป็นไปได้ และปัญหานี้เมื่อผู้ใช้งานทั่วๆไปเจอ ส่วนใหญ่จะใช้วิธีการแก้ปัญหาเฉพาะหน้าด้วยการลงวินโดวส์ใหม่ แล้วจะแก้ไขได้อย่างไรล่ะ ถ้าไม่ต้องลงวินโดวส์ใหม่น่ะ..
Note. การที่เราจะมองเห็นไฟล์ทั้ง 4 ตัวนี้ได้จากเครื่องปกติหรือเครื่องของเราที่เกิดปัญหาจะต้องเข้าไปเปิดโชว์ไฟล์ระบบใน Folder Options เสียก่อน โดยให้เข้าไปที่ Start > Control Panel > Folder Options แล้วตั้งค่าตามรูป

วิธีแก้ไขที่ 1 ให้ถอดฮาร์ดดิสต์ในเครื่องของเราที่มีอาการ เอาไปต่อพ่วงกับอีกเครื่องที่ใช้งานได้ปกติ เพื่อก็อปปี้ไฟล์ 4 ไฟล์ได้แก่ AUTOEXEC.BAT, boot.ini, NTDETECT.COM, ntldr มาใส่ไว้ในฮาร์ดดิสต์ของเรา เพื่อแทนที่ไฟล์เดิมที่มีปัญหา (วิธีการนี้อาจจะยากลำบากสักหน่อยสำหรับท่านที่ไม่ค่อยมีความชำนาญในการถอดอุปกรณ์คอมพิวเตอร์กับเครื่องตัวเอง แล้วเอาไปต่อพ่วงกับเครื่องอื่น)
+ วิธีการก็ให้เปิด My Computer หรือ Windows Explorer จากเครื่องที่มีปัญหา แล้วก็อปปี้ไฟล์ทั้ง 4 (สมมติว่าไดร์ฟ C, D เป็นฮาร์ดดิสต์ของเครื่องปกติ และไดร์ฟ F, G, H เป็นฮาร์ดดิสต์จากเครื่องของเราที่มีปัญหา) จากไดร์ฟ C ไปวางทับไฟล์เดิมในฮาร์ดดิสต์ของเราที่มีวินโดวส์อยู่ที่ไดร์ฟ F (ก็ คือไดร์ฟ C เมื่อต่อในเครื่องของเรานั่นแหละ)
+ เมื่อก็อปปี้เสร็จแล้วก็ถอดฮาร์ดดิสต์ลูกนี้ไปต่อกลับเข้าที่เดิมในเครื่องของเรา แล้วเปิดเครื่องเข้าวินโดวส์ได้ตามปกติแล้วครับ
วิธีแก้ไขที่ 2 จะต้องพึ่งบทความ >จับ Windows XP (BartPE) มายัดใส่ไว้ใน Toshiba กันนะตัว< เข้าช่วยด้วย ถ้าหากท่านมี USB Drive ไว้ใช้งานอยู่แล้ว ให้ก็อปปี้ไฟล์ทั้ง 4 ไฟล์ คือ AUTOEXEC.BAT, boot.ini, NTDETECT.COM, ntldr มาใส่ไว้ใน USB Drive ซะเลย แล้วสร้างโฟลเดอร์เป็นชื่อตามที่ท่านต้องการหรือจะก็อปปี้ไฟล์ทั้ง 4 ไฟล์นี้ไปเก็บไว้ที่ไดร์ฟ D ในฮาร์ดดิสต์ของท่านก็ได้ เมื่อเกิดปัญหาก็แค่เรียกใช้งาน BartPE ขึ้นมา
Note1. สำหรับวิธีนี้ เมนบอร์ดที่ท่านใช้จะต้องรองรับกับการบูตด้วย USB Drive ด้วยนะครับ ไม่งั้นจะไม่สามารถเรียกใช้งาน BartPE ได้
Note2. หรือถ้าไม่แน่ใจว่าเมนบอร์ดของท่านสามารถบูตจาก USB Drive ได้หรือไม่นั้น เมื่อกดสวิตช์เปิดเครื่องหรือรีสตาร์ทเครื่องใหม่ให้บูตเข้า Boot Menu ซึ่งจะมีวิธีกด 2 แบบ แล้วแต่ยี่ห้อของเมนบอร์ด เช่น
เมนบอร์ด Asus, ECS ให้กด F8 แล้วเลือกไดร์ฟ USB Drive
เมนบอร์ด Asrock ให้กด F11 แล้วเลือกไดร์ฟ USB Drive
เมนบอร์ด Gigabyte ให้กด F12 แล้วเลือกไดร์ฟ USB Drive
+ เมื่อบูตด้วย BartPE แล้ว ให้เข้าไปที่ Go > Programs > A43 File Management Utility
+ ตัวโปรแกรม A43 File Management Utility จะถูกเปิดขึ้นมา ซึ่งในที่นี้ผมแบ็คอัพไฟล์ทั้ง 4 เก็บไว้ที่ไดร์ฟ D เมื่อเจอกับเหตุการณ์อย่างนี้ก็แค่ก็อปปี้ไฟล์ทั้ง 4 ไปวางทับไฟล์เดิมที่ไดร์ฟ C ได้เลย
+ เสร็จแล้วรีสตาร์ทเครื่องใหม่ เข้าวินโดวส์ได้ตามปกติเลยครับ
Note. ก่อนจบ ถ้าหากท่านไม่มี USB Drive สำหรับการทำ Windows XP (BartPE) ไว้เดี๋ยวถ้ามีเวลา ผมจะอัพโหลด Windows XP MiniPE และ MiniXPE LiveCD สำหรับใช้งานกับแผ่นซีดีให้ได้ลองเอาไปใช้แทน BartPE กันครับ สวัสดีคร้าบ
บทความนี้ ผมลอกมาจาก
http://www.varietypc.net/modules.php?name=Content&pa=showpage&pid=50
So you’ve heard about Ubuntu everywhere on the Internet and you’ve decided to install it on your computer (just to see if what you heard about it is true or not) and you don’t know how to do it? Look no further! This guide will make things very simple for you, as it will teach you, step-by-step, how to install the latest version of Ubuntu operating system (current version is 8.04 LTS codename Hardy Heron) on your PC in no more than 10 minutes (depending on your computer specs, of course). Are you ready? Let’s start!
![]() |
Then select the second option “Install Ubuntu” and hit Enter:
![]() |
Step 4 - Wait for the CD to load into RAM, and when the installer appears, select your native language and click the ‘Forward’ button:
![]() |
![]() |
Where are you?
The second screen will feature a map of the Earth with little red dots, so you can select your city/country. Upon the current selection of your location, the time for the final system will adjust accordingly. You can also select your current location from the drop down list situated at the bottom of the window. Click the ‘Forward’ button after you have selected your desired location.
![]() |
Test your keyboard
On the third screen, you will be asked to select the keyboard layout that suits you best (default is U.S. English). You can also test your keyboard on the little text input field situated at the bottom of the window. Click the ‘Forward’ button when you have finished with the keyboard configuration.
![]() |
Hard disk partitioning
Hold on, don’t leave just yet! The hard disk partitioning is an easy task, so I am quite sure you will manage to handle it too. You have three options:
![]() |
1. If you want to keep your existing operating system (e.g. Dual boot with Windows XP), select the first option: “Guided – resize the partition and use the freed space”.
2. If you want to delete your existing operating system and you want to let the installer to automatically partition the hard drive for you, select the second option: “Guided – use entire disk”.
3. Manual is the third choice at this point and I strongly suggest you to use it if you don’t have any other operating system installed and your hard drive does not contain important data on it. Follow the instructions below:
Choose the hard drive partition (or entire hard drive if you don’t have any partitions) you want to format and click the ‘Delete partition’ button to delete the selected partitions. In the end, you should have a single entry called “free space”, select it and click the ‘New partition’ button to create the ‘root’ partition. Select “Primary” for the partition type, set the size of the partition (in megabytes), leave the “Location for the new partition” and “Use as” options as they are and select the mount point “/” (just like in the image below).
![]() |
You should still have a “free space” line, select it and click the ‘New partition’ button to create the ‘home’ partition. Select “Logical” for the partition type, set the size of the partition (in megabytes), leave the “Location for the new partition” and “Use as” options as they are and select the mount point “/home” (just like in the image below).
![]() |
You should still have some “free space” left, so select it and click the ‘New partition’ button to create the ‘swap’ partition. Select “Logical” for the partition type, set the size of the partition (in megabytes) twice your RAM (e.g. if you have 512 RAM, set the size to 1024), leave the “Location for the new partition” option as it is and set the “Use as” option to ‘swap’.
WARNING: Be aware that all the data on the selected hard drive will be ERASED and IRRECOVERABLE!
Click the ‘Forward’ button to continue with the installation.
Who are you?
Here you must do exactly what the title of this step tells you to do. You must fill in a couple of fields with your real name, the name you want to use to log in on your Ubuntu OS (username), password and the name of the computer (automatically generated). Once you have finished with this step, click the Forward button again (for the last time).
![]() |
Are you really ready for Ubuntu?
If you have successfully arrived at this point, then you are definitely ready for your new Ubuntu operating system. So, what are you waiting for? Click the ‘Install’ button NOW!
![]() |
![]() |
The Ubuntu 8.04 (Hardy Heron) operating system will be installed…
![]() |
Step 5 - After approximately 8 to 10 minutes, a pop-up window will appear, notifying you that the installation is complete and you need to restart the computer in order to use the newly installed Ubuntu:
![]() |
![]() |
![]() |
You’ve probably clicked the ‘Restart now’ button, because you were very excited to see your new Ubuntu operating system at work. Well then, have fun using it!
Today Ubuntu won the “Best Desktop Solution” Product Excellence Award at LinuxWorld Conference and Expo 2008 in San Francisco, California for a second consecutive year.
From the site:
“Judged by a group of respected industry experts managed by LinuxWorld.com, the LinuxWorld Product Excellence Awards recognize product and service innovations by LinuxWorld® and NGDC exhibitors.
Product Excellence Awards are divided into 12 product categories, including a “Best of Show,” that represent major areas of innovation in the Linux and open source community. “
Last but not least, I also want to thank all of my colleagues who were pretty busy at the booth, and of course those taking care of all things Ubuntu in the 22 countries where we have employees – including Zaïd Al Hamami, Kurt von Finck, David Bensimon and Adilson Olveira who fired last-minute comments that helped me put the finishing touches to the Ubuntu Desktop presentation. Cheers to all!
Common SSH Commands or Linux Shell Commands,
ls : list files/directories in a directory, comparable to dir in windows/dos.
ls -al : shows all files (including ones that start with a period), directories, and details attributes for each file.
cd : change directory · · cd /usr/local/apache : go to /usr/local/apache/ directory
cd ~ : go to your home directory
cd - : go to the last directory you were in
cd .. : go up a directory cat : print file contents to the screen
cat filename.txt : cat the contents of filename.txt to your screen
chmod: changes file access permissions
The set of 3 go in this order from left to right:
0 = — No permission
1 = –X Execute only
2 = -W- Write only
3 = -WX Write and execute
4 = R– Read only
5 = R-X Read and execute
6 = RW- Read and write
7 = RWX Read, write and execute
Usage:
chmod numberpermissions filename
chmod 000 : No one can access
chmod 644: Usually for HTML pages
chmod 755: Usually for CGI scripts
chown: changes file ownership permissions
The set of 2 go in this order from left to right:
USER – GROUP
chown root myfile.txt : Changes the owner of the file to root
chown root.root myfile.txt : Changes the owner and group of the file to root
tail : like cat, but only reads the end of the file
tail /var/log/messages : see the last 20 (by default) lines of /var/log/messages
tail -f /var/log/messages : watch the file continuously, while it’s being updated
tail -200 /var/log/messages : print the last 200 lines of the file to the screen
more : like cat, but opens the file one screen at a time rather than all at once
more /etc/userdomains : browse through the userdomains file. hit Spaceto go to the next page, q to quit
pico : friendly, easy to use file editor
pico /home/burst/public_html/index.html : edit the index page for the user’s website.
File Editing with VI ssh commands
vi : another editor, tons of features, harder to use at first than pico
vi /home/burst/public_html/index.html : edit the index page for the user’s website.
Whie in the vi program you can use the following useful commands, you will need to hit SHIFT + : to go into command mode
:q! : This force quits the file without saving and exits vi
:w : This writes the file to disk, saves it
:wq : This saves the file to disk and exists vi
:LINENUMBER : EG :25 : Takes you to line 25 within the file
:$ : Takes you to the last line of the file
:0 : Takes you to the first line of the file
grep : looks for patterns in files
grep root /etc/passwd : shows all matches of root in /etc/passwd
grep -v root /etc/passwd : shows all lines that do not match root
ln : create’s “links” between files and directories
ln -s /usr/local/apache/conf/httpd.conf /etc/httpd.conf : Now you can edit /etc/httpd.conf rather than the original. changes will affect the orginal, however you can delete the link and it will not delete the original.
last : shows who logged in and when
last -20 : shows only the last 20 logins
last -20 -a : shows last 20 logins, with the hostname in the last field
w : shows who is currently logged in and where they are logged in from.
who : This also shows who is on the server in an shell.
netstat : shows all current network connections.
netstat -an : shows all connections to the server, the source and destination ips and ports.
netstat -rn : shows routing table for all ips bound to the server.
top : shows live system processes in a nice table, memory information, uptime and other useful info. This is excellent for managing your system processes, resources and ensure everything is working fine and your server isn’t bogged down.
top then type Shift + M to sort by memory usage or Shift + P to sort by CPU usage
ps: ps is short for process status, which is similar to the top command. It’s used to show currently running processes and their PID.
A process ID is a unique number that identifies a process, with that you can kill or terminate a running program on your server (see kill command).
ps U username : shows processes for a certain user
ps aux : shows all system processes
ps aux –forest : shows all system processes like the above but organizes in a hierarchy that’s very useful!
touch : create an empty file
touch /home/burst/public_html/404.html : create an empty file called 404.html in the directory /home/burst/public_html/
file : attempts to guess what type of file a file is by looking at it’s content.
file * : prints out a list of all files/directories in a directory
du : shows disk usage.
du -sh : shows a summary, in human-readble form, of total disk space used in the current directory, including subdirectories.
du -sh * : same thing, but for each file and directory. helpful when finding large files taking up space.
wc : word count
wc -l filename.txt : tells how many lines are in filename.txt
cp : copy a file
cp filename filename.backup : copies filename to filename.backup
cp -a /home/burst/new_design/* /home/burst/public_html/ : copies all files, retaining permissions form one directory to another.
cp -av * ../newdir : Copies all files and directories recurrsively in the current directory INTO newdir
mv : Move a file command
mv oldfilename newfilename : Move a file or directory from oldfilename to newfilename
rm : delete a file
rm filename.txt : deletes filename.txt, will more than likely ask if you really want to delete it
rm -f filename.txt : deletes filename.txt, will not ask for confirmation before deleting.
rm -rf tmp/ : recursively deletes the directory tmp, and all files in it, including subdirectories. BE VERY CAREFULL WITH THIS COMMAND!!!
TAR: Creating and Extracting .tar.gz and .tar files
tar -zxvf file.tar.gz : Extracts the file
tar -xvf file.tar : Extracts the file
tar -cf archive.tar contents/ : Takes everything from contents/ and puts it into archive.tar
gzip -d filename.gz : Decompress the file, extract it
ZIP Files: Extracting .zip files shell command
unzip file.zip
Firewall – iptables commands
iptables -I INPUT -s IPADDRESSHERE -j DROP : This command stops any connections from the IP address
iptables -L : List all rules in iptables
iptables -F : Flushes all iptables rules (clears the firewall)
iptables –save : Saves the currenty ruleset in memory to disk
service iptables restart : Restarts iptables
Apache Shell Commands
httpd -v : Outputs the build date and version of the Apache server.
httpd -l : Lists compiled in Apache modules
httpd status : Only works if mod_status is enabled and shows a page of active connections
service httpd restart : Restarted Apache web server
MySQL Shell Commands
mysqladmin processlist : Shows active mysql connections and queries
mysqladmin drop databasenamehere : Drops/deletes the selected database
mysqladmin create databasenamehere : Creates a mysql database
Restore MySQL Database Shell Command
mysql -u username -p password databasename : Restores a MySQL database from databasefile.sql
Backup MySQL Database Shell Command
mysqldump -u username -p password databasename > databasefile.sql : Backup MySQL database to databasefile.sql
kill: terminate a system process
kill -9 PID EG: kill -9 431
kill PID EG: kill 10550
Use top or ps ux to get system PIDs (Process IDs)
EG:
| PID | TTY | TIME | COMMAND |
| 10550 | pts/3 | 0:01 | /bin/csh |
| 10574 | pts/4 | 0:02 | /bin/csh |
| 10590 | pts/4 | 0:09 | APP |
Each line represents one process, with a process being loosely defined as a running instance of a program. The column headed PID (process ID) shows the assigned process numbers of the processes. The heading COMMAND shows the location of the executed process.
Putting commands together
Often you will find you need to use different commands on the same line. Here are some examples. Note that the | character is called a pipe, it takes date from one program and pipes it to another.
> means create a new file, overwriting any content already there.
>> means tp append data to a file, creating a newone if it doesn not already exist.
< send input from a file back into a command.
grep User /usr/local/apache/conf/httpd.conf |more
This will dump all lines that match User from the httpd.conf, then print the results to your screen one page at a time.
last -a > /root/lastlogins.tmp
This will print all the current login history to a file called lastlogins.tmp in /root/
tail -10000 /var/log/exim_mainlog |grep domain.com |more
This will grab the last 10,000 lines from /var/log/exim_mainlog, find all occurances of domain.com (the period represents ‘anything’,
– comment it out with a so it will be interpretted literally), then send it to your screen page by page.
netstat -an |grep :80 |wc -l
Show how many active connections there are to apache (httpd runs on port 80)
mysqladmin processlist |wc -l
Show how many current open connections there are to mysql
ถ้าพูดถึงสิ่งที่ถือเป็นจุดกำเนิดของการร่วมพัฒนาลินุกซ์ หลายๆท่านคงต้องนึกถึงข้อความที่ Linus Torvalds ได้นำไปเผยแพร่ไว้ในกลุ่มข่าวของ comp.os.minix ซึ่งทำให้นักพัฒนาโปรแกรมอีกจำนวนมาก สนใจและหันมาช่วยพัฒนาแก่นของระบบปฏิบัติการตัวนี้ จนทำให้ลินุกซ์มีความสามารถอย่างมากมายในทุกวันนี้ ซึ่งผมได้นำข้อความนั้น ที่ถือได้ว่าเป็นประวัติศาสตร์หน้าหนึ่งของต้นกำเนิดลินุกซ์ มาฝากให้ได้อ่านกันครับ
From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds)
Newsgroups: comp.os.minix
Subject: What would you like to see most in minix?
Summary: small poll for my new operating system
Message-ID: <1991Aug25.205708.9541@klaava.Helsinki.FI>
Date: 25 Aug 91 20:57:08 GMT
Organization: University of Helsinki
Hello everybody out there using minix -
I’m doing a (free) operating system (just a hobby, won’t be big and professional like gnu) for 386(486) AT clones. This has been brewing since april, and is starting to get ready. I’d like any feedback on things people like/dislike in minix, as my OS resembles it somewhat (same physical layout of the file-system (due to practical reasons) among other things).
I’ve currently ported bash(1.08) and gcc(1.40), and things seem to work. This implies that I’ll get something practical within a few months, and I’d like to know what features most people would want. Any suggestions are welcome, but I won’t promise I’ll implement them
Linus (torvalds@kruuna.helsinki.fi)
PS. Yes – it’s free of any minix code, and it has a multi-threaded fs. It is NOT protable (uses 386 task switching etc), and it probably never will support anything other than AT-harddisks, as that’s all I have
.
ที่มา : http://thaiopensource.org




























