Skip to content

Instantly share code, notes, and snippets.

View nkgokul's full-sized avatar

Gokul N K nkgokul

View GitHub Profile
@nkgokul
nkgokul / linux_list_all_folders_within_current_foler
Created February 19, 2015 06:53
List of all modules folders within the current folder
find . -name "*.info" -exec basename \{} .info \; | paste -s -d,
@nkgokul
nkgokul / virtualhosts
Created February 19, 2015 06:19
List all Virtual Hosts for Apache2 on Ubuntu
apache2ctl -S
drush en --y admin_menu admin_views ckeditor context entityreference features module_filter reldate strongarm pathauto globalredirect chosen devel eazylaunch date admin_menu_toolbar
drush ckeditor-download
drush chosenplugin
drush dis toolbar
drush cc all
@nkgokul
nkgokul / github_webhook.php
Last active August 29, 2015 14:13
Sanity check for Github Webhook
<?php
//Github sanity check
$secret = 'my_secret_entered_on_webhook_settings_page';
$headers = getallheaders();
$hubSignature = $headers['X-Hub-Signature'];
list($algo, $hash) = explode('=', $hubSignature, 2);
$payload = file_get_contents('php://input');
$data = json_decode($payload);
$payloadHash = hash_hmac($algo, $payload, $secret);