Website Performance - We can Help - Merkados
Website Design Promo

Search / Find files modified in the last x days with Bash in Terminal

March 13th, 2015 admin

So, if you are like me, sometimes for any number of reasons, you have to find all the files of a certain type that have been modified lately. For example, if a client had a security problem with their website and you would like to check what files where modified since the last backup. Or let’s say that you don’t remember what files you modified the last time that you made some changes to a directory, etc.

Read the rest of this entry »

The easy tutorial of Rsync to “SYNC” two folders and its contents.

January 19th, 2015 admin

If you are looking for a solution to syncing two folders, whether it’s over a network or locally, this is how you do it.

In my opinion this is a very valuable specially when you have media files that are very important to you and you want to lose them.

Read the rest of this entry »

Replacing a Character in a MySQL table using REPLACE

November 24th, 2014 admin

The latest replacement I had to do was to change all occurrences of an apostrophe with a single quote in a table. Now, that wouldn’t be a lot of fun to do by hand and believe me, with the number of records it would also be exhausting! So, this is a very quick post that shows you how to update a table, using the REPLACE function in MySQL to change one character:

1. First go ahead and find out how many records are going to be affected:

SELECT * FROM table1 WHERE column1 LIKE "%\'%";

2. Once you know the number of records then simply run the update routine:

UPDATE table1 SET column1 = REPLACE(column1, "\’", "\'") 
WHERE column1 LIKE "%\’%"

That’s it – very simple. We are updating the table1 and setting the column1 to be equal to the result of a replace. The replace function takes three parameters: 1. The column, 2. The replacement pattern (in this case escaped by a backslash), and 3. The character to replace with – in this case, also escaped with backslash.

The result is a fine looking column of data with your new characters…

Enjoy!

Cross Domain Tracking with Universal Analytics.js – Google Analytics.

November 14th, 2014 admin

So I know that you could go to the Google Analytics blog and simply try to understand all the information that they have to offer about how to track several domains with the same Google Analytics Profile. However, I wanted to post a simpler way to get going fast and easy with the cross domain tracking without having to spend 3 hours. Before we begin, let’s say why this is important. Let’s say that you have an e-commerce cart, and let’s say that that e-commerce cart is located in an external domain. If you implement Google analytics the normal way you’re going to end up increasing unnecessarily the referral count. More importantly those referrals are going to show as if they are coming from your own website.

So, without further adieu, let me share with you the secrets of implementing cross domain tracking in Google Analytics, specifically with the universal tracking code.

Read the rest of this entry »

Moving a cPanel acount from host to host

January 28th, 2014 admin

So, for this post, I am going to assume that you are having some trouble moving a cPanel account from one server to another. Usually, the problem is because certain hosting companies modify the cPanel installation and therefore once you create a backup – it doesn’t work.

This steps are going to reduce the time that you would waste trying to figure it out on your own. Read the rest of this entry »

Upload folder is not writable. Export and file upload features will not be functional.

March 4th, 2013 admin

WordPress is a fantastic CMS platform. It is preferred by many clients and therefore as developers we end up using it for all sorts of projects. Sometimes, things go sour though. If you have moved a WordPress site from development to staging to production, you have run into funny problems such as the little red message called: “Upload folder is not writable. Export and file upload features will not be functional.”

Read the rest of this entry »

Hook_views_api – Use custom db table in Drupal Views – Tutorial

October 19th, 2012 admin

Ok so perhaps you have been in a position where you are developing a specific set of functions for a client in Drupal and you are leaning towards displaying some specific information from the database. It could be in a block or it could be in a page. This information would be displayed perfectly by Views (Drupal module) however you are creating a custom table in your Drupal database and of course Views doesn’t know about it.

You may think that since you are doing custom tables, why not simply bypass Views altogether and create a custom query as well. However, you understand that Views gives you great functionality out of the box like a pager, different display options (blocks, attachments, pages, and sometimes even CSV and more). So you decide that you need to learn how to modify the SQL query. Believe me, you could do that, but it would be a long night. So instead of attempting to change the query directly (which sometimes is inevitable) I am going to share with you how to “present” or “introduce” or “let Views know about” your new custom table so that you can use it for relationships within the GUI.

First let me say that you could do this by utilizing the Data Module. However, you have to enable the Schema Module as well and believe me when it comes to database modules, less is better.

Read the rest of this entry »

Remove Mailman’s Archive – Reduce Account Disk Space

September 24th, 2012 admin

Sometimes you may run into a situation where a Mailman mailing list is keeping either public or private archives of your messages and therefore you’ll eventually run into an interesting problem:

Problem:

Because Mailman has been keeping an archive of every message, image and email content that has been used in the list, that means that eventually that archive will be enormous, or at least big enough to make you want to delete it. How do you go about doing that? You can spend hours trying to find the right answer in Google and testing what works and what doesn’t or you can bypass all that and jump into the answer! Here it is:

Read the rest of this entry »

Using Apache .htaccess file to remove Query Strings

July 31st, 2012 admin

So today’s post is a little bit more technical than usual. But I’m sure that some of our technical readers will get a lot of value out of it.
In the world of SEO everybody is trying to move ahead, gain an advantage. Because of this fact, sometimes some webmasters are willing to take positions that are unethical. Sometimes they manipulate their own websites to get an advantage. However, sometimes they manipulate other people’s websites to take advantage as well. Read the rest of this entry »

Track Scrolling in a Page (Engagement) with Jquery and Google Analytics

December 20th, 2011 admin

So I came across a post by RTP Harry from http://runtingsproper.blogspot.com/2010/03/google-analytics-tracking-content.html where he explains how to track scroll depth in Google Analytics.

Since I was looking for exactly that for one of our projects I was excited to give it a go. However it didn’t work. And so I started in my usual journey of understanding why it wasn’t working, fixing it and then sharing it with all of our readers. So here it is:

Problem:

You want to track the engagement of your users and therefore you would like to see in Google Analytics if your users are scrolling down your pages and reaching at least 90% of the length. Read the rest of this entry »