Tuesday, July 12, 2016

Website Payments Pro Payflow Edition


How do I set up Payflow Pro with PayPal Sandbox?



1.Log in to PayPal Manager.

2.Enter your Partner, Merchant Login, User (if applicable) and Password, and click Log In.




3.From the main navigation select Service Settings | Setup.


4.The third heading from the top titled PayPal Express Checkout you'll see PayPal Sandbox email address.  Enter your PayPal Sandbox Seller email into this field, scroll to the bottom of the page and click on Save.


Your Payflow Manager has now been synced with your PayPal Sandbox account and is ready to begin accepting Test/Sandbox transactions.

NOTE:  If you do not see the PayPal Express Checkout section on the Set Up page,
you will need to contact Merchant Technical Support and request that PayPal Express Checkout be added to your Payflow account for testing purposes. 

Please provide your PayPal Sandbox email address and your Payflow Merchant login 
when creating the ticket with Merchant Technical Support.

configure php 5.x apache 2.4 windows 7



httpd.conf Edit



Download php-5.6.23-Win32-VC11-x86.zip from http://windows.php.net/download/ . Extract the zip file to c:\php.


Edit Apache’s config file, c:\Apache\conf\httpd.conf and add the following lines to the bottom of the file.

Method 1

  • LoadModule php5_module "c:/php/php5apache2_4.dll"
  • AddHandler application/x-httpd-php .php
  • PHPIniDir "c:/php"
  • Set the environment variable append this text : "c:/php"
  • Find Directory index and add index.php add below line
    • "DirectoryIndex index.html index.php"


save the conf file. Restart your Apache server.

Method 2

In this method we Configuring Apache to Use PHP as CGI on Windows Systems. which best suitable for Higher versions of php like (above php5.3 on Apache 2.2). we will configure below steps.


1. Assuming that your Apache server is installed at C:\Apache2.2

2. Assuming that your PHP engine is installed at c:/php/

3. Use "notepad" to open C:\Apache2.2\conf\httpd.conf

4. Go to alias_module section and define a script directory call /php/ as:


...
   ScriptAlias /php/ "c:/php/"
5. Add an access control section for this directory as:


    AllowOverride None
    Options None
    Order allow,deny
    Allow from all

6. Go to mime_module section and define a mime type as:


...  
    AddType application/x-httpd-php .php

7. At the root level below the LoadModule section, define an "Action" entry:

#LoadModule ssl_module modules/mod_ssl.so

Action application/x-httpd-php "/php/php-cgi.exe"
This "Action" entry tells Apache to run "php-cgi.exe" from the script directory "/php/" for any "application/x-httpd-php" mime files.

8. Restart your Apache server.

save the conf file. Restart your Apache server.

PHP INI Edit

Now we have to do a few edits to the php.ini file to tell it to load support for mysql and the location for the extensions. Since there is not a already set php.ini file we need to rename one of the two examples to php.ini.
Rename c:\php\php.ini-development to php.ini
Now let’s edit php.ini
Uncomment extension directory.
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
extension_dir = "ext"

Uncomment mysql modules
extension=php_mysql.dll
extension=php_mysqli.dll

save the .ini file changes. Restart your Apache server.

Tuesday, March 1, 2016

Git Merge

git checkout 2.3
git pull origin 2.3
so that u have all 2.3 changes.
then git checkout 2.4
git pull origin 2.4
so that u have all 2.4 changes
i mean locally u have both branches updated
now to merge 2.3 to 2.4
we should be on 2.4 branch
in brackets git show current branch if u using cmd line.
now for merging just do this
git merge 2.3
this would bring all 2.3 changes to 2.4
it would show merge conflict issues if any
 on cmd line
resolve issues
you need to do this manually or using some diff checker

then to commit all these local changes to 2.4
git add .
git commit -am "merge 2.3 to 2.4"
git push origin 2.4
 it would push all merged code to 2.4 branch



Git Process Commands


To change from one branch to other brach

git checkout -b  
ex:  git checkout -b 3.3 



To Undo the last commit or stash the last commit
git stash    -- Do the merge, and than pull the stash:
git stash pop --get the commited files to current branch


Reset the last commit in local
To discard the local changes using
sy: git reset --hard



To change the Last commit message in git



git commit --amend

will open your editor, allowing you to change the commit message of the most recent commit. Additionally, you can set the commit message directly in the command line with:

git commit --amend -m "New commit message"



To get the patch to file (all changes to specified file)


Git diff > sample.txt

Monday, February 22, 2016

Add text at the beginning of a line in vim

The substitute command can be used to insert (or replace) text. Some examples:

:s/^/new text / Insert "new text " at the beginning of the line.
:s/$/ new text/ Append " new text" to the end of the line.
:s/green/bright &/g Replace each "green" with "bright green" in the line.
By default, each command operates on the current line. If you visually select some text before entering the command, it will operate on each line in the visual selection. See Search and replace for details.
Or you can insert a range immediately after the colon, for instance :.-5,$s/ etc. to substitute from 5 lines above the cursor to the end of the file.

:s/^/test /  ----insert "test" at the beginning of each line.
:%s/^/test / --- insert "test" at the end of each line .

Saturday, February 6, 2016

Delete Files Older Than x Days on Linux

find /path/to/files* -mtime +5 -exec rm {} \;
ex: find /opt/test/patch/* -mtime +7 -exec rm {} \;

The first argument is the path to the files. This can be a path, a directory, or a wildcard as in the example above. I would recommend using the full path, and make sure that you run the command without the exec rm to make sure you are getting the right results.
The second argument, -mtime, is used to specify the number of days old that the file is. If you enter +5, it will find files older than 5 days.
The third argument, -exec, allows you to pass in a command such as rm. The {} \; at the end is required to end the command.

How to convert PPK file to ssh remote server in ubuntu


1.sudo apt-get install putty
2.puttygen private.ppk -o private-key -O private-openssh (Where “private.ppk” is the PuTTY .ppk file to convert, and “private-key” is the name of the converted key file.)
3.ssh -i private-key username@remote-server-ip
Now, you can easily access the remote server using the openssh standard private key:

refurl: https://rbgeek.wordpress.com/2012/11/14/how-to-convert-ppk-file-to-ssh-remote-server-in-ubuntu/