Skip to content

Instantly share code, notes, and snippets.

View nkgokul's full-sized avatar

Gokul N K nkgokul

View GitHub Profile
@nkgokul
nkgokul / drupal8installation
Last active April 16, 2016 06:16
Drupal 8 Installation file permissions
mkdir sites/default/files
chmod a+w sites/default/files
cp sites/default/default.settings.php sites/default/settings.php
cp sites/default/default.services.yml sites/default/services.yml
cp example.gitignore .gitignore
chmod a+w sites/default/settings.php
chmod a+w sites/default/services.yml
@nkgokul
nkgokul / phpini
Created March 10, 2015 10:33
Ubuntu php ini locations
/etc/php5/cli/php.ini is for the CLI PHP program, which you found by running php on the terminal.
/etc/php5/cgi/php.ini is for the php-cgi system which isn't specifically used in this setup.
/etc/php5/apache2/php.ini is for the PHP plugin used by Apache. This is the one you need to edit for changes to be applied for your Apache setup.
@nkgokul
nkgokul / replace_all_occurances_of_a_word_in_a_folder
Created February 27, 2015 09:40
Replace all occurances of a word in a folder
find foldername -type f | xargs sed -i 's/old_string/new_string/g'
@nkgokul
nkgokul / drupal_upgrade_status_to_csv
Created February 23, 2015 14:23
Export the Module Upgrade status(as a CSV file) when using Garland as admin theme
var finalString = '';
jQuery(".upgrade-status .project").each(function(){;
var title = jQuery("span.project-title a",this).text();
var moduleLink = jQuery("span.project-title a",this).attr("href");
var modulecode = jQuery("span.project-title a",this).attr("href").split("/").pop();
var status = jQuery("div.version-status:nth-child(1)",this).text();
var release = jQuery("div.versions .version-details a",this).text();
var link = jQuery("div.versions .version-details a",this).attr("href");
finalString += title + ',' + status + ',' + release + ',' + link + ',' + moduleLink + ',' + modulecode+'\n';
//console.log(title + ',' + status + ',' + release + ',' + link);
@nkgokul
nkgokul / drupal_quick_siteinstall
Created February 23, 2015 10:52
Drupal Quick site install
drush dl drupal-6 --drupal-project-rename=drupal6
cd drupal6
drush si --db-url=mysql://root:@localhost/drupal6
@nkgokul
nkgokul / drushqueryfromdrupalxray
Created February 23, 2015 08:53
Drush query from drupalxray
var drushString = "drush en --y ";
jQuery(".xray-site-modules ul li a").each(
function(){
var url = jQuery(this).attr("href");
var lastPart = url.split("/").pop();
drushString += lastPart + " ";
}
);
console.log(drushString);
@nkgokul
nkgokul / drupalxraytosimplytestme
Created February 23, 2015 08:45
Generate a link to SimplyTest.me from DrupalXray.com
var generateString = "http://simplytest.me/project/drupal/";
var drupalVersionString = jQuery(".xray-site div.xray-site-info:nth-child(3)").text();
var drupalVersion = drupalVersionString.split(": ").pop();
generateString += drupalVersion + "?";
jQuery(".xray-site-modules ul li a").each(
function(){
var url = jQuery(this).attr("href");
var lastPart = url.split("/").pop();
generateString += "add[]=" + lastPart + "&";
}
@nkgokul
nkgokul / drush_diesable_non_core_modules
Created February 19, 2015 15:28
Drush disable non core module - Useful for debugging
drush pml --no-core --type=module --status=enabled --pipe | xargs drush -y dis
@nkgokul
nkgokul / git_commit_only_modified files
Created February 19, 2015 09:50
Git commit only modified files
git ls-files --modified
!! | git add
@nkgokul
nkgokul / gist:c38731caa5bc17ecc779
Created February 19, 2015 06:58
Drush List all enabled non core module in comma separated format.
drush pml --type=Module --status=Enabled --no-core --pipe | paste -s -d,