6+
votes
236 views

In below example we will find total number of audio/video files and add their sizes to show total volume on disk.

find /folder/destination -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\|mp3\)' -exec du -ch {} + | grep total$
7.8G total

/folder/destination is destination of your folder inside which you want to calculate total size of audio/video files

To calculate total size any folder browse in that directory and run:

... Read More
7+
votes
683 views

There are many methods to recover admin password described here https://www.drupal.org/node/44164 but this method gives you a admin panel to recover admin username and password.

Please copy and paste the below code in a file and name it whatever you like or download the attachment in this post, remove .txt extension and drop it in root of your website[in same place where you find robots.txt]. In my case i named it as "generate_drupal_admin_pwd.php".

and then access your website...

Read More
4+
votes
299 views

Use Case : Suppose you have a intranet website which is used for organization and you would like to upgrade that website and its module to latest version. For this you would need to use a proxy server.

A proxy server is a computer(server) which will raise the request to Drupal and act as an intermediate between your actual Drupal server and drupal.org.
So possible scenario is like this:

   Drupal Website(Actual Server) ⇄ Proxy Server(Intermediate...
Read More
2+
votes
477 views

If apache server failed to restart like this :

sudo service httpd restart
Stopping httpd: [FAILED]
Starting httpd: [FAILED]

then you need to check error logs which might be under this directory if you are running CentOS:

/var/log/httpd

inside this directory you will see error_log. Open this file and read last few entries with:

trail -100...
Read More
3+
votes
386 views

Sometimes you need to show page to anonymous user. Create a page using hook_menu by using below code:

  $items['your/path/name'] = array(
    'title' => 'You Title',
    'description' => 'Your Page Description',
    'page callback' => '_any_function_if_you_want_to_call',
    //'access arguments' => TRUE, <-- Comment or remove this if you have it
    'access callback' => TRUE,  <-- Add this
    'page arguments' => array(2), // Optional if...
Read More
3+
votes
439 views

If you encode with base64 and provide in URL, its not user friendly because they will not appear as proper link. By default it produces a string which contains characters like "+", "=" and "/" which will not let it become a URL with underline. Even you use to generate in emails, only the sub part of your URL will appear as URL with underline and rest will be ignored and appeared as weird characters.

If you want to use it in URL string and get the values as $_GET or even use it in...

Read More
8+
votes
631 views
label[for=email]
{
    /* ...definitions here... */
}
5+
votes
565 views

In Drupal, when you add exposed filters, it defaults to first word of your select list. But if you want to show all the results on page load then you have to set the exposed filters to "Any" option by default.

To do this:

Add a filter and Expose filter to visitors.

Choose Single filter, give it a label, choose "Is one of" under Operator, and have no terms selected/highlighted in the "Select terms from vocabulary" box. The only option checked under the vocab box is "...

Read More
9+
votes
462 views

You have to add a simple CSS on your CSS global file.

.ajax-progress-throbber {
    display: none;
}

To remove from a particular view add the view class(.your-view-class) before .ajax-progress-throbber class like:

.your-view-class .ajax-progress-throbber {
    display: none;
}
7+
votes
655 views

If you want to resolve this error there can be 2 ways:

1) Empty(Truncate) all the cache tables from your database. For example empty all tables suffix by "cache_" like cache, cache_block, cache_content, cache_filter, cache_form, cache_menu, cache_page, cache_update, cache_views.

2) Your MySQL credentials are not right. Check your settings.php see if your MySQL credentials are right. Either your database username, passport or host is wrong.