Archive for April, 2008



การใช้ทรัพย์สินทางปัญญาในธุรกิจอินเทอร์เน็ตมาเป็นหลักประกันการชำระหนี้

Sunday 27 April 2008 @ 9:35 pm

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

การประกันการชำระหนี้ตามกฎหมายไทยนั้น สามารถแบ่งแยกออกได้เป็น 2 ประเภทคือ 1) การประกันการชำระหนี้โดยตัวบุคคล ที่เรียกว่า การค้ำประกัน ซึ่งในทางกฎหมายเรียกว่า “บุคคลสิทธิ” หมายถึง เจ้าหนี้มีสิทธิเหนือบุคคลผู้เป็นผู้ค้ำประกันที่จะให้ชำระหนี้ตามสัญญาค้ำ ประกันเมื่อลูกหนี้ผิดนัดผิดสัญญา เช่น นาย ก. ค้ำประกันนาย ข. ในเรื่องของความเสียหายที่อาจเกิดจากการจ้างงาน หากนาย ข. ก่อให้เกิดความเสียหาย บริษัทก็เรียกให้นาย ก. รับผิดตามสัญญาค้ำประกันได้ เป็นต้น

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

จากลักษณะดังกล่าว ปัญหาที่เกิดจากการปรับใช้หลักกฎหมายเรื่องการจำนำ จำนอง คือ ทรัพย์สินทางปัญญานั้น เป็นทรัพย์ที่ไม่มีรูปร่างและไม่สามารถจับต้องได้ จึงมีปัญหาว่าจะปรับใช้ด้วยวิธีการจำนำหรือจำนอง

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

เช่น ก.เป็นเจ้าของเครื่องหมายการค้าเครื่องหมายหนึ่ง กู้ยืมเงินจากธนาคารในวงเงิน 10 ล้านบาท สัญญากู้ฉบับดังกล่าวอาจระบุให้ ก. ต้องโอนเครื่องหมายการค้าของตนให้แก่ธนาคารเพื่อเป็นหลักประกันการชำระหนี้ โดยมีเงื่อนไขว่าหาก ก. ชำระหนี้ตามสัญญากู้ครบถ้วน ธนาคารก็จะโอนเครื่องหมายการค้าดังกล่าวกลับคืนมาให้ ก. เช่นเดิม หรืออีกลักษณะหนึ่ง คือ ก. ตกลงว่าหาก ก. ผิดนัดชำระหนี้ ก็ตกลงที่จะโอนเครื่องหมายการค้าดังกล่าวให้แก่ธนาคาร

ทั้งนี้ ในการร่างสัญญาประเภทดังกล่าวนั้น ข้อสำคัญที่ต้องพิจารณา คือ

1.1 ต้องระบุให้ชัดเจนถึงรายละเอียดของทรัพย์สินทางปัญญาประเภทใดที่จะใช้เป็นหลักประกันการชำระหนี้ (Identify Assets)

1.2 เจ้าหนี้ต้องตรวจสอบเพื่อยืนยันกรรมสิทธิ์และสถานะของทรัพย์สินทางปัญญา (Confirm Record Title and the Status of Recorded Rights)

1.3 เจ้าหนี้ต้องตรวจสอบรายละเอียดของทรัพย์สินทางปัญญาที่จะใช้เป็นหลักประกัน จากบันทึกทางทะเบียนของทรัพย์สินทางปัญญากับหน่วยงานที่เกี่ยวข้อง ได้แก่ กรมทรัพย์สินทางปัญญา (Review of the Files)

1.4 เจ้าหนี้ต้องขอข้อมูลเกี่ยวกับรายชื่อและกำหนดระยะเวลาต่ออายุของทรัพย์สินทางปัญญาจากลูกหนี้ (Obtain Lists of Renewal date)

1.5 ต้องตรวจสอบและยืนยันความสมบูรณ์และการมีผลบังคับใช้ของทรัพย์สินทางปัญญาที่จดทะเบียน (Verify Validity and Enceability)

1.6 เจ้าหนี้ต้องตรวจสอบว่าทรัพย์สินทางปัญญานั้น มีการอนุญาตให้ใช้สิทธิในทรัพย์สินทางปัญญาหรือไม่ (License Agreement)

1.7 เจ้าหนี้ต้องตรวจสอบคดีความที่เกี่ยวข้องกับทรัพย์สินทางปัญญาที่ใช้เป็นหลักประกันว่ามีหรือไม่ (Pending Litigation)

1.8 เจ้าหนี้ต้องตรวจสอบภาระติดพันเกี่ยวกับทรัพย์สินทางปัญญาทั้งหมดที่อาจมี ผลกระทบต่อการใช้เป็นหลักประกัน (All Encumbrance Affecting an Interest in the Intellectual Property Assets)

ปัญหาที่เกิดขึ้นในการทำสัญญาดังกล่าว หากใช้วิธีโอนกรรมสิทธิ์ให้กับเจ้าหนี้ก่อน คือ ปัญหาในเรื่องของภาษีอากร ซึ่งถือว่าการโอนทรัพย์สินทางปัญญาดังกล่าว ก่อให้เกิดเงินได้พึงประเมินตามมาตรา 39 ของประมวลรัษฎากร ที่ต้องนำมาคำนวณในการเสียภาษีเงินได้ ในขณะที่หากเปลี่ยนแปลงเงื่อนไข การโอนให้เป็นอีกลักษณะหนึ่ง โดยตกลงว่าลูกหนี้ต้องโอนกรรมสิทธิ์ในทรัพย์สินทางปัญญาให้เจ้าหนี้ หากผิดนัดชำระหนี้ข้อตกลงดังกล่าวไม่ได้ทำให้เจ้าหนี้รายนี้มีบุริมสิทธิ เหนือเจ้าหนี้รายอื่น หากลูกหนี้ต้องตกเป็นบุคคลล้มละลาย ทรัพย์สินทางปัญญาดังกล่าว ก็ย่อมถือเป็นส่วนหนึ่งของกองทรัพย์สินของลูกหนี้ที่เจ้าหนี้ทุกรายย่อมมี สิทธิที่จะขอเฉลี่ยทรัพย์ได้เช่นกัน

นอกจากนี้ ยังมีประเด็นปัญหามูลค่าของหลักประกันที่คู่สัญญาต้องกำหนดมูลค่าของหลัก ประกัน ซึ่งอาจประสบปัญหาในการหาวิธีที่เหมาะสมในการคำนวณมูลค่าที่แท้จริง

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

  • Share/Save/Bookmark



AoT needs to act at once

Saturday 26 April 2008 @ 11:03 am

When the chairman of the Airline Operators Committee recently described Suvarnabhumi Airport as “being in a coma” he was not referring to flight operations, which have always been safe and efficient.

What Jaiyavat Navaraj had in mind was the seeming inability of the Airports of Thailand Plc (AoT) to fix problems and get the trouble-plagued facility running properly. In other words, the AoT needs to pay less attention to the matter of raising its revenues and more to putting its house in order. And while it is doing that, it should also address the issue of putting a few other deserving houses in order, too.

For, if the airport authorities are sleeping on the job, the same cannot be said of residents living in housing estates around the airport. They have always been entitled to some sympathy for the extreme levels of noise, mental distress and for having to put up with the appalling delaying tactics employed by the AoT. But “taking back the sky” as they put it, is not the solution. Such direct action is wrong and fast losing them friends.

Their release of more than 100 balloons into the night sky early in January delayed flights by more than two hours and cost the AoT in excess of 19 million baht in compensation for airlines affected by the delays while flight paths were cleared. Lat Krabang police reacted by sending letters to all 32 communities around the airport, warning them not to repeat such an act. Had the law been fully enforced, those responsible could have been fined and jailed for up to seven years.

It may well be that only a tiny minority is resorting to civil disobedience, but it is harming the cause of all those with legitimate claims. And, on Tuesday, this embittered minority took further steps to damage their image. Fortunately, the airport control tower quickly spotted the 10 or so lanterns being floated in restricted airspace close to flight paths. Police were alerted and two people arrested. In some countries, such behaviour would be perceived as acts of sabotage or terrorism.

Had it not been for foot-dragging by the AoT, this could all have been resolved long ago. In fact, it should have been settled even before construction of the airport began. That was before some of those now demanding compensation had moved into the area and even before the Thaksin government had earmarked Suvarnabhumi as a future aerotropolis and province, causing land values to rise and prompting an influx of hopefuls.

The present outcry is from three groups of people. First up are those who, somewhat naively, thought that buying land and building a house next to a busy international airport a few years ago was a good idea, but are now having second thoughts. Some claim not to have known about the airport, which beggars belief. Joining them are speculators who invested in land and houses around Suvarnabhumi, expecting to make a handsome profit. A small but vocal number of these see cash as the only solution. Not soundproofing or necessarily moving to a quieter location. Just money.

The third group affected by aircraft noise are the long-term residents. They are fully deserving of our sympathy and entitled to generous compensation and having their houses soundproofed. The Surayud Chulanont cabinet set out a compensation framework last May which favoured those most affected by airport noise and disruption. What is needed now is a neutral arbiter to ensure the fairness of such awards.

If the AoT cannot handle it, the job should be given to someone who can. And if awards are contested, let the matter be settled without any of the prevailing hysteria in a court of law. That is why such courts exist.

  • Share/Save/Bookmark



Thailand to expand Bangkok’s Suvarnabhumi airport

Saturday 26 April 2008 @ 11:00 am

Thailand plans to spend about 3.7 billion baht ($117 million) this year on expanding its 18-month-old Suvarnabhumi airport, officials said Friday, building a third runway for the troubled hub.

Since opening in September 2006, Bangkok’s $3-billion international airport has been plagued by problems ranging from cracks in the runways to complaints about safety and sanitation.

Air Marshal Chana U-sathaporn, president of Suvarnabhumi operator Airport of Thailand (AoT), said about 10 upgrade projects were in the pipeline.

‘The expansion plan was suggested by Transport Minister Santi Prompat … We have not discussed it in detail yet, but the ministry wants (runway construction) to begin within this year,’ Chana told Agence France-Presse.

AoT will spend about 3.6 billion baht on the third runway, while 114 million baht will also be spent this year on studies for future projects, which include the construction of a new passenger terminal in 2010, he said.

Suvarnabhumi airport was the pet project of ousted Thai prime minister Thaksin Shinawatra but it eventually opened 10 days after the military staged a coup and overthrew him.

Just six months after the airport’s triumphant launch, authorities re-opened Bangkok’s nearly century-old Don Muang airport to domestic flights to ease crowds at Suvarnabhumi.

The new airport can handle 45 million passengers a year, and numbers are already creeping up towards that figure.

Thaksin’s allies were voted back into government in elections in December last year.

An official at the transport ministry, who did not wish to be named, said the new government wanted to move all domestic flights back to Suvarnabhumi.

‘The government has a clear single-airport policy,’ he told AFP. ‘Don Muang will only be used for charter flights, air shows, for example. That will happen in the future, although we cannot say exactly when that can be.’

Source : http://www.forbes.com/markets/feeds/afx/2008/04/18/afx4906185.html

  • Share/Save/Bookmark



Thailand to expand Bangkok’s Suvarnabhumi airport

Saturday 26 April 2008 @ 11:00 am

Thailand plans to spend about 3.7 billion baht ($117 million) this year on expanding its 18-month-old Suvarnabhumi airport, officials said Friday, building a third runway for the troubled hub.

Since opening in September 2006, Bangkok’s $3-billion international airport has been plagued by problems ranging from cracks in the runways to complaints about safety and sanitation.

Air Marshal Chana U-sathaporn, president of Suvarnabhumi operator Airport of Thailand (AoT), said about 10 upgrade projects were in the pipeline.

‘The expansion plan was suggested by Transport Minister Santi Prompat … We have not discussed it in detail yet, but the ministry wants (runway construction) to begin within this year,’ Chana told Agence France-Presse.

AoT will spend about 3.6 billion baht on the third runway, while 114 million baht will also be spent this year on studies for future projects, which include the construction of a new passenger terminal in 2010, he said.

Suvarnabhumi airport was the pet project of ousted Thai prime minister Thaksin Shinawatra but it eventually opened 10 days after the military staged a coup and overthrew him.

Just six months after the airport’s triumphant launch, authorities re-opened Bangkok’s nearly century-old Don Muang airport to domestic flights to ease crowds at Suvarnabhumi.

The new airport can handle 45 million passengers a year, and numbers are already creeping up towards that figure.

Thaksin’s allies were voted back into government in elections in December last year.

An official at the transport ministry, who did not wish to be named, said the new government wanted to move all domestic flights back to Suvarnabhumi.

‘The government has a clear single-airport policy,’ he told AFP. ‘Don Muang will only be used for charter flights, air shows, for example. That will happen in the future, although we cannot say exactly when that can be.’

Source : http://www.forbes.com/markets/feeds/afx/2008/04/18/afx4906185.html

  • Share/Save/Bookmark



Political climate holds key to better business outlook

Saturday 26 April 2008 @ 10:57 am

All thanks to a better political climate following the general election in December.

The king of duty-free shopping - as he likes to be known in Thailand and abroad - Vichai has started to woo back some of the world’s luxury brands, such as Rolex, which had previously turned down an offer to open shops at Suvarnabhumi Airport.

He has also approached the chief executive of Korea’s Lotte Duty Free, one of the four duty-free retailers at Incheon International Airport, for a partnership to develop a new shopping and entertainment complex near Suvarnabhumi Airport.

In other words, Vichai has regained some confidence lost over the past one-and-a-half years following the September 2006 coup.

Cases filed by King Power Group of Companies seeking restoration of the two duty-free and commercial-retailing contracts previously terminated by Airports of Thailand (AOT) for a massive compensation of Bt67 billion, are pending in court.

Vichai hopes the ongoing dispute with the previous AOT board will be settled over the next few months so that he can come up with clear business plans for the second half of the year.

As a previous duty-free outlet operator at Don Mueang airport - now serving only domestic routes - King Power got its duty-free retailing contract extended when Suvarnabhumi Airport opened in late 2006.

In the commercial-retailing space, the company won the contract in a bidding where Central, Imperial, U Chuliang and DFS groups also took part.

Vichai hopes the country’s political atmosphere will remain conducive for growth and the Tourism Authority of Thailand, Thai Airways International and other related public and private sector bodies will join forces to promote the tourism sector.

In his opinion, good facilities for duty-free shopping are important for the country’s competitiveness as a tourist destination, especially for emerging markets such as China.

In addition, the duty-free business has become a major source of income for new airports. For instance, Singapore’s Changi international airport now earns 60 per cent of its income from non-aero activities, which includes a big chunk from duty-free shopping.

Changi was also ranked fourth in terms of duty-free sales, which are estimated to be more than US$400 million (Bt12.6 billion).

The latest statistics gathered by King Power show that London’s Heathrow airport was the world’s No 1, with duty-free sales estimated to be more than $900 million for 2006.

In second place is the United Arab Emirates’ Dubai at more than $600 million.

Hong Kong International Airport and Suvarnabhumi plus Don Mueang were ranked tenth and 11th, respectively, with sales of more than $300 million.

In Thailand, non-aero activities generate only 40 per cent of AOT’s income. Thus, it becomes necessary to boost revenues from duty-free retail outlets and other commercial non-aero activities.

Vichai said the government should also encourage hundreds of thousands of Thai students and workers returning from abroad to buy duty-free goods upon arrival in Thailand instead of buying them from abroad.

  • Share/Save/Bookmark



Common SSH Commands - Linux Shell Commands

Thursday 24 April 2008 @ 10:28 pm

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

  • Share/Save/Bookmark



How To: Import & Export a MySQL Database via SSH

Thursday 24 April 2008 @ 10:02 pm

A tutorial to show how to Import and Export large MySQL Database via SSH (shell access)

Step 1: Download SSH Client

In order to login to your server via SSH, you will need to download some software to allow you to do this. There are many packages available, but one of the most widely used is Putty - and that is the package that we will be using here. Visit this page and download the version of putty.exe suited to your system.

Once downloaded, it does not need to be installed, simply run the exe file when you wish to use it.

Step 2: Connecting to the Server

When you start the program, you will be presented with a basic configuration screen. You will need to enter in the address of the server and the method being used to connect, as in the example below, and press the open button to start off the connection to the server.

The next screen will ask you to enter your username, do that and press enter. You will then be prompted for a password - input that and press enter again, and all being well you should then be logged in and see a screen like this:

Step 3: Exporting the Database

Now we want to create a “dump” of the database. What this will do is copy all of the data in the database to a text file saved in a location that you choose on the server.

You need 4 pieces of Information to be able to do this:

* Database Name (db_username)
* Database Username (db_name)
* Database Password
* Server PATH that you would like the exported file to be saved to

Once you have got all this information, we can begin the export process.

You will need to enter the following line of code into the putty window. (you can paste text into the putty window by right clicking if you wish):

mysqldump -u db_username -p db_name > /path/to/backup.sql

Replace the db_username and db_name with the Username and Name of the Database you wish to backup - and the edit the path to match that of your server, to specify where you would like the file saved.

In the example below, the following data has been used:

* db_username: adforums_forum
* db_name: adforums_forum
* path: /home/adforums/public_html/backup/example.sql

Once the line above has been typed in, press enter - you will then be prompted for the password, as in the example below:

Enter the database password, then there will be a short delay whilst the database is exported, when complete you will be presented with a screen like this:


Step 4: Downloading the Database Dump

The database has now been exported to the server, and a .sql file will have been created in location on the server that was specified above. To get a copy of the backed up file, using your FTP program, navigate to the location of the file on your server and you should then see it listed:

You can then download this file to your computer. If the file is saved in a publicly accessible directory then after downloading it you should delete the file from the server, as anyone would then be able to come along and download a full copy of your database.


Step 5: Importing the Saved Database

Okay, will now take you through the process of importing a backed up .sql file back into the database. This backup may be created using phpmyadmin, through the Invision Power Board Admin CP or via SSH as stated above, it doesn’t matter how it was created, can still be imported this way.

You will need to upload the file to the server via FTP and note the path to that file, and then logon to the server as described above in step two.

As above, you will need 4 pieces of information:

* Database Name (db_username)
* Database Username (db_name)
* Database Password
* Server PATH of the location of the .sql file

Once you have all of this information, we can begin the import process.

You will need to enter the following line of code into the putty window. (you can paste text into the putty window by right clicking if you wish):

mysql -u db_username -p db_name < /path/to/backup.sql

In the example below, the following data has been used:

* db_username: adforums_forum
* db_name: adforums_test
* path: /home/adforums/public_html/backup/example.sql

Input the line of code above (after editing to match your database details) and press enter, enter your database password at the prompt and press enter once again.

There will be a short delay whilst the data is imported into the database, and when completed will be presented with a screen like this:

The data should now have been imported into the database. If the .sql file is saved in a publicly accessible directory then after downloading it you should delete the file from the server, as anyone would then be able to come along and download a full copy of your database.

Hope This will help you if you are seeking this kind of information.

Thanks
Babor [http://aminulbabor.blogspot.com/2008/01/how-to-import-export-mysql-database-via.html]

  • Share/Save/Bookmark



How To: Transfer your PuTTY settings between computers

Thursday 24 April 2008 @ 10:01 pm

PuTTY is tops on the short list of applications I install first on any Windows machine. Over the years I’ve used PuTTY, I’ve installed it on a huge number of computers but I’ve always had one complaint; There isn’t a configuration file I can backup or move to a new machine.

Getting all the little comfort settings correct for each SSH connection can be a pain. The third time you set emulation, keys, encryption type, etc. for each machine you regularly access, you lose patience. The fifth time you find yourself re-entering settings you might do what I did, find a better way.
Moving PuTTy settings between computers is an easy task once you know what’s involved. We’ll find the registry keys where PuTTy stores its configuration information and export them to a file. We’ll then use that file we’ve made to import our configuration on the target machine.

Exporting Your PuTTy Configuration

Putty stores its settings in the Windows registry. To save a backup of your Putty settings, you’ll need to export this registry key to a file.

HKEY_CURRENT_USER\Software\SimonTatham

(Simon Tatham is the original developer responsible for PuTTy)

1. Click Start->Run and type “RegEdt32″ in the “Open” dialog. Click “Ok”

2. One RegEdt32 starts, you’ll be presented with an application which looks something like:

3. Press “Ctrl+F” to bring up the Find dialog. Enter the name of the key, “SimonTratham” in the “Find What” field, and make sure only “Keys” is checked in the “Look At” section of the dialog. Finally, click “Find Next”

4. The search may take a while, reminding us that the Windows Registry is a large and mysterious place where dragons be. Let’s use these few seconds to reflect on the fact that you should never, ever, never change things in the registry unless you are absolutely, positively, totally, completely, 100% dead sure that you know exactly what you’re doing. When the search completes we’ll see the key name for which we’re looking.

5. Click File->Export. Give your file an appropriate name like, “putty.reg” and click “Save”

6. We’re done! Save the putty.reg file somewhere safe. The file doesn’t contain any passwords or actual SSH key values so, it’s relatively safe from prying eyes. Still, it does contain your configuration and that kind of data is a private matter.
Importing Your PuTTy Configuration

To import your saved PuTTy configuration on any other Windows computer simply copy your exported registry key, right click on the file and click “Merge”

Windows will ask you for confirmation that you want to import this set of registry values. We know this file is safe, because we created it but, you should never import registry information from an unknown source.

That’s all you need to know about moving your PuTTy configuration from one machine to another. This can be really useful information when upgrading to a new PC or, if you’re an office IT guy where your users all have a standard list of servers they need to connect via SSH, you can create a reference configuration on once machine and “share” it between every computer in the office.

  • Share/Save/Bookmark



Save $100 in 5 Minutes Backing Up Your Web Site?

Thursday 24 April 2008 @ 9:28 pm

Here’s an easy way to backup your web site’s files and
database (worth thousands of dollars, no doubt) that costs
$0 to learn and perform. It only takes seven easy steps.

You don’t need to know a lot about how to use Unix or how to
use databases like mySQL. The only real tool you need is a
telnet client. Also, you need to know a few commands which
I’ll show you now. (You could even write the commands I’m
about to give you on a cheatsheet.)


STEP 1: CONNECT & GET IN THE RIGHT FOLDER

The web host you’re trying to back up needs to allow shell
access (most do these days).

If you have a Windows computer, download a program called
“PuTTY” which you can use to login in your web host’s shell.
Search for “putty ssh” on Google or get it here:
http:/ he.earth.li/~sgtatham/putty/latest/x86/putty.exe

Open up PuTTY and at the top type in your hostname (your web
site address without the http or www, just “yourname.com”).
Your web host either uses SSH or telnet, first try logging
in using SSH and if it won’t connect try it using Telnet.
Click the “Open” button at the bottom to connect.

When it connects you will be asked for your account’s
username, and after you enter that, it will ask for your
password. If these both take, you’ll see a command prompt
of sorts. What you have to do is browse to the document
root, depending on your host it’s usually a folder like
“public_html” or “wwwroot”.

If the wwwroot or public_html folder has more folders inside
of it, in the form of yourdomain.com, don’t browse into them
yet, just stay in the folder you’re in.

Browsing in the Unix command prompt is just like DOS, to
view a folder type “dir” or “ls”, and to go into a certain
folder type “cd foldername”. If you messed up you can type
“cd ..” to move up one level.

STEP 2: BACK-UP THE DATABASE

The first step if you’re backing up a site is to dump your
mySQL database. To do this obviously you need the mySQL
username and password you want to back up. If your mySQL
username is “myuser” and the mySQL password is “mypassword”,
you’d type:

mysqldump -umyuser -pmypassword -A > dump.sql

mysqldump is the program we run to dump the database into a
file, then we type “-u” followed by the username (no spaces)
and “-p” followed by the password (also no spaces). The
uppercase “-A” tells the program we want to dump every
database this user has access to. It MUST be an uppercase
A.

The “>” afterwards says we want to put this program’s output
into a file (otherwise it would show up on the screen) and
“dump.sql” is the name of the file we’re going to dump to.

This may take a while depending on the size of your
database. Be patient. Once you have a command prompt
again, it’s done.

If you don’t have root on your server, it may show databases you don’t have access to. What you’ll have to do here is “force” mysqldump to keep doing the backups even if it gets error messages. The flag for “force” is “-f”.

mysqldump -umyuser -pmypassword -Af > dump.sql

STEP 3: BACK-UP YOUR FILES

Now you can put everything into one big file, which you can
easily move over to the new host in one go, instead of one
at a time. Unix doesn’t let you create Zip files, but you
can create a TAR (Tape Archive) which just rolls a bunch of
files together without any sort of compression.

To create your TAR archive, type:

tar -cvf dump.tar *

The “-c” tells the program to create a new TAR archive, the
“v” following right after says to be verbose, in other
words, give us the name of every file that’s being added to
the archive. “f: means we’re saving this to a file, as
opposed to showing it on the screen (you’d just see junk).

“dump.tar” is the name of the file we want to save into, and
the “*” means we want to put everything into this TAR
archive — files, folders, everything.

You may get some sort of warning about not adding dump.tar
to the archive, that’s no big deal because we don’t want
this file to add itself.

Your files are backed up. At this point it’s time to move
things over to the next host. There’s a way we can do this
without you having to download the whole thing, and
re-upload it.

STEP 4: ARRANGE YOUR FILE FOR PICKUP

Remember how I said when you were in “wwwroot” or
“public_html” not to browse into the folder containing a
domain name? Well now it’s time to move that dump over into
one of them so it can be picked up.

If one of your folders is, say, yourdomain.com, type:

mv dump.tar yourdomain.com

This moves “dump.tar” into the folder “yourdomain.com”.

STEP 5: MOVE THE NEW FILE OVER

Login to your new host. Browse to its “wwwroot” or
“public_html” folder.

Most hosts include a program called “wget” which works sort
of like a browser in that you give it a URL to pick-up that
it loads. Only this browser also saves the file you want to
load.

If your old host was at yourdomain.com, you’d just type:

wget http://www.yourdomain.com/dump.tar

This will load that URL and save it as “dump.tar”. You’ll
probably see some sort of progress indicator as it goes.

STEP 6: DECOMPRESSING THE FILE

Once you have the file, you use that same TAR program to
decompress it. Type:

tar -xvf test.tar

The “v” and “f” are still there, but instead of “c” (create)
we use “x” (extract). This will unpack each file and let us
know which one it’s working on.

STEP 7: RESTORING THE MYSQL DATABASE

Before you can put the mySQL dump back into the database,
you have to go into this new web host’s control panel and
create blank databases with the same names as you had
before.

You also have to create a mySQL user and make sure that user
has access to all those databases you’ve created.

Once that’s done find the dump.sql that was unpacked with
all of the other files.

Instead of using the program “mysqldump” to dump the files,
we use the program “mysql” which let’s us put commands into
the database. That’s basically what a dump is, a file full
of commands that, when run, will recreate the old database
exactly.

This time we don’t type in the database name right away. To
get into mySQL from the command prompt, type:

mysql -umyuser -pmypassword

Where “myuser” and “mypassword” are your mySQL username and
password. Once you’re in you’ll get kind of a weird looking
prompt. All you have to do at this point is type:

source dump.sql

This says, open up the file dump.sql, read through it and do
whatever it says to do in that file. You will see a bunch
of lines telling you a command has been entered (0 Rows
Affected, 1 Rows Affected, something like that).

If everything goes smoothly, type “quit” and you will be
back in the shell.

You’ve just moved one site (or a bunch of sites) over from
one host to another in about 5 minutes.


About the Author

Article by Robert Plank

Want to pick up more useful PHP and programming skills,
even if you aren’t “the programming type”?
Subscribe here — http://jumpx.com/newsletter

  • Share/Save/Bookmark



Save $100 in 5 Minutes Backing Up Your Web Site?

Thursday 24 April 2008 @ 9:24 pm

Here’s an easy way to backup your web site’s files and
database (worth thousands of dollars, no doubt) that costs
$0 to learn and perform. It only takes seven easy steps.

You don’t need to know a lot about how to use Unix or how to
use databases like mySQL. The only real tool you need is a
telnet client. Also, you need to know a few commands which
I’ll show you now. (You could even write the commands I’m
about to give you on a cheatsheet.)


STEP 1: CONNECT & GET IN THE RIGHT FOLDER

The web host you’re trying to back up needs to allow shell
access (most do these days).

If you have a Windows computer, download a program called
“PuTTY” which you can use to login in your web host’s shell.
Search for “putty ssh” on Google or get it here:
http:/ he.earth.li/~sgtatham/putty/latest/x86/putty.exe

Open up PuTTY and at the top type in your hostname (your web
site address without the http or www, just “yourname.com”).
Your web host either uses SSH or telnet, first try logging
in using SSH and if it won’t connect try it using Telnet.
Click the “Open” button at the bottom to connect.

When it connects you will be asked for your account’s
username, and after you enter that, it will ask for your
password. If these both take, you’ll see a command prompt
of sorts. What you have to do is browse to the document
root, depending on your host it’s usually a folder like
“public_html” or “wwwroot”.

If the wwwroot or public_html folder has more folders inside
of it, in the form of yourdomain.com, don’t browse into them
yet, just stay in the folder you’re in.

Browsing in the Unix command prompt is just like DOS, to
view a folder type “dir” or “ls”, and to go into a certain
folder type “cd foldername”. If you messed up you can type
“cd ..” to move up one level.

STEP 2: BACK-UP THE DATABASE

The first step if you’re backing up a site is to dump your
mySQL database. To do this obviously you need the mySQL
username and password you want to back up. If your mySQL
username is “myuser” and the mySQL password is “mypassword”,
you’d type:

mysqldump -umyuser -pmypassword -A > dump.sql

mysqldump is the program we run to dump the database into a
file, then we type “-u” followed by the username (no spaces)
and “-p” followed by the password (also no spaces). The
uppercase “-A” tells the program we want to dump every
database this user has access to. It MUST be an uppercase
A.

The “>” afterwards says we want to put this program’s output
into a file (otherwise it would show up on the screen) and
“dump.sql” is the name of the file we’re going to dump to.

This may take a while depending on the size of your
database. Be patient. Once you have a command prompt
again, it’s done.

If you don’t have root on your server, it may show databases you don’t have access to. What you’ll have to do here is “force” mysqldump to keep doing the backups even if it gets error messages. The flag for “force” is “-f”.

mysqldump -umyuser -pmypassword -Af > dump.sql

STEP 3: BACK-UP YOUR FILES

Now you can put everything into one big file, which you can
easily move over to the new host in one go, instead of one
at a time. Unix doesn’t let you create Zip files, but you
can create a TAR (Tape Archive) which just rolls a bunch of
files together without any sort of compression.

To create your TAR archive, type:

tar -cvf dump.tar *

The “-c” tells the program to create a new TAR archive, the
“v” following right after says to be verbose, in other
words, give us the name of every file that’s being added to
the archive. “f: means we’re saving this to a file, as
opposed to showing it on the screen (you’d just see junk).

“dump.tar” is the name of the file we want to save into, and
the “*” means we want to put everything into this TAR
archive — files, folders, everything.

You may get some sort of warning about not adding dump.tar
to the archive, that’s no big deal because we don’t want
this file to add itself.

Your files are backed up. At this point it’s time to move
things over to the next host. There’s a way we can do this
without you having to download the whole thing, and
re-upload it.

STEP 4: ARRANGE YOUR FILE FOR PICKUP

Remember how I said when you were in “wwwroot” or
“public_html” not to browse into the folder containing a
domain name? Well now it’s time to move that dump over into
one of them so it can be picked up.

If one of your folders is, say, yourdomain.com, type:

mv dump.tar yourdomain.com

This moves “dump.tar” into the folder “yourdomain.com”.

STEP 5: MOVE THE NEW FILE OVER

Login to your new host. Browse to its “wwwroot” or
“public_html” folder.

Most hosts include a program called “wget” which works sort
of like a browser in that you give it a URL to pick-up that
it loads. Only this browser also saves the file you want to
load.

If your old host was at yourdomain.com, you’d just type:

wget http://www.yourdomain.com/dump.tar

This will load that URL and save it as “dump.tar”. You’ll
probably see some sort of progress indicator as it goes.

STEP 6: DECOMPRESSING THE FILE

Once you have the file, you use that same TAR program to
decompress it. Type:

tar -xvf test.tar

The “v” and “f” are still there, but instead of “c” (create)
we use “x” (extract). This will unpack each file and let us
know which one it’s working on.

STEP 7: RESTORING THE MYSQL DATABASE

Before you can put the mySQL dump back into the database,
you have to go into this new web host’s control panel and
create blank databases with the same names as you had
before.

You also have to create a mySQL user and make sure that user
has access to all those databases you’ve created.

Once that’s done find the dump.sql that was unpacked with
all of the other files.

Instead of using the program “mysqldump” to dump the files,
we use the program “mysql” which let’s us put commands into
the database. That’s basically what a dump is, a file full
of commands that, when run, will recreate the old database
exactly.

This time we don’t type in the database name right away. To
get into mySQL from the command prompt, type:

mysql -umyuser -pmypassword

Where “myuser” and “mypassword” are your mySQL username and
password. Once you’re in you’ll get kind of a weird looking
prompt. All you have to do at this point is type:

source dump.sql

This says, open up the file dump.sql, read through it and do
whatever it says to do in that file. You will see a bunch
of lines telling you a command has been entered (0 Rows
Affected, 1 Rows Affected, something like that).

If everything goes smoothly, type “quit” and you will be
back in the shell.

You’ve just moved one site (or a bunch of sites) over from
one host to another in about 5 minutes.


About the Author

Article by Robert Plank

Want to pick up more useful PHP and programming skills,
even if you aren’t “the programming type”?
Subscribe here — http://jumpx.com/newsletter

  • Share/Save/Bookmark



«« Previous Posts