Skip to content

Instantly share code, notes, and snippets.

View crazyrohila's full-sized avatar
🏠
Working from home

Sanjay Rohila crazyrohila

🏠
Working from home
View GitHub Profile
@crazyrohila
crazyrohila / mini_pingdom
Last active August 29, 2015 14:23
Mini Pingdom
#! /bin/bash
RESO=`/usr/bin/curl -sI https://www.drupal.org | head -n 1 | awk -F " " '{print $2}'`
if [ $RESO -eq 200 ]
then
echo "All is well!!!"
else
echo "Hey!!! get to work, immediately" | mail -s "Hey! your site is down; better get to work" [email protected]
fi
@crazyrohila
crazyrohila / restore_db.sh
Created May 3, 2015 10:33
Rackspace-Cloud-DB-Restore-Script
#! /bin/bash
# Variables
rack_space_host=XXX.rackspaceclouddb.com
rack_space_user=abc
rack_space_pass=efg
rack_space_db=DB_Name
if [ -d $1 ]
then
@crazyrohila
crazyrohila / backup_db.sh
Created May 3, 2015 10:31
Rackspace-Cloud-DB-Backup-Script
#! /bin/bash
# Variables
# Replace values with Rackspace credentials.
rack_space_host=XXX.rackspaceclouddb.com
rack_space_user=abc
rack_space_pass=efg
rack_space_db=DB_Name
# Pick current time.
@crazyrohila
crazyrohila / d8_quick_rebuild.sh
Last active August 29, 2015 14:17
D8_rebuild.sh to rebuild installation
#! /bin/bash
# Few command to re-install fresh D8 after new changes pulled.
# Replace <sql_user> & <password>.
# @params $1 DB Name.
# Run this script within D8 root folder and with sudo permission
rm sites/default/settings.php;
cp sites/default/default.settings.php sites/default/settings.php;
chmod 777 sites/default/settings.php;
mysqladmin -u<sql_user> -p<password> drop -f $1;
Verifying that +crazyrohila is my openname (Bitcoin username). https://onename.com/crazyrohila
@crazyrohila
crazyrohila / d8-remove-css.info.yml
Last active August 29, 2015 14:16
[Drupal-8] Remove core's css
name: D8 custom theme
type: theme
description: 'D8 custom theme'
package: Custom
core: 8.x
stylesheets-remove:
- system.theme.css
@crazyrohila
crazyrohila / d8-override-css.info.yml
Last active August 29, 2015 14:16
[Drupal-8] Override core's css
name: D8 custom theme
type: theme
description: 'D8 custom theme'
package: Custom
core: 8.x
# Override core css files by adding css file with same name in our theme.
# user.icons.css file in css folder of this theme will override core user module's css.
stylesheets-override:
- css/user.icons.css
@crazyrohila
crazyrohila / d8-regions-hidden.info.yml
Last active August 29, 2015 14:16
[Drupal-8] Define hidden regions
name: D8 custom theme
type: theme
description: 'D8 custom theme'
package: Custom
core: 8.x
# Define Hidden Regions
regions_hidden:
- hidden_region
@crazyrohila
crazyrohila / d8-regions.info.yml
Last active August 29, 2015 14:16
[Drupal-8] Defining regions
name: D8 custom theme
type: theme
description: 'D8 custom theme'
package: Custom
core: 8.x
# Define Regions
regions:
content: Content
header: 'Header'
sidebar_first: 'First sidebar'
@crazyrohila
crazyrohila / d8-adding-css.info.yml
Last active August 29, 2015 14:16
[Drupal-8] Adding css in theme
# See https://gist.github.com/crazyrohila/03a3a1f065e78515a3b0 for other information about theme's info file
name: D8 custom theme
type: theme
description: 'D8 custom theme'
package: Custom
core: 8.x
# Add libraries/css/js
libraries:
- d8/themey