Thursday, 6 December 2012
most popular add ons for oscommerce, useful osCommerce add-ons
Here you will find a list of the most popular osCommerce modules
When installing add-ons make sure you download them from known sources
Always make backups before you start installing addons. Always!
Shoes
what's new in php 5.4 and php 5.4 here
New features
PHP 5.4.0 offers a wide range of new features:
- Support for traits has been added.
- Short array syntax has been added, e.g. $a = [1, 2, 3, 4]; or $a = ['one' => 1, 'two' => 2, 'three' => 3, 'four' => 4];.
- Function array dereferencing has been added, e.g. foo()[0].
- Closures now support $this.
- <?= is now always available, regardless of the short_open_tag php.ini option.
- Class member access on instantiation has been added, e.g. (new Foo)->bar().
- Class::{expr}() syntax is now supported.
- Binary number format has been added, e.g. 0b001001101.
- Improved parse error messages and improved incompatible arguments warnings.
- The session extension can now track the upload progress of files.
- Built-in development web server in CLI mode.
Backward Incompatible Changes
Although most existing PHP 5 code should work without changes, please take
note of some backward incompatible changes:
- Safe mode is no longer supported. Any applications that rely on safe mode may need adjustment, in terms of security.
-
Magic quotes has been removed. Applications relying
on this feature may need to be updated, to avoid security issues.
get_magic_quotes_gpc() and get_magic_quotes_runtime()
now always return
FALSE
. set_magic_quotes_runtime() raises anE_CORE_ERROR
level error. - The register_globals and register_long_arrays php.ini directives have been removed.
- Call-time pass by reference has been removed.
- The break and continue statements no longer accept variable arguments (e.g., break 1 + foo() * $bar;). Static arguments still work, such as break 2;. As a side effect of this change break 0; and continue 0; are no longer allowed.
-
In the date and time extension, the timezone can no longer be
set using the TZ environment variable. Instead you have to specify a timezone using the
date.timezone php.ini option or date_default_timezone_set()
function. PHP will no longer attempt to guess the timezone, and will instead fall back to "UTC" and issue
a
E_WARNING
. -
Non-numeric string offsets - e.g. $a['foo'] where $a is a string - now return
false on isset() and true on empty(), and produce a
E_WARNING
if you try to use them. Offsets of types double, bool and null produce aE_NOTICE
. Numeric strings (e.g. $a['2']) still work as before. Note that offsets like '12.3' and '5 foobar' are considered non-numeric and produce aE_WARNING
, but are converted to 12 and 5 respectively, for backward compatibility reasons. Note: Following code returns different result. $str='abc';var_dump(isset($str['x'])); // false for PHP 5.4 or later, but true for 5.3 or less -
Converting an array to a string will now generate an
E_NOTICE
level error, but the result of the cast will still be the string "Array". -
Turning
NULL
,FALSE
, or an empty string into an object by adding a property will now emit anE_WARNING
level error, instead ofE_STRICT
. - Parameter names that shadow super globals now cause a fatal error. This prohibits code like function foo($_GET, $_POST) {}.
- The Salsa10 and Salsa20 hash algorithms have been removed.
-
array_combine() now returns array() instead of
FALSE
when two empty arrays are provided as parameters. -
If you use htmlentities() with asian character sets, it
works like htmlspecialchars() - this has always been the
case in previous versions of PHP, but now an
E_STRICT
level error is emitted.
Deprecated features in PHP 5.4.x
Deprecated functions:
Changed Functions
OpenSSL:
- Added a no padding option to the openssl_encrypt() and openssl_decrypt() functions.
Other changes
- The default character set for htmlspecialchars() and htmlentities() is now UTF-8, instead of ISO-8859-1. Note that changing your output charset via the default_charset configuration setting does not affect htmlspecialchars/htmlentities unless you are passing "" (an empty string) as the encoding parameter to your htmlspecialchars()/ htmlentities() calls. Generally we do not recommend doing this because you should be able to change your output charset without affecting the runtime charset used by these functions. The safest approach is to explicitly set the charset on each call to htmlspecialchars() and htmlentities().
-
E_ALL
now includesE_STRICT
level errors in the error_reporting configuration directive. -
SNMP now has an OOP API.
Functions now return
FALSE
on every error condition including SNMP-related (no such instance, end of MIB, etc). Thus, in particular, breaks previous behavior of get/walk functions returning an empty string on SNMP-related errors. Multi OID get/getnext/set queries are now supported. Dropped UCD-SNMP compatibility code, consider upgrading to net-snmp v5.3+, Net-SNMP v5.4+ is required for Windows version. In sake of adding support for IPv6 DNS name resolution of remote SNMP agent (peer) is done by extension now, not by Net-SNMP library anymore. - OpenSSL now supports AES.
- CLI SAPI doesn't terminate any more on fatal errors when using interactive mode with readline support.
- $_SERVER['REQUEST_TIME_FLOAT'] has been added to include microsecond precision.
- Added new hash algorithms: fnv132, fnv164, joaat
- Chained string offsets - e.g. $a[0][0] where $a is a string - now work.
- Arrays cast from SimpleXMLElement now always contain all nodes instead of just the first matching node. All SimpleXMLElement children are now always printed when using var_dump(), var_export() and print_r().
- It's now possible to enforce the class' __construct arguments in an abstract constructor in the base class.
Monday, 19 November 2012
How to Schedule Database Backup Using Cron Job
Many Web Applications are changing daily. In case your site is hacked or its data becomes corrupted, it is beneficial to have regularly stored backups of your databases so you can restore your account quickly. Luckily, there is a quick and reliable way to do this through the use of Cron Jobs. Below is a step by step process on how to set up Cron Jobs to take backups of your Databases.
Change the following details to your database information and email information:
$dbhost = “localhost“; // leave this as localhost for most sites
$dbuser = “dbuser“; // enter your database username here
$dbpass = “dbpass“; // enter your database password here
$dbname = “dbname“; // enter the name of your database here
$sendto = “Send To <sendto @email.com>“; // the email address you are sending to
$sendfrom = “Send From <sendfrom @email.com>“; // This will be the reply to email address
$sendsubject = “Daily Database Backup“; // the subject of the email
$bodyofemail = “Here is the daily backup of my database.“; // The message included within the email
$backupfile = $dbname . date("Y-m-d") . '.sql.gz';
system("mysqldump -h $dbhost -u $dbuser --password=$dbpass $dbname | gzip > $backupfile");
Save the file and upload to “www” directory to your cPanel account.
Log into your cPanel. Locate and click on “Cron Jobs”
Set the Cron Job to run at the desired time, (it is usually best to run this through the middle of the night,) then put the following command in the “Command:” box with your username in place of “cPanelusername”
php -q ~/cPanelusername/public_html/mtebackup/backup.php
Your backup Cron Job will now be listed in the “Current Cron Jobs” section.
Enjoy receiving daily backups of your database.
Tuesday, 2 October 2012
mail are delivered in the spam folder instead of inbox
How to Avoid Spam Filters with PHP mail() Emails
Just about everyone who uses PHP has encountered the popular PHP mail() function which enables email to be sent from a server. This function is preferred to other methods of sending email, such as sending mail with SMTP Authentication, because its implementation is quick and easy. Unfortunately, when using the mail() function, your emails are more likely to be marked as spam. So how can we fix this?
A Simple Implementation Example
Many users of the mail() function often have simple implementations as shown in the code sample below:
<?
mail("recipient@recipient.com", "Message", "A simple message.", "From: The Sender <sender@sender.com>");
?>
While this implementation will successfully send an email, the email will probably get caught in the recipient’s spam filter. Fortunately, there are some simple fixes that can help you avoid spam filters.
4 Ways To Make Your PHP mail() Emails Less Spammy
1. Use Headers
In the simple example above, the from name and email address was added as the fourth parameter. Instead, consider using headers to set your From and Reply-To email addresses.
<?
$headers .= "Reply-To: The Sender <sender@sender.com>\r\n";
$headers .= "Return-Path: The Sender <sender@sender.com>\r\n";
$headers .= "From: The Sender <senter@sender.com>\r\n";
?>
But headers are good for more than just setting details about the sender. They are also important for setting the content type, the email priority, and more. Here are how some additional headers look.
<?
$headers .= "Organization: Sender Organization\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-Mailer: PHP". phpversion() ."\r\n"
?>
Be sure to replace the fourth parameter with the $headers variable as shown below.
<?
mail("recipient@recipient.com", "Message", "A simple message.", $headers);
?>
2. The Message Sender Domain and Server Domain Should Match
Spammers are notorious for sending emails from one server and trying to make the recipient believe that it came from somewhere else. So if you are sending an email from example@example.com, it is a good idea the the script reside on example.com.
3. Be Sure to Properly Use the Content-type Attribute
The Content-type attribute enables a message sender to say whether or not an email is plain text or html, or whether it has attachments. Obviously, the easiest to use content type is text/plain. You just add your text as shown in the simple example, and you are done. But when you use the other content types, additional pieces might be expected. For example, with the text/html content type, an html body tag is expected. Not having this tag could result in your email being marked as spam.
4. Verify That Your Server Is Not Blacklisted
When a server is blacklisted, it means that that server has identified as one that has been sending a lot of spam. This results in recipient mail servers rejecting or filtering any mail that is received from that server.
So if your mail is not being received it is a good idea to verify that your server has not been blacklisted. This goes for both shared and dedicated servers. In a shared environment, it is common for other users on the server to be sending out spam. And in a dedicated environment, spammers may have found a way to exploit a vulnerability in a server or contact form to send out spam. So it is easy for either type of server to be blacklisted.
Alright, now that you have the basics on avoiding spam filters, reconstruct your scripts and happy emailing!
Tuesday, 4 September 2012
What is .htaccess? Its used
In order to specify your own customized error documents, you simply need to add the following command, on one line, within your htaccess file:
ErrorDocument code /directory/filename.extYou can name the pages anything you want (I'd recommend something that would prevent you from forgetting what the page is being used for), and you can place the error pages anywhere you want within your site, so long as they are web-accessible (through a URL). The initial slash in the directory location represents the root directory of your site, that being where your default page for your first-level domain is located. I typically prefer to keep them in a separate directory for maintenance purposes and in order to better control spiders indexing them through a ROBOTS.TXT file, but it is entirely up to you.
or
ErrorDocument 404 /errors/notfound.html
This would cause any error code resulting in 404 to be forward to yoursite.com/errors/notfound.html
Likewise with:
ErrorDocument 500 /errors/internalerror.html
If you were to use an error document handler for each of the error codes I mentioned, the htaccess file would look like the following (note each command is on its own line):
You can specify a full URL rather than a virtual URL in the ErrorDocument string (http://yoursite.com/errors/notfound.html vs. /errors/notfound.html). But this is not the preferred method by the server's happiness standards.ErrorDocument 400 /errors/badrequest.html ErrorDocument 401 /errors/authreqd.html ErrorDocument 403 /errors/forbid.html ErrorDocument 404 /errors/notfound.html ErrorDocument 500 /errors/serverr.html
You can also specify HTML, believe it or not!
The only time I use that HTML option is if I am feeling particularly saucy, since you can have so much more control over the error pages when used in conjunction with xSSI or CGI or both. Also note that the ErrorDocument starts with a " just before the HTML starts, but does not end with one...it shouldn't end with one and if you do use that option, keep it that way. And again, that should all be on one line, no naughty word wrapping!ErrorDocument 401 "<body bgcolor=#ffffff><h1>You have to actually <b>BE</b> a <a href="#">member</A> to view this page, Colonel!
For to password protect a directory and all the directories below.
Put a file named .htaccess in the directory you want to password protect with the follow text.
AuthUserFile /opt/guide/www.widexl.com/.htpasswd AuthType Basic AuthName "Member Page" require valid-user
For to password protect the admin.pl script.
You can use wildcards for this, like: "*.html" "*.zip"
<files "admin.pl"> AuthUserFile /opt/guide/www.widexl.com/.htpasswd AuthType Basic AuthName "Administrator script" require valid-user </files>
AuthUserFile: This is the full path to your password file
AuthType: This need to be Basic.
AuthName: This is the name (Realm) you want to give to your password protected site.
top
Auth Digest
MD5 Digest authentication provides a more secure password system than Basic authentication, but only works with supporting browsers. The only major browsers which support digest authentication are Internet Explorer 5.0, Amaya and Konqueror from KDE2. I don't think its save for Big Brother, but it's always more save than Auth Basic. And most users are using Internet Explorer 5.0 or higher.
Module: mod_digest (old version)
Module: mod_auth_digest (new version)
OS: Unix, Linux, WinNT.
Don't use both modules on the same time.
Setting up MD5 Digest authentication is easy.
Put a file named .htaccess in the directory you want to password protect with the follow text.
Example: mod_digest
AuthDigestFile /opt/guide/www.widexl.com/.htpasswd AuthType Digest AuthName "Member Page" require valid-user
Example: mod_auth_digest
AuthDigestFile /opt/guide/www.widexl.com/.htpasswd AuthType Digest AuthName "Member Page" AuthDigestDomain /member/ http://www.widexl.com/members/ AuthDigestNonceLifetime 300 require valid-user
Enabling SSI Via htaccess
Many people want to use SSI, but don't seem to have the ability to do so with their current web host. You can change that with htaccess. A note of caution first...definitely ask permission from your host before you do this, it can be considered 'hacking' or violation of your host's TOS, so be safe rather than sorry:
The first line tells the server that pages with a .shtml extension (for Server parsed HTML) are valid. The second line adds a handler, the actual SSI bit, in all files named .shtml. This tells the server that any file named .shtml should be parsed for server side commands. The last line is just techno-junk that you should throw in there.AddType text/html .shtml AddHandler server-parsed .shtml Options Indexes FollowSymLinks Includes
And that's it, you should have SSI enabled. But wait...don't feel like renaming all of your pages to .shtml in order to take advantage of this neat little toy? Me either! Just add this line to the fragment above, between the first and second lines:
A note of caution on that one too, however. This will force the server to parse every page named .html for SSI commands, even if they have no SSI commands within them. If you are using SSI sparingly on your site, this is going to give you more server drain than you can justify. SSI does slow down a server because it does extra stuff before serving up a page, although in human terms of speed, it is virtually transparent. Some people also prefer to allow SSI in html pages so as to avoid letting anyone who looks at the page extension to know that they are using SSI in order to prevent the server being compromised through SSI hacks, which is possible. Either way, you now have the knowledge to use it either way.AddHandler server-parsed .html
If, however, you are going to keep SSI pages with the extension of .shtml, and you want to use SSI on your Index pages, you need to add the following line to your htaccess:
DirectoryIndex index.shtml index.html
jQuery - Selectors
The jQuery library harnesses the power of Cascading Style Sheets (CSS) selectors to let us quickly and easily access elements or groups of elements in the Document Object Model (DOM).
A jQuery Selector is a function which makes use of expressions to find out matching elements from a DOM based on the given criteria.
The $() factory function:
All type of selectors available in jQuery, always start with the dollar sign and parentheses: $().The factory function $() makes use of following three building blocks while selecting elements in a given document:
jQuery | Description |
---|---|
Tag Name: | Represents a tag name available in the DOM. For example $('p') selects all paragraphs in the document. |
Tag ID: | Represents a tag available with the given ID in the DOM. For example $('#some-id') selects the single element in the document that has an ID of some-id. |
Tag Class: | Represents a tag available with the given class in the DOM. For example $('.some-class') selects all elements in the document that have a class of some-class. |
NOTE: The factory function $() is a synonym of jQuery() function. So in case you are using any other JavaScript library where $ sign is conflicting with some thing else then you can replace $ sign by jQuery name and you can use function jQuery() instead of $().
Example:
Following is a simple example which makes use of Tag Selector. This would select all the elements with a tag name p.<html> <head> <title>the title</title> <script type="text/javascript" src="/jquery/jquery-1.3.2.min.js"></script> <script type="text/javascript" language="javascript"> $(document).ready(function() { var pars = $("p"); for( i=0; i<pars.length; i++ ){ alert("Found paragraph: " + pars[i].innerHTML); } }); </script> </head> <body> <div> <p class="myclass">This is a paragraph.</p> <p id="myid">This is second paragraph.</p> <p>This is third paragraph.</p> </div> </body> </html> |
How to use Selectors?
The selectors are very useful and would be required at every step while using jQuery. They get the exact element that you want from your HTML document.Following table lists down few basic selectors and explains them with examples.
Selector | Description |
---|---|
Name | Selects all elements which match with the given element Name. |
#ID | Selects a single element which matches with the given ID |
.Class | Selects all elements which match with the given Class. |
Universal (*) | Selects all elements available in a DOM. |
Multiple Elements E, F, G | Selects the combined results of all the specified selectors E, F or G. |
- $('*'): This selector selects all elements in the document.
- $("p > *"): This selector selects all elements that are children of a paragraph element.
- $("#specialID"): This selector function gets the element with id="specialID".
- $(".specialClass"): This selector gets all the elements that have the class of specialClass.
- $("li:not(.myclass)"): Selects all elements matched by <li> that do not have class="myclass".
- $("a#specialID.specialClass"): This selector matches links with an id of specialID and a class of specialClass.
- $("p a.specialClass"): This selector matches links with a class of specialClass declared within <p> elements.
- $("ul li:first"): This selector gets only the first <li> element of the <ul>.
- $("#container p"): Selects all elements matched by <p> that are descendants of an element that has an id of container.
- $("li > ul"): Selects all elements matched by <ul> that are children of an element matched by <li>
- $("strong + em"): Selects all elements matched by <em> that immediately follow a sibling element matched by <strong>.
- $("p ~ ul"): Selects all elements matched by <ul> that follow a sibling element matched by <p>.
- $("code, em, strong"): Selects all elements matched by <code> or <em> or <strong>.
- $("p strong, .myclass"): Selects all elements matched by <strong> that are descendants of an element matched by <p> as well as all elements that have a class of myclass.
- $(":empty"): Selects all elements that have no children.
- $("p:empty"): Selects all elements matched by <p> that have no children.
- $("div[p]"): Selects all elements matched by <div> that contain an element matched by <p>.
- $("p[.myclass]"): Selects all elements matched by <p> that contain an element with a class of myclass.
- $("a[@rel]"): Selects all elements matched by <a> that have a rel attribute.
- $("input[@name=myname]"): Selects all elements matched by <input> that have a name value exactly equal to myname.
- $("input[@name^=myname]"): Selects all elements matched by <input> that have a name value beginning with myname.
- $("a[@rel$=self]"): Selects all elements matched by <p> that have a class value ending with bar
- $("a[@href*=domain.com]"): Selects all elements matched by <a> that have an href value containing domain.com.
- $("li:even"): Selects all elements matched by <li> that have an even index value.
- $("tr:odd"): Selects all elements matched by <tr> that have an odd index value.
- $("li:first"): Selects the first <li> element.
- $("li:last"): Selects the last <li> element.
- $("li:visible"): Selects all elements matched by <li> that are visible.
- $("li:hidden"): Selects all elements matched by <li> that are hidden.
- $(":radio"): Selects all radio buttons in the form.
- $(":checked"): Selects all checked boxex in the form.
- $(":input"): Selects only form elements (input, select, textarea, button).
- $(":text"): Selects only text elements (input[type=text]).
- $("li:eq(2)"): Selects the third <li> element
- $("li:eq(4)"): Selects the fifth <li> element
- $("li:lt(2)"): Selects all elements matched by <li> element before the third one; in other words, the first two <li> elements.
- $("p:lt(3)"): selects all elements matched by <p> elements before the fourth one; in other words the first three <p> elements.
- $("li:gt(1)"): Selects all elements matched by <li> after the second one.
- $("p:gt(2)"): Selects all elements matched by <p> after the third one.
- $("div/p"): Selects all elements matched by <p> that are children of an element matched by <div>.
- $("div//code"): Selects all elements matched by <code>that are descendants of an element matched by <div>.
- $("//p//a"): Selects all elements matched by <a> that are descendants of an element matched by <p>
- $("li:first-child"): Selects all elements matched by <li> that are the first child of their parent.
- $("li:last-child"): Selects all elements matched by <li> that are the last child of their parent.
- $(":parent"): Selects all elements that are the parent of another element, including text.
- $("li:contains(second)"): Selects all elements matched by <li> that contain the text second.
Thursday, 16 August 2012
integrate icici payment gateway php without JavaBridge/JDK
The Installation process for SFAClient.zip
1.
Unzip SFAClient.zip. This will create a folder
called SFAClient
2.
SFAClient contains the following files and directory.
1.
Sfa – SFA Client library (contains the PHP Sfa library)
2.
Test Pages – Sample pages for transactions and a
test page (test.php) for testing php.
3.
sfa.properties
PHP Web Application Directory Structure – Sample Example
·
Create the following PHP Web application directory structure as
given below
o E.g. the Merchant website directory name is “Merchant_Site_Dir”.
·
Copy all the directory
and files from unzipped SFAClient to Merchant_Site_Dir .
§ Place
the directory Merchant_Site_Dir in C:/wamp/www/ as shown below.
·
Sfa, Test Pages and sfa.properties
Note:
§ Sfa folder should be copied to the folder where
TestPages/Merchant pages are present.
§ The directory names are case sensitive. Create them as mention
above.
Changes in Test Pages
- Open the SFAResponse.php and made some changes
<?php
include("Sfa/EncryptionUtil.php");
$strMerchantId="00000001";
$astrFileName="c://key//sbi//00000001.key";
$astrClearData;
$ResponseCode = "";
$Message = "";
$TxnID = "";
$ePGTxnID = "";
$AuthIdCode = "";
$RRN = "";
$CVRespCode = "";
$Reserve1 = "";
$Reserve2 = "";
$Reserve3 = "";
$Reserve4 = "";
$Reserve5 = "";
$Reserve6 = "";
$Reserve7 = "";
$Reserve8 = "";
$Reserve9 = "";
$Reserve10 = "";
Note : Mercant ID must be
same as the .key file name. e.g. if file is 00000001.key then Merchant ID must
be 00000001.
- According to merchant type i.e. SSL or MOTO change select the file and make the changes
- e.g. if Merchant is SSL Merchant then change the TestSsl.php
<?php
include("Sfa/BillToAddress.php");
include("Sfa/CardInfo.php");
include("Sfa/Merchant.php");
include("Sfa/MPIData.php");
include("Sfa/ShipToAddress.php");
include("Sfa/PGResponse.php");
include("Sfa/PostLibPHP.php");
include("Sfa/PGReserveData.php");
$oMPI = new MPIData();
$oCI = new CardInfo();
$oPostLibphp = new PostLibPHP();
$oMerchant = new Merchant();
$oBTA = new BillToAddress();
$oSTA = new ShipToAddress();
$oPGResp = new PGResponse();
$oPGReserveData = new
PGReserveData();
$oMerchant->setMerchantDetails("00000001","00001203","00001203","193.545.34.33",rand()."","Ord123","http://10.10.10.167/SFAResponse.php","POST","INR","INV123","req.Sale","100","","Ext1","true","Ext3","Ext4","Ext5");
?>
Put marchant id.
- e.g. if Merchant is Moto Merchant then change the TestMoto.php
Set the key directory path
·
'Key.Directory' should contain the name of the
folder, which contains the merchant key. A trailing slash has to be included at
the end of this value. The name of the file (.key file) need not be set. Save
the file after making other relevant changes.
§
Key.Directory=D://WAMP//WWW//key//
Note: Don’t include key in key directory path.
·
Enable the verbose parameter to “true” only when
required to generate logs. These logs are to be used for debugging (while
integration) and should not be set to “true” in production as it might lead to
considerable amount of logs depending on the number of transactions.
·
To verify the success of the above operations
open the jar file again and check if the properties file has the values set.
Enabling Curl extensions
The curl extension
files are
- libeay32.dll
- ssleay32.dll
These files should
be present in to C:\WINDOWS\system32
and Php installation directory.
Open the php.ini file from PHP installation
directory remove the semicolon of extension=php_curl.dll.
Disabling mcrypt extensions (for PHP version <= 4.4.4)
- Open the php.ini file from PHP installation directory add the semicolon on start of line ;extension=php_mcrypt.dll (if semicolon not present).
Checklist
·
Merchant should have
access to ePG over https
·
Check connectivity
between php
1.
Restart the IIS Server
2.
Browse the
testjava.php page either from browser of from IIS as shown below
i. Url : http://localhost/Merchant_Site_Name/test.php
Transaction Testing
·
Restart the Apache
·
Open the PHP page
either from browser or from Apache
·
If Merchant is SSL
then open TestSsl.php else if Merchant is Moto then TestMoto.php
1.
From IIS
2. From Browser
·
Type the URL :
http://localhost/Merchant_Site_name/TestSsl.php
Troubleshooting
Problem : In log file if you
got SSL certificate problem….
Solution : Add the
certificate CSR in \Sfa\cacerts.pem file. (Refer Adding Certificates in Cacerts
section).
Tuesday, 7 August 2012
Basic Linux Commands
mkdir - make directories
Usage
mkdir [OPTION] DIRECTORY
Options
Create the DIRECTORY(ies), if they do not already exist.
Mandatory arguments to long options are mandatory for short options too.
-m, mode=MODE set permission mode (as in chmod), not rwxrwxrwx - umask
-p, parents no error if existing, make parent directories as needed
-v, verbose print a message for each created directory
-help display this help and exit
-version output version information and exit
cd - change directories
Use cd to change directories. Type cd followed by the name of a directory to access that directory.Keep in mind that you are always in a directory and can navigate to directories hierarchically above or below.
mv- change the name of a directory
Type mv followed by the current name of a directory and the new name of the directory.
Ex: mv testdir newnamedir
pwd - print working directory
will show you the full path to the directory you are currently in. This is very handy to use, especially when performing some of the other commands on this page
rmdir - Remove an existing directory
rm -r
Removes directories and files within the directories recursively.
chown - change file owner and group
Usage
chown [OPTION] OWNER[:[GROUP]] FILE
chown [OPTION] :GROUP FILE
chown [OPTION] --reference=RFILE FILE
Options
Change the owner and/or group of each FILE to OWNER and/or GROUP. With --reference, change the owner and group of each FILE to those of RFILE.
-c, changes like verbose but report only when a change is made
-dereference affect the referent of each symbolic link, rather than the symbolic link itself
-h, no-dereference affect each symbolic link instead of any referenced file (useful only on systems that can change the ownership of a symlink)
-from=CURRENT_OWNER:CURRENT_GROUP
change the owner and/or group of each file only if its current owner and/or group match those specified here. Either may be omitted, in which case a match is not required for the omitted attribute.
-no-preserve-root do not treat `/' specially (the default)
-preserve-root fail to operate recursively on `/'
-f, -silent, -quiet suppress most error messages
-reference=RFILE use RFILE's owner and group rather than the specifying OWNER:GROUP values
-R, -recursive operate on files and directories recursively
-v, -verbose output a diagnostic for every file processed
The following options modify how a hierarchy is traversed when the -R option is also specified. If more than one is specified, only the final one takes effect.
-H if a command line argument is a symbolic link to a directory, traverse it
-L traverse every symbolic link to a directory encountered
-P do not traverse any symbolic links (default)
chmod - change file access permissions
Usage
chmod [-r] permissions filenames
r Change the permission on files that are in the subdirectories of the directory that you are currently in. permission Specifies the rights that are being granted. Below is the different rights that you can grant in an alpha numeric format.filenames File or directory that you are associating the rights with Permissions
u - User who owns the file.
g - Group that owns the file.
o - Other.
a - All.
r - Read the file.
w - Write or edit the file.
x - Execute or run the file as a program.
Numeric Permissions:
CHMOD can also to attributed by using Numeric Permissions:
400 read by owner
040 read by group
004 read by anybody (other)
200 write by owner
020 write by group
002 write by anybody
100 execute by owner
010 execute by group
001 execute by anybody
ls - Short listing of directory contents
-a list hidden files
-d list the name of the current directory
-F show directories with a trailing '/'
executable files with a trailing '*'
-g show group ownership of file in long listing
-i print the inode number of each file
-l long listing giving details about files and directories
-R list all subdirectories encountered
-t sort by time modified instead of name
cp - Copy files
cp myfile yourfile
Copy the files "myfile" to the file "yourfile" in the current working directory. This command will create the file "yourfile" if it doesn't exist. It will normally overwrite it without warning if it exists.
cp -i myfile yourfile
With the "-i" option, if the file "yourfile" exists, you will be prompted before it is overwritten.
cp -i /data/myfile
Copy the file "/data/myfile" to the current working directory and name it "myfile". Prompt before overwriting the file.
cp -dpr srcdir destdir
Copy all files from the directory "srcdir" to the directory "destdir" preserving links (-poption), file attributes (-p option), and copy recursively (-r option). With these options, a directory and all it contents can be copied to another dir
ln - Creates a symbolic link to a file.
ln -s test symlink
Creates a symbolic link named symlink that points to the file test Typing "ls -i test symlink" will show the two files are different with different inodes. Typing "ls -l test symlink" will show that symlink points to the file test.
locate - A fast database driven file locator.
slocate -u
This command builds the slocate database. It will take several minutes to complete this command.This command must be used before searching for files, however cron runs this command periodically on most systems.locate whereis Lists all files whose names contain the string "whereis". directory.
more - Allows file contents or piped output to be sent to the screen one page at a time
less - Opposite of the more command
cat - Sends file contents to standard output. This is a way to list the contents of short files to the screen. It works well with piping.
whereis - Report all known instances of a command
wc - Print byte, word, and line counts
Usage
mkdir [OPTION] DIRECTORY
Options
Create the DIRECTORY(ies), if they do not already exist.
Mandatory arguments to long options are mandatory for short options too.
-m, mode=MODE set permission mode (as in chmod), not rwxrwxrwx - umask
-p, parents no error if existing, make parent directories as needed
-v, verbose print a message for each created directory
-help display this help and exit
-version output version information and exit
cd - change directories
Use cd to change directories. Type cd followed by the name of a directory to access that directory.Keep in mind that you are always in a directory and can navigate to directories hierarchically above or below.
mv- change the name of a directory
Type mv followed by the current name of a directory and the new name of the directory.
Ex: mv testdir newnamedir
pwd - print working directory
will show you the full path to the directory you are currently in. This is very handy to use, especially when performing some of the other commands on this page
rmdir - Remove an existing directory
rm -r
Removes directories and files within the directories recursively.
chown - change file owner and group
Usage
chown [OPTION] OWNER[:[GROUP]] FILE
chown [OPTION] :GROUP FILE
chown [OPTION] --reference=RFILE FILE
Options
Change the owner and/or group of each FILE to OWNER and/or GROUP. With --reference, change the owner and group of each FILE to those of RFILE.
-c, changes like verbose but report only when a change is made
-dereference affect the referent of each symbolic link, rather than the symbolic link itself
-h, no-dereference affect each symbolic link instead of any referenced file (useful only on systems that can change the ownership of a symlink)
-from=CURRENT_OWNER:CURRENT_GROUP
change the owner and/or group of each file only if its current owner and/or group match those specified here. Either may be omitted, in which case a match is not required for the omitted attribute.
-no-preserve-root do not treat `/' specially (the default)
-preserve-root fail to operate recursively on `/'
-f, -silent, -quiet suppress most error messages
-reference=RFILE use RFILE's owner and group rather than the specifying OWNER:GROUP values
-R, -recursive operate on files and directories recursively
-v, -verbose output a diagnostic for every file processed
The following options modify how a hierarchy is traversed when the -R option is also specified. If more than one is specified, only the final one takes effect.
-H if a command line argument is a symbolic link to a directory, traverse it
-L traverse every symbolic link to a directory encountered
-P do not traverse any symbolic links (default)
chmod - change file access permissions
Usage
chmod [-r] permissions filenames
r Change the permission on files that are in the subdirectories of the directory that you are currently in. permission Specifies the rights that are being granted. Below is the different rights that you can grant in an alpha numeric format.filenames File or directory that you are associating the rights with Permissions
u - User who owns the file.
g - Group that owns the file.
o - Other.
a - All.
r - Read the file.
w - Write or edit the file.
x - Execute or run the file as a program.
Numeric Permissions:
CHMOD can also to attributed by using Numeric Permissions:
400 read by owner
040 read by group
004 read by anybody (other)
200 write by owner
020 write by group
002 write by anybody
100 execute by owner
010 execute by group
001 execute by anybody
ls - Short listing of directory contents
-a list hidden files
-d list the name of the current directory
-F show directories with a trailing '/'
executable files with a trailing '*'
-g show group ownership of file in long listing
-i print the inode number of each file
-l long listing giving details about files and directories
-R list all subdirectories encountered
-t sort by time modified instead of name
cp - Copy files
cp myfile yourfile
Copy the files "myfile" to the file "yourfile" in the current working directory. This command will create the file "yourfile" if it doesn't exist. It will normally overwrite it without warning if it exists.
cp -i myfile yourfile
With the "-i" option, if the file "yourfile" exists, you will be prompted before it is overwritten.
cp -i /data/myfile
Copy the file "/data/myfile" to the current working directory and name it "myfile". Prompt before overwriting the file.
cp -dpr srcdir destdir
Copy all files from the directory "srcdir" to the directory "destdir" preserving links (-poption), file attributes (-p option), and copy recursively (-r option). With these options, a directory and all it contents can be copied to another dir
ln - Creates a symbolic link to a file.
ln -s test symlink
Creates a symbolic link named symlink that points to the file test Typing "ls -i test symlink" will show the two files are different with different inodes. Typing "ls -l test symlink" will show that symlink points to the file test.
locate - A fast database driven file locator.
slocate -u
This command builds the slocate database. It will take several minutes to complete this command.This command must be used before searching for files, however cron runs this command periodically on most systems.locate whereis Lists all files whose names contain the string "whereis". directory.
more - Allows file contents or piped output to be sent to the screen one page at a time
less - Opposite of the more command
cat - Sends file contents to standard output. This is a way to list the contents of short files to the screen. It works well with piping.
whereis - Report all known instances of a command
wc - Print byte, word, and line counts
bg
bg jobs
Places the
current job (or, by using the alternative form, the specified
jobs) in the background, suspending its execution so that a new
user prompt appears immediately. Use the
jobs
command to discover the identities of background jobs.
cal month
year
-
Prints a calendar
for the specified month of the specified year.
cat files
-
Prints the
contents of the specified files.
clear
-
Clears the
terminal screen.
cmp file1
file2
-
Compares two
files, reporting all discrepancies. Similar to the
diff
command, though the output format differs.
diff file1
file2
-
Compares two
files, reporting all discrepancies. Similar to the
cmp command, though the output format differs.
dmesg
-
Prints the
messages resulting from the most recent system boot.
fg
fg jobs
-
Brings the
current job (or the specified jobs) to the foreground.
file files
-
Determines and
prints a description of the type of each specified file.
find path -name pattern
-print
Searches the
specified path for files with names matching the specified
pattern (usually enclosed in single quotes) and prints their
names. The
find
command has many other arguments and functions; see the online
documentation.
finger users -
Prints
descriptions of the specified users.
free
-
Displays the
amount of used and free system memory.
ftp hostname
Opens an FTP
connection to the specified host, allowing files to be
transferred. The FTP program provides subcommands for
accomplishing file transfers; see the online documentation.
head files
-
Prints the first
several lines of each specified file.
ispell files
-
Checks the
spelling of the contents of the specified files.
kill
process_ids
kill - signal process_ids
kill -l
Kills the
specified processes, sends the specified processes the specified
signal (given as a number or name), or prints a list of
available signals.
killall
program
killall - signal program
Kills all
processes that are instances of the specified program or sends
the specified signal to all processes that are instances of the
specified program.
mail
-
Launches a simple
mail client that permits sending and receiving email messages.
man title
man section title
-
Prints the
specified man page.
ping host
-
Sends an echo
request via TCP/IP to the specified host. A response confirms
that the host is operational.
reboot
-
Reboots the
system (requires
root
privileges).
shutdown
minutes
shutdown -r
minutes
Shuts down the
system after the specified number of minutes elapses (requires
root
privileges). The -r option causes the system to be
rebooted once it has shut down.
sleep time
-
Causes the
command interpreter to pause for the specified number of
seconds.
sort files
-
Sorts the
specified files. The command has many useful arguments; see the
online documentation.
split file
-
Splits a file
into several smaller files. The command has many arguments; see
the online documentation
sync
-
Completes all
pending input/output operations (requires
root
privileges).
telnet host
-
Opens a login
session on the specified host.
top
-
Prints a display
of system processes that's continually updated until the user
presses the
q
key.
traceroute
host
-
Uses echo
requests to determine and print a network path to the host.
uptime
-
Prints the system
uptime.
w
-
Prints the
current system users.
wall
- Prints a message
to each user except those who've disabled message reception.
Type Ctrl-D to end the message.
Subscribe to:
Posts (Atom)