Skip to content

Instantly share code, notes, and snippets.

View dasbairagya's full-sized avatar
🎯
Focusing

Gopal Dasbariagya dasbairagya

🎯
Focusing
View GitHub Profile
@dasbairagya
dasbairagya / index.odt
Last active August 21, 2019 08:42
#Generate SSH Key | Linux
👉️Create SSH key-------------
📌️ cd .ssh/
📌️ ssh-keygen
📌️ hit enter threesies
📌️ to copy the key run cat id_rsa.pub
📌️ add the ssh key to the server as public key
@dasbairagya
dasbairagya / README.md
Last active July 24, 2021 09:26
🎗️ Drupal 8 theming from scratch 🎗️

Simple bootstrap based theme

👉️ Steps:

  • Install drupal via composer
    composer create-project drupal-composer/drupal-project:8.x-dev my_site_name_dir --no-interaction
  • Create a virtual host for the same.
@dasbairagya
dasbairagya / xdebug.pdo
Last active August 21, 2019 08:43
#Enable php-xdebug | Linux
👉️sudo apt-get install php-xdebug
👉️sudo nano etc/php/7.2/apache2/php.ini
add xdebug.remote_enable=on
👉️xdebug.remote_enable=on
👉️sudo service apache2 restart
@dasbairagya
dasbairagya / admin-reset.php
Created May 13, 2019 06:47
Drupal admin(uid = 1) password reset hack
<?php
use Drupal\Core\DrupalKernel;
use Symfony\Component\HttpFoundation\Request;
if (pathinfo(__FILE__, PATHINFO_FILENAME) == 'admin-pass-reset') {
die('Please change your file name to a random string to continue');
}
// Boot Drupal.
@dasbairagya
dasbairagya / setup.odt
Last active August 21, 2019 08:41
#Drupal project setup with git | virtual host | Ubuntu
👉️Project Setup-------------
📌️ sudo chmod -R 755 /var/www/html/
📌️ sudo chown -R $USER:www-data /var/www/html/
📌️ navigate to the html folder and create a dirctory(e.g imc)
📌️ run the clone command via git (e.g. git clone --branch dev-test [email protected]:w3rwonat5hdu2.git ingrammicrocloud)
📌️ add settings.local.php to the /web/site/default directory and change the database & credentials
📌️ create database and upload .sql file from the terminal using source command
📌️ run composer install command
📌️ run drush cache rebuild command from /web directory (../vendor/bin/drush cr)
📌️ git pull origin master [To fetch the master branch].
@dasbairagya
dasbairagya / Lamp Install Ubuntu 18.04.odt
Last active August 21, 2019 08:45
#Lamp Installation | Ubuntu
1)👉️Install Apache:
I. sudo apt update
II. sudo apt install apache2
III. sudo ufw allow 'Apache Full'
IV. sudo service apache2 restart
2)👉️Install Php
I. add-apt-repository ppa:ondrej/php
II. apt-get update
III. apt-get install php7.2
@dasbairagya
dasbairagya / commands.odt
Last active August 11, 2019 15:22
Some useful Linux commands
USEFULL COMMANDS-------------------------------------------------
😎️ man ls [to get the all info with the ls command]
q [ to quit the man command]
🤔️ gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize' [ minimize item on click from dock menu]
🤩️ ln -s /opt/lampp/htdocs ./Desktop [create soft link-shortcut of htdocs to desktop]
🤔️ gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize' [ minimize item on click from dock menu]
👉️third party directory: /etc & /usr/share
👉️Lamp Service Commands-------------
📌️ sudo systemctl status apache2
@dasbairagya
dasbairagya / Export.php
Created February 2, 2019 07:24
SQL format is missing in phpmyadmin while exporting table
Go to xampp>phpMyadmin>libraries>classes>Display>Export.php
then find /* Scan for plugins */
then add the flowing text above the line mentioned in previous step
//Export a single table
if(isset($_GET['single_table'])){
$GLOBALS['single_table'] = $_GET['single_table'];
}
@dasbairagya
dasbairagya / functions.php
Created December 27, 2018 06:47
overwrite nav-menu attribute
add_filter( 'nav_menu_link_attributes', function ( $atts, $item, $args ) {
if ( 802 === $item->ID ) { // change 1161 to the ID of your menu item.
if(is_front_page() || is_home()){
$atts['href'] = '#dine-in-menu';
$atts['target'] = '';
}
else{
$atts['href'] = home_url('/#dine-in-menu');
$atts['target'] = '';
Seller Account Details:
[email protected]
Apnapakistan1
Main Admin Details:
admin
Apnapakistan1