Skip to content

Instantly share code, notes, and snippets.

View davidjguru's full-sized avatar
🍅
Working within a pomodoro cycle

David Rodriguez davidjguru

🍅
Working within a pomodoro cycle
View GitHub Profile
@davidjguru
davidjguru / SQLite - Fast install Basic packages
Created June 26, 2018 10:33
SQLite - Fast install Basic packages in Ubuntu
sudo apt-get install sqlite3 sqlite3-doc libsqlite3-dev
## looking for a package within the system
rpm -aq | grep packagename
## looking for a package in the repo
yum search package
## uninstall packages
yum erase package
## Apache restart
@davidjguru
davidjguru / delete_content_entities.d8.php
Created September 25, 2018 08:17 — forked from Jaesin/delete_content_entities.d8.php
Delete all content entities in Drupal 8.
<?php
// Delete all nodes.
entity_delete_multiple('node', \Drupal::entityQuery('node')->execute());
// Delete all files.
entity_delete_multiple('file', \Drupal::entityQuery('file')->execute());
// Delete all taxonomy terms.
entity_delete_multiple('taxonomy_term', \Drupal::entityQuery('taxonomy_term')->execute());
@davidjguru
davidjguru / . bashrc - Basic Example
Created November 16, 2018 13:36
Basic Example of a .bashrc file within a system to work with Drupal
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
@davidjguru
davidjguru / Getting_Clones
Last active November 29, 2018 21:50
Getting clones from backup folder
# Get the newest copy
ls -t |head -n1
# Get the oldest copy
ls -tr |head -n1
@davidjguru
davidjguru / File_by_Vim_As_Root
Created November 26, 2018 11:40
Writing in a file by vim as root
:w !sudo tee %
@davidjguru
davidjguru / Getting List of Drupal Modules with Drush
Last active November 27, 2018 10:04
Get a List with all the Drupal modules with Drush
drush8 pm-list
drush8 pm-list --status="enabled" --pipe
drush8 pm-list --status="disabled" --pipe
drush8 pm-list --type=module --status=enabled --no-core
@davidjguru
davidjguru / Table.php
Created December 6, 2018 23:51 — forked from chx/Table.php
Plain table migration source plugin
<?php
namespace Drupal\sd8_migration\Plugin\migrate\source;
use Drupal\migrate\Plugin\migrate\source\SqlBase;
/**
* Table source from database.
*
@davidjguru
davidjguru / changes_to_folder_with_git.txt
Created December 13, 2018 08:10
Take changes managed by Git from current folder a folder destiny. (Useful for config .yml files in Drupal)
git status . | xargs cp -t /path/to/folder/destiny
@davidjguru
davidjguru / creating_nodes_with_drupal_console.txt
Created December 14, 2018 07:23
Creating nodes with Drupal Console (Module Devel Generate style)
drupal create:nodes content-name --limit="6" --title-words="2" --time-range="10" --language="und"
# It will ask about language by prompt