Using the patch utility to remove a patch on Magento Enterprise Edition


I am making an assumption here that you already know the normal forward-usage of the patch command. If you’re unversed In case you didn’t want to decipher the entire man page just yet, you’re in luck. I came across an instance where I had to remove a previous patch file from the Magento Enterprise code-base. The patch was originally applied as so:

patch -p0 < firstpatch.patch

Problems ensued, and I was given a new patch, however it was a cumulative patch so it couldn’t be laid over the first patch. So how to remove? After a man-page reading, it’s quite a breeze. You need the original patch to be removed, and use the patch number you used in the first patching instance. In this case it equates to the following:

patch -R -p0 < firstpatch.patch

now you can add the new patch.

patch -p0 < secondpatch.patch

Hopefully this will save someone a man-page reading on a small terminal in a dimly lit server room. :-)

 

Setup IntelliJ 9 for Lift Framework Development


This small tutorial may seem overly simplified but I think that a lot of newbies out there will find it helpful. I also would consider using sbt instead of just maven but this tutorial covers just maven.
I have been developing using Lift for a little over a year now and I found the IDE choices grim. I tried Eclipse, Netbeans and IntelliJ. My clear favorite is IntelliJ. It does not specifically support the Lift Framework but it does have great support for Scala and Maven. Here’s how I set things up.

Download and Install Maven 2.2.1: http://maven.apache.org/download.html

You MUST set your M2_HOME environment variable. Methods to accomplish this vary from system to system.

Go to a directory where you want to create your Lift app and run something like this(varies depending on archetype)

1
2
3
4
5
6
7
mvn archetype:generate -U        \
     -DarchetypeGroupId=net.liftweb        \
     -DarchetypeArtifactId=lift-archetype-basic        \
     -DarchetypeVersion=2.0        \
     -DremoteRepositories=http://scala-tools.org/repo-releases        \
     -Dversion=0.1		\
     -DgroupId=com.morroni.jagger -DartifactId=store-jagger

Download and install intelliJ 9.02 Community Edition or Ultimate: http://www.jetbrains.com/idea/download/

Open up IntelliJ and goto the menu item IntelliJ->Preferences. Choose the Plugins menu on the left and click the Available tab at the top. Type “scala” to search for the relevant plugins. Highlight the Scala plugin and click the little disk/arrow icon to install them.
plugins1

Open up IntelliJ and goto File->New Project

Choose Import project from external model and click Next
openproject

Choose Maven and click Next
openproject2

Enter the location of the folder where you generated your maven project and click next
openproject3

Select both profile radio boxes and click Next
openproject4

Make sure the only Maven project available is selected and click Next
openproject5

Click Finish.

When you are ready to run your project, right click on it and select Run “store-jagger [jetty:run]”
runit

Open up a web browser and go to http://localhost:8080
scfreenshot

 

Centos 5.4, PHP, and Microsoft SQL Server


I ran into this problem and got stuck on it for a day so I thought I would post.  The only way to get PHP to talk to Microsoft SQL server properly on a  Redhat/Centos 5.4 build is to ensure that you have disabled SELinux at start-up.  This option is available from the install menu but can also be achieved by modifying the boot parameters.

 

Lift Framework Tips


Displaying a menu item only if a user is logged in. If they are not logged in, route them to /login

This is inside Boot.scala

1
2
3
4
val LoggedIn = If(() =&gt; User.loggedIn_?, () =&gt; RedirectResponse("/login"))
val myLoc = Loc("SecurePage", "securePage" :: Nil, "Secure Page", LoggedIn)
val myMenu = Menu(myLoc)
val entries = myMenu ::Menu(Loc("Home", List("index"), "Home")) ::: User.sitemap

Generate the api documents for a lift/scala project

1
mvn scala:doc
 

Email settings for avoiding quota issues


You may receive trouble if you receive so much email that your quota of space on the mailserver goes beyond the limits. There are a few things you can do to stop this from happening, and if it is too late, you can recover some space and your email will begin functioning properly thereafter.

First off, you can set your email client to delete the messages from your trashcan when you close the application.

If you are running Mozilla Thunderbird:
1) Go to the Tools -> Account Settings from the menu.

2) Make sure your account is expanded in the left pane and Select “Server Settings” underneath your account.

3) Make sure you have checked “Empty Trash on Exit”. Now when you close your email client, it will automatically delete your trashed items and they will no longer be taking up space on the server.

Maybe your account is locked because you are already over quota? You can use the webmail interface to get into your email and delete large old messages.

1) go to <a href=”http://morronimail.com”>morronimail.com</a> and log in using your email user id and password.

2) click on the “size” label on the far right column of your email listings. this will sort your email by size. If if is not sorted largest to smallest, click on it again to attain this sort order.

3) you can click the checkbox on the left of your older and larger emails, especially those with attachments (PDF, Images, etc) that you no longer need. Click the delete option at the the top and it will place a strike-through font to all the emails you selected. Now click the purge emails option, and they will be permanently deleted, thus freeing space up on your account.

 

How to setup a Merchant Account


If you will be creating a web store, you will definitely need to setup a Merchant Account and a payment gateway. When creating a merchant account, it is a good practice to start with a bank you already work with. You can certainly shop around for better rates. For a payment gateway we recommend authorize.net

What to know for your Merchant Account application process:
1) If you have started development of your e-commerce site, get your merchant account under wraps as soon as possible. It takes time to work out a deal and even get approval from a bank, and if you are shopping around for the best deal, it will take even longer.

2) Know your products, and know your sales potential. You will need to offer the banks prospective sales numbers when negotiating the terms of your merchant account.

3) Be prepared to deal with fraud. Credit fraud happens. What will your recourse be if someone uses a stolen credit card through your e-commerce site? There are certainly steps to take to head this off. New sites most likely take advantage of better security measures such as Address Verification for the cardholder, as well as confirmation of CV2 codes. (the numbers on the back of your credit card)

Payment Gateways:
Payment gateways work through a secure encrypted route of communication between your e-commerce site and credit authorization services for validating transactions. They are a necessary safeguard against credit fraud. Additionally, you can use services through a payment gateway to process repeated billing cycles. This would be an additional plus if the services you are rendering are to be charged in some recurring basis.

With a merchant account and a proper payment gateway, you will be properly equipped to enter the e-commerce realm. If you are interested in more information on our e-commerce solutions, please contact us

 

How do I set up my e-mail in Microsoft Outlook?


Method 1: Microsoft Office Outlook 2007

  1. Start Outlook.
  2. On the Tools menu, click Account Settings.
  3. Click New.
  4. Click Microsoft Exchange, POP3, IMAP, or HTTP, and then click Next.
  5. In the Auto Account Setup dialog box, click to select the Manually configure server settings or additional server types check box, and then click Next.
  6. Click Internet E-Mail, and then click Next.
  7. In the Server Information section, select IMAP for Account Type.
  8. In the Your Name box, enter your name exactly as you want it to appear to recipients.
  9. In the E-mail Address box, type your e-mail address, for example, jdoe@example.com
  10. In the User Name box, type your account name. Your account name is comprised of a “mor” prefix, and then four numbers.
  11. In the Password box, type your password.
  12. In the Incoming mail server box, type the name of your IMAP4 server, in this case “mailserver.morronimail.com”
  13. In the Outgoing mail server (SMTP) box, type the name of your SMTP server, in this case “smtpserver.morronimail.com”
  14. Note IMAP4 is a retrieval protocol. You must have SMTP to send your messages.

  15. Click Next after you have completed entering this configuration information, and then click Finish.

Method 2: Microsoft Office Outlook 2003 and earlier versions of Outlook

  1. Start Outlook.
  2. On the Tools menu, click E-mail Accounts.
  3. w_outlook2k3_11

  4. Under E-mail Accounts, click Add a new e-mail account, and then click Next.
  5. w_outlook2k3_2

  6. Click IMAP as the type of account that you are creating, and then click Next.
  7. w_outlook2k3_3

  8. In the Your Name box, enter your name exactly as you would like it to appear to recipients.
  9. In the E-mail Address box, type your e-mail address., for example, jdoe@example.com
  10. In the User Name box, type your account name. Your account name is comprised of a “mor” prefix, and then four numbers.
  11. In the Password box, type your password.
  12. In the Incoming mail server (IMAP) box, type the name of your IMAP4 server,in this case “mailserver.morronimail.com”
  13. In the Outgoing mail server (SMTP) box, type the name of your SMTP server, in this case “smtpserver.morronimail.com”
  14. w_outlook2k3_4

  15. Click Next after you have completed entering this configuration information, and then click Finish.
  16. w_outlook2k3_5

 

Things to remember when disabling SELinux


Perhaps SELinux was provided by default from your linux distribution of choice, or maybe it has been determined that it is not needed anymore for whatever applications the server is currently performing. Disabling SELinux is a matter of changing a line in your selinux config. The normal location would be to look in /etc/selinux/config and change the value of the SELINUX line.


# SELinux turned off
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled

However, we’re not done yet! Before you reboot your system you need to make sure that your
kernel boot line isn’t expecting SELinux to be active. We can set it to be specifically deactivated as
follows:

with Grub:

edit your /boot/grub/menu.lst


title  Ubuntu 9.04, kernel 2.6.28-11-generic
uuid   28cd3d96-e22c-4230-a63d-f7a73ec323e3
kernel  /boot/vmlinuz-2.6.28-11-generic root=/dev/sda3 ro rootdelay=10 quiet splash selinux=0
initrd  /boot/initrd.img-2.6.28-11-generic
quiet

Note: you may also need to add enforcing=0 to your kernel line, depending on your setup.

 

Setup email for thunderbird in Windows


  1. You can download the latest version of Mozilla Thunderbird from this page:
    http://www.mozilla.com/en-US/thunderbird
    After the download completes, double click on the executable. It will start the install process. If a window appears asking you if you want to run the program, click “run”.
  2. You will see the intro screen to the installation proccess like so: simply click “next”

    Installation intro screen

    Installation intro screen

  3. Select Standard Install on the next screen and press next.install_2
  4. Verify installation Location and click nextinstall_3
  5. Installation will proceed, make sure the “Launch Thunderbird” checkbox is checked and click finish to proceed.
  6. install_4install_final
  7. Now that the installation is complete, we can configure the email settings in the application. When thunderbird first starts up, you see this screen:config_1as you can see, I filled in my name, my email address and my password. press continue. Thunderbird will try and autodetect settings for you but we have to specify more information yet. Click continue.config_2

Click Stop on this screen. We want to correct the information as follows. Click the Manual Setup button.

username is your supplied username for the system.

incoming: mailserver.morronimail.com , port 143, SSL/TLS

outgoing: smtpserver.morronimail.com, port 587, None

settints2

and the SMTP settings (which can be reached by clicking on outgoing smtp server on the left pane and then pressing “edit” or “add” if there is no selection

config_smtp

when you’re done with all the settings press ok and send yourself a test email. If you are prompted for your account password, enter it and select the box to remember the password. You’re set!

 

Setup IMAP E-mail on Apple Mail


This short tutorial covers adding an e-mail account to Apple’s Mail Application.  It includes specific information for Morroni technologies servers.

Goto Applications->Mail

screen-shot-2010-01-08-at-94354-am

Once Apple mail is open, goto the file menu item Mail->Preferences

screen-shot-2010-01-08-at-95629-am

Once inside Preferences, click on the Account tab at the top and fill in your user information.  Click the + bottom in the bottom left of the screen.

screen-shot-2010-01-08-at-93902-am

This will bring up the new mail account wizard where you should insert your provided information.

screen-shot-2010-01-08-at-93937-am

Click Continue and you will be at step 2.  Choose IMAP for Account Type.  Enter a description of your choice.  For incoming mail server use mailserver.morroni.com.  Enter the user name and password provided to you.

screen-shot-2010-01-08-at-94021-am

Click continue.  make sure to click Connect when you get the verify dialogue box (seen below).

screen-shot-2010-01-08-at-94034-am

The next screen sets up the outgoing mailserver.  Use your provided login information and enter the fields as they are below.

screen-shot-2010-01-08-at-94057-am

Click Continue and again make sure to accept the verification of the security certificate.

screen-shot-2010-01-08-at-94118-am

Verify the information and click Create.

You are now done, enjoy your new setup!