Archive for September, 2006

Common SSH Commands Linux Shell Commands

Friday, September 22nd, 2006

I have put together some of the more frequently used SSH commands or linux shell commands, and organized them by name so you can easily find a command, their description and how to use it. This guide will continue to be updated and should not be considered a complete list of SSH commands or linux shell commands, but commands, we found, often used. If you would like to add to this guide, please email us and let us know.


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

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 to go to the next page, 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.

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.

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

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/

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.

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!!!

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.

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!

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.

kill: terminate a system process
kill -9 PID - EG: kill -9 431
kill PID - EG: kill 10550
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

Credit Card Processing - the Basics

Friday, September 22nd, 2006

Doing successfully business on the Internet requires some sort of automated payment processing in place. Imagine a customer ready to buy your services but then not being able to sign up and pay because there is no payment (credit card) processing in place. Don’t let this happen.

During the process of building/starting a business there are several stages of payment processing that you can implement. When you are starting out your own credit card merchant account might be hard to get. Your business has to establish credit first. It might also be way too expensive for you. A real merchant account adds a monthly fee of at least $30.00 to your budget. You also have to sign a contractual agreement requiring at least 1 year of commitment + the payment of a hefty application fee. Many newcomers do consider this a burden they do not want to carry right away. And they are correct. Especially in the beginning it is very important to keep a close look at your expenses. Do not spend money when not really needed.

You can look at a few low-cost alternatives. They require only a small application fee (if at all) and no monthly or yearly commitment. If you do not have anything to process there won’t be any fees. Can’t beat that. What are your low-cost options at all?

Take a look at…

http://www.2checkout.com, http://www.payquake.com/, or at http://www.PayPal.com.

These low-cost payment processors offer everything you need when starting out. No monthly fees are required to pay ? though PayPal offers a full-blown merchant account nowadays. These companies usually offer payment processing for slightly higher transaction fees than it would cost you having your own merchant account, but that is a fair trade-off. They also offer fraud checking on orders, which you would not have when operating on your own merchant account.

So, why is not everyone using these services? What is the catch? We already mentioned the higher fees for the transaction. Reliability is another issue. Your business depends on the reliability of the partner chosen. A 3rd party processing company named Paysystems delivered the perfect example of being unreliable and later even shutting down business and leaving its customers out in the rain. Either Paysystems (Update: Paysystems is no longer doing business as a 3rd party payment processor) or 2Checkout were having problems occasionally. Their sites do not respond properly during these times and you were basically stuck - no payments could be processed. A business might lose a customer in a situation where you are unable to close the deal. Fortunately these things do not happen too often and especially newcomers do not have to expect new customers every minute. Still, this is something to keep an eye on. Due to legal requirements by the large credit companies your customers will technically not be your customers when it comes to the payment processing with these 3rd party providers. 2Checkout requires you to post a message accompanying the sale that your clients are buying your services from them and not from you. This can be very confusing and misleading to the potential customer. Your are also depending on the payout schedule and procedure of the payment processor. Not every business owner feels confident when using a 3rd party provider and trusting them the majority of their business cash flow. By using the 3rd party providers your clients will also not see your business name on their credit card statements but the name of the 3rd party provider. This can be confusing and problematic (possible charge-backs because the client does not associate the business name of the 3rd party provider with the services bought from you.

A good strategy for the new business owner can be to use more than one 3rd party provider. Sign-up fees are low (around $50.00) or non-existing (PayPal). You can rotate through the providers on a weekly base. Therefore your monthly sign-ups would go through different providers on average and you would be spreading the risk accordingly. If one provider goes out of business, you would only lose part of your money until all clients are switched to a different provider. Plan your credit card processing procedure carefully. If you buy 3rd party software for credit card processing - make sure you leave a backdoor open for the time when you switch to your own merchant account.

PayPal: PayPal can be confusing to clients, as it is not that obvious to spot where and how to make a payment when not being a PayPal customer. PayPal should not be your only way of processing credit card payments ? unless you choose their full-blown merchant account option. It can be a good idea to offer PayPal as an additional option though. Also - make sure you keep your business and personal stuff separated. ALWAYS have different PayPal accounts for your personal business and for your professional business. PayPal offers great tools to implement everything into your website so that even a beginner has a shopping cart up and running in a short time.

VodaHost
Your Website People!

Trust Through Secure E-Commerce

Friday, September 22nd, 2006

Whether your e-commerce operation involves selling an entire catalogue of items, a small collection of goods, or even just one product, the simple reality is that unless people buy the items for sale on your Web site, you won’t make any money. And while the last few years have done a lot to make consumers more comfortable with the idea of shopping online, a significant effort is still necessary, on your part, to convince a potential consumer that they will be doing business with a secure and trustworthy operation.

And because you’ll have to employ some form of remote payment, you’ll have to do business with some type of transaction processing business. And even more than your customers, your billing solution partners will demand some assurance that your operation is secure before they involve themselves in your transactions.

To put it simply: in the e-commerce business, securing trust in your company is essential to your success. Trust is as important to a potential customer’s purchasing decision as the products you offer him. And an essential element of building that trust, with both customers and partners, is the assurance that your e-commerce operation meets the demanding security standards required of organizations handling sensitive financial information.

Setting Up a Storefront

A big part of building trust with your customers is your presentation. The very fact that they’re browsing your online store is a good indicator that they’re familiar with the possibilities of online shopping, and are prepared to consider buying. What you do to convince them, and the effectiveness of your efforts, may be the deciding factor in a possible sale.

The shopping interface you introduce to customers is arguably the most important piece of your e-commerce site’s presentation. A familiar, easy-to-navigate interface can go a long way toward establishing the trust you’re after. Seasoned online shoppers will know what to expect from an e-commerce site, and meeting those expectations is a good way to gain their confidence. And novice surfers will probably be more comfortable if your online store closely resembles the major e-commerce interfaces they might have encountered.

Building a storefront compatible with your customers’ expectations is one of the more obviously beneficial features of using an e-commerce software product such as those provided by Miva (Miva.com), BizCrafter (BizCrafterCorp.com) or eCartSoft (eCartSoft.com) to build your site. Most of these programs will help you to build a simple, effective and familiar shopping interface that can include pictures, shopping cart functions and a number of useful security features.

In addition to helping you build an attractive online shop, most e-commerce software has features allowing it to help manage your inventory, interact with your payment processing systems, simplify your relationships with suppliers and affiliates and even promote your site.

E-commerce software can usually be purchased online from the maker, but is also quite often included as part of a specialized e-commerce package from any of the many Web hosts that support such operations.

Finding a Commerce-Friendly Web Host

Assuming that this is one of your first efforts at building an e-commerce Web site, it’s a safe bet that you’ll be outsourcing most, or at least some of the site’s technical operations to a Web hosting company. This is by no means a bad thing, and in fact can free up your time and IT resources, allowing you to focus on the operations of the business itself.

More than simply freeing your time, however, many Web hosting companies have plans tailored specifically to the needs of customers developing or operating e-commerce Web sites. A few hosting companies offering enhanced e-commerce features include ValueWeb (ValueWeb.com), Global Internet Solutions (GISol.com) and Gotham Web (GothamWeb.com). These commerce-friendly hosting plans often include a software license for one of the storefront building programs with your monthly fees, as well as a number of other support services, designed to provide you with a secure platform from which to do business.

And while software and services may be convenient, there are other reasons why a host that understands e-commerce is critical to your business. A good e-commerce host will already have the means in place to secure your online transactions with protocols such as SSL. It may be able to process transactions for you, or help you set up a merchant account. And most importantly, it will have the service level guarantees suitable to the high demands of your e-commerce operation.

Of course, in addition to the products and services they provide, it’s hard to argue against the value of experience. And a Web host well versed in e-commerce should be able to help you by answering whatever questions you may have.

Securing Information Using SSL

At the core of any e-commerce operation is the financial transaction between Web site and consumer. One of the most common methods for accepting payment from your customers is accepting the submission of credit card information online. But by accepting your customers’ credit card information through your Web site, you are also accepting the responsibility for the security of that information.

The standard protocol for securing communications on the Web is Secure Sockets Layer (SSL). Developed by Netscape Communications Corporation, the SSL security protocol provides data encryption, server authentication, message integrity and client authentication for TCP/IP connections, allowing client/server applications to communicate in a way that prevents eavesdropping, tampering or message forgery.

SSL is built into all major Web browsing software, so simply installing a digital certificate on the server side of the communication will turn on the browser’s SSL capabilities. The protocol is available in both 40-bit and 128-bit strengths, referring to the length of the “session key” generated by each encrypted transaction.

In order to establish an SSL session with a customer’s browser, your server has to be able to generate a public key and a private key and have them authenticated by a certificate authority, such as VeriSign (VeriSign.com), Thawte (Thawte.com), Tucows (Tucows.com) or InstantSSL (InstantSSL.com). Your Web host may include an arrangement with one if these authorities, or may allow you to use its certificate.

Processing Transactions

Once your customer is willing and able to give you his or her credit card information, you still have to make arrangements to be able to process the transaction and receive your payment. Obviously, credit card processing is a complicated process, and a number of organizations can be involved, from both your bank and the user’s bank to a credit card processing company and the credit card communications network.

Your involvement in the processing operation will vary according to how much of the responsibility you want to outsource. It can be as simple as employing a “buy button” solution hosted by a third party provider, where all you have to do is include a piece of HTML code on your site and the processing company will send you a check. But keep in mind that the more responsibility you take on yourself, the smaller percentage of your profits you’ll have to hand over to service providers.

In a more hands-on solution, many of the storefront-building software solutions include tools and ongoing support services to handle payment processing functions. Your Web host may have already set up this sort of pre-arranged processing option. For storefronts not equipped to provide payment processing, there are service providers, such as IBill (IBill.com) or CCBill (CCBill.com), designed to do just that. These providers charge a scaling service, that can reach as high as 15 percent, for their services. And these charges can be avoided by setting up your own merchant account.

If you decide to handle most of the processing yourself, saving many of the fees associated with outsourced payment processing, you’ll have to enable your Web server and applications to send and receive information from the credit card network. In order to do this, you’ll have to obtain your own merchant ID and terminal ID, numbers that will identify you and the source of your transactions. These IDs can be obtained from a merchant bank by applying for a merchant account enabled to receive payments by credit card. The merchant bank will have relationships with acquiring banks that can handle both credit card processing and Internet payments. Once the merchant bank supplies you with merchant and terminal IDs, you’ll use these numbers to configure your payment software or provide them to your outsourced processor.

There are plenty of responsibilities beyond security involved in running an e-commerce Web site, not including managing the supply chain relationships and inventory and, of course, fulfilling your customers’ orders. But, when dealing with the sensitive data involved in processing customers’ credit card information, there can be no question that earning the trust of your customers through a comprehensive and responsible approach to security should be a primary concern.

VodaHost
Your Website People!

What is Ruby on Rails?

Friday, September 22nd, 2006

You’ve probably heard of Ruby on Rails at this point. And you may have seen Web hosts offering support for Ruby on Rails. But perhaps you’re not yet familiar with what Ruby is, what Rails is, and how exactly one happens to be on the other.

If you’re not a developer yourself, then certainly you might be in the dark. Simple explanations of the technology are still pretty scarce online. However, you have almost certainly interacted with an application built using Rails, and it may be that the technology could benefit you or your business.

Ruby itself is a programming language, first introduced in 1995 by Yukihiro Matsumoto, along the lines of Perl or PHP. Ruby’s popularity among developers, say its advocates, has a lot to do with its focus on making programming fast and easy for developers.

Ruby on Rails, also known simply as “Rails” is a Web application framework written in the Ruby language.

A Web application framework is a collection of application building blocks that form a sort of supporting structure for a Web application. Most applications employ somewhat generic pieces of code that can be used repeatedly throughout the main application to perform functions like querying an SQL database and returning data for use by the rest of the application.

According to Rails creator David Heinemeier Hansson, the framework was built from the generic parts created as he used Ruby to create Basecamp, the hosted Web-based project management tool from his company, 37signals.

Hansson made the pre-written libraries available as Rails, making the framework available for download at www.rubyonrails.org. Developers say the framework is broad enough to be suitable for building any kind of application, even while being incredibly simple and quick to use.

The tools include functions written for validating form data, application templates, sending and receiving email, formatting date and time, managing sessions and cookies, and building interactive functions into Web pages using AJAX.

AJAX, an acronym for Asynchronous Javascript and XML is a term that describes using a combination of Javascript, the Document Object Model and XML technologies to assemble page content in a browser from remote servers.

Ultimately, Ruby on Rails provides a simple and efficient environment for development using some of the latest technology and techniques for building Web applications. As a result, it is quickly becoming popular with developers, and there is every reason to believe that it will be an important part of application programming for years to come.

Already many hosts have introduced support for rails, and it is safe to assume that more hosts will continue to add their support as Rails becomes one of the key standards for Web development.

VodaHost
Your Website People!