Skip to content

Instantly share code, notes, and snippets.

View keopx's full-sized avatar

Ruben Egiguren keopx

View GitHub Profile
@keopx
keopx / fix-drupal8-permissions.sh
Created November 7, 2017 08:37 — forked from GreenSkunk/fix-drupal8-permissions.sh
Drupal - Bash shell script to fix Drupal 8 permissions where the PHP Handler is FastCGI.
#!/bin/bash
path=${1%/}
user=${2}
group=${2}
help="\nHelp: This script is used to fix permissions of a Drupal 8 installation in which the PHP Handler is FastCGI\nYou need to provide the following arguments:\n\t 1) Path to your drupal installation\n\t 2) Username of the user that you want to give files/directories ownership\n\nNote: This script assumes that the group is the same as the username if your PHP is compiled to run as FastCGI. If this is different you need to modify it manually by editing this script or checking out forks on GitHub.\nUsage: bash ${0##*/} drupal_path user_name\n"
echo "Refer to https://www.Drupal.org/node/244924"
@keopx
keopx / XPS-15 9560 Getting Nvidia To Work on KDE Neon
Created May 30, 2018 15:54 — forked from gggauravgandhi/XPS-15 9560 Getting Nvidia To Work on KDE Neon
[XPS 15 Early 2017 9560 kabylake] Making Nvidia Drivers + (CUDA 8 / CUDA 9 / CUDA 9.1) + Bumblebee work together on linux ( Ubuntu / KDE Neon / Linux Mint / debian )
# Instructions for 4.14 and cuda 9.1
# If upgrading from 4.13 and cuda 9.0
$ sudo apt-get purge --auto-remove libcud*
$ sudo apt-get purge --auto-remove cuda*
$ sudo apt-get purge --auto-remove nvidia*
# also remove the container directory direcotory at /usr/local/cuda-9.0/
# Important libs required with 4.14.x with Cuda 9.X
$ sudo apt install libelf1 libelf-dev
# perform a fresh install of Ubuntu 17.10
# upgrade the kernel to v4.13.10
mkdir ~/kernel-v4.13.10
cd ~/kernel-v4.13.10
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310_4.13.10-041310.201710270531_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-image-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb
sudo dpkg -i *.deb
@keopx
keopx / XPS-15 9560 Getting Nvidia To Work on KDE Neon
Created January 15, 2018 16:20 — forked from whizzzkid/XPS-15 9560 Getting Nvidia To Work on KDE Neon
Making Nvidia Drivers + CUDA 8 + Bumblebee work together on XPS 15 Early 2017 9560 kabylake. Ubuntu, KDE Neon, Linux Mint, debian.
# Instructions for 4.13 and cuda 9.0 RC
# If upgrading from 4.11 and cuda 8.0
$ sudo apt-get purge --auto-remove libcud*
$ sudo apt-get purge --auto-remove cuda*
$ sudo apt-get purge --auto-remove nvidia*
# also remove the container directory direcotory at /usr/local/cuda-8.0/
# Install Intel Graphics Patch Firmwares (This should reboot your system):
bash -c "$(curl -fsSL http://bit.ly/IGFWL-install)"
@keopx
keopx / JwtRouteSubscriber.php
Created December 2, 2017 09:43
Alter routes options and requirements
<?php
namespace Drupal\my_module\Routing;
use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;
/**
* Listens to the dynamic route events.
*/
@keopx
keopx / drush_sql-drop.sh
Created November 2, 2017 12:09
drush sql-drop --default-file
drush sql-drop --default-file
@keopx
keopx / win_linux_dual_boot_xps_15_9560.md
Created October 21, 2017 06:53 — forked from spenserlee/win_linux_dual_boot_xps_15_9560.md
Personal notes for dual booting Windows and Linux on XPS 15 9560

Installing Ubuntu GNOME 17.04 on XPS 15 9560

This document is to serve as a set of notes for myself and can be used as a guide for others looking to set up Ubuntu on their XPS 15. For me this was a dual-boot setup with Windows 10. On Linux I don't have a need for the discrete graphics card, so the main focus is to maximize battery life for development.

I had initially tried to dual boot with Fedora 25, but ran into a lot of issues trying to disable the discrete graphics card, resulting in poor battery life. Instead of starting over with Fedora again, I decided to try with Ubuntu, since there seemed to be a few more resources available.

My XPS Configuration is: i7, 16GB RAM, 512GB SSD, 4K Screen.

Setup

@keopx
keopx / fix-drupal-permissions.sh
Created October 16, 2017 13:31
Drupal - Bash shell script to fix Drupal permissions
#!/bin/bash
path=${1%/}
user=${2}
group="www-data"
help="nHelp: This script is used to fix permissions of a drupal installationnyou need to provide the following arguments:nt 1) Path to your drupal installationnt 2) Username of the user that you want to give files/directories ownershipnNote: "www-data" (apache default) is assumed as the group the server is belonging to, if this is different you need to modify it manually by editing this scriptnnUsage: (sudo) bash ${0##*/} drupal_path user_namen"
if [ -z "${path}" ] || [ ! -d "${path}/sites" ] || [ ! -f "${path}/modules/system/system.module" ]; then
echo "Please provide a valid drupal path"
echo -e $help
@keopx
keopx / varnish-purge-cache.sh
Created October 3, 2017 06:33 — forked from andrezrv/varnish-purge-cache.sh
Purge all Varnish cache.
# Purge all Varnish cache
varnishadm "ban req.url ~ /"
@keopx
keopx / Deflate.md
Last active September 27, 2017 12:24
Compresion