Laravel – Change user password with tinker tool

change password

Today just asked myself if i can change user password in Laravel via command line, so things will be easier for us to work with Laravel products. I bet many of you use default Laravel user model (which is good for us in this case). if you do, this article is for you, i found an interesting tool within Laravel command line interface name ‘tinker’

Continue reading

Magento – Clean database dump for development purpose

cleaning database

Mangeto Database is huge and complicated, everyone knows about this truth. It’s a big obstacle for many developers who start working on a new project or grab latest changes on production server. The following procedure will help you to reduce size of production database a lot before downloading to you local environment.

Continue reading

Magento – Remove redundant attributes

Delete_Banner

Some time Magento redundant attributes can be very harmful. for example, AheadWork shop by brand will add aw_shopbybrand_brand attribute to catalog_product, it’s ok when you still use AheadWork module but it can be a big trouble like fatal error on server or producing error messages in your log file when you replace it with another extension. This issue happened because you just removed AheadWork module code from your Magento installation, aw_shopbybrand_brand attribute is still stay in your database. in this article, i will show you a setup script that will remove it.
Continue reading

Javascript – continuously, respectively send requests to server

continuous

Sometime you may want to send requests continuously to server with one request each time ( like a foreach in PHP, or for x in array or .each in Ruby …). we have ‘for’ and ‘for .. in’ loop but it’s not smart enough to wait for an Ajax request to be responded. so it doesn’t help us to fulfill our target. what should we do to loop through array, send Ajax request to server with data from array element and wait for response before sending new request ?

Continue reading

Unix – Setup HTTPS virtual hosts

ssl

SSL is an essential part of creating a secure Apache site. SSL certificates allow you encrypt all the traffic sent to and from your Apache web site to prevent others from viewing all of the traffic. It uses public key cryptography to establish a secure connection. This means that anything encrypted with a public key (the SSL certificate) can only be decrypted with the private key (stored only on the server) and vice versa.

Continue reading

CentOS – Install Nginx And PHP-FPM using yum

centos6

In this article, I’m going to show you how to install Nginx with PHP-FPM via yum on CentOS (actually, steps are similar on another operating sytems). Before starting to install Nginx and PHP-FPM, you must uninstall all previous Apache and PHP related RPMs installed on your system or you’ll have to disable Apache or httpd on your system. Login as root and type the following command

Continue reading

Tips for optimizing LAMP stack & Linux server

performance_banner
1. Get a dedicated server
Advantages– Whole server power for you
– You are very flexible in terms of new versions for webserver, database, php …
– There are not other customers which run “bad” scripts which slow down the shop
– You don’t share the same ip, very important for SEO.
If one customer makes a “bad business”, the ip can be blocked by google which affects your search ranking.
My recommendation:I am a big fan of the Amazon EC2 cloud which gives you everything you need (flexibility, scalability, security).
Continue reading

Five common PHP design patterns

php

Design patterns were introduced to the software community in Design Patterns, by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (colloquially known as the “gang of four”). The core concept behind design patterns, presented in the introduction, was simple. Over their years of developing software, Gamma et al found certain patterns of solid design emerging, just as architects designing houses and buildings can develop templates for where a bathroom should be located or how a kitchen should be configured. Having those templates, or design patterns, means they can design better buildings more quickly. The same applies to software.

Continue reading

How to Protect the wordpress wp-config.php File

The wp-config.php file contains very sensitive information about your WordPress installation, including your database access, table prefix and Secret Keys.

The wp-config.php file is a standard part of your WordPress installation. It defines the configuration settings required to access your MySQL database. If your self-hosting WordPress, there’s no way of getting around not using it.

It’s your job to protect it! You certainly don’t want this file falling into the wrong hands in the event of a server problem. You can protect it by encrypting it’s content when you upload and denying access to it.
Continue reading