Skip to content

Instantly share code, notes, and snippets.

View keopx's full-sized avatar

Ruben Egiguren keopx

View GitHub Profile
@keopx
keopx / recovery_kerner.sh
Created December 23, 2014 15:31
Recover kernel on boot system with raid and LVM
mount /dev/mapper/vg0-root /mnt
mount /dev/md0 /mnt/boot
mount /dev/mapper/vg0-var /mnt/var
mount /dev/mapper/vg0-data /mnt/data
mount -t dev -o bind /dev /mnt/dev
mount -t proc -o bind /proc /mnt/proc
mount -t sys -o bind /sys /mnt/sys
chroot /mnt
@keopx
keopx / drupal-8.x_module.sh
Created December 25, 2014 13:10
How to create a #drupal8 module
curl -LSs http://drupalconsole.com/installer | php
mv console.phar /usr/local/bin/drupal
drupal generate:module
@keopx
keopx / Revert_last_remote_commit
Created January 14, 2015 09:51
Revert last remote commit
git reset --hard HEAD~1
git push -f
@keopx
keopx / fucking_sudo.sh
Created January 27, 2015 09:34
Fucking sudo
echo "alias fucking=sudo" >> ~/.bashrc # The best alias you'll ever use. Think of the possibilities "fucking reboot"
@keopx
keopx / bash_color.sh
Created February 9, 2015 08:47
Bash prompt colors
# Reset
Color_Off="\[\033[0m\]" # Text Reset
# Regular Colors
Black="\[\033[0;30m\]" # Black
Red="\[\033[0;31m\]" # Red
Green="\[\033[0;32m\]" # Green
Yellow="\[\033[0;33m\]" # Yellow
Blue="\[\033[0;34m\]" # Blue
Purple="\[\033[0;35m\]" # Purple
@keopx
keopx / bash_prompt_git.sh
Created February 9, 2015 08:50
Bash prompt with git
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w\[\033[1;37m\]$(__git_ps1) \[\033[01;35m\]\$ \[\033[00m\]'
<?php
/**
* Implement of drush_hook_COMMAND_validate().
*
* Prevent catastrophic sql-sync to live. Note that this file has to be local to the
* machine that intitiates sql-sync command.
*/
function drush_policy_sql_sync_validate($source = NULL, $destination = NULL) {
if (strstr($destination, '.prod')) {
@keopx
keopx / doc2odt.sh
Created February 27, 2015 12:34
Convertir muchos documentos de DOC a ODT y otros formatos
#Convertir muchos documentos de DOC a ODT y otros formatos:
libreoffice --invisible --convert-to odt *.doc
@keopx
keopx / demo_deploy.install.php
Last active October 27, 2015 02:00
Drupal Deploy process using hook_update_N on custom module for deploy
function demo_deploy_update_7001() {
# Reverting a feature should not be done in the visual interface
# or using drush fr, but should rather be done in the hook_update_n().
# To determine the component name (example views_view), make sure you are
# using version 2.x of Features, and visit the page for your features.
# In parentheses you will see the machine name for each component.
features_revert(array(
'demo_feature' => array(
'views_view',
),
#!/bin/bash
docker stop `docker ps -aq`
docker rm `docker ps -aq`
docker rmi `docker images -aq`