Skip to content

Instantly share code, notes, and snippets.

Avatar

keopx keopx

View GitHub Profile
View gist:8569316a0661e41264a3cc9e0c4da961
# 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 Jan 15, 2018 — 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.
View XPS-15 9560 Getting Nvidia To Work on KDE Neon
# 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 Dec 2, 2017
Alter routes options and requirements
View JwtRouteSubscriber.php
<?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 Nov 2, 2017
drush sql-drop --default-file
View drush_sql-drop.sh
drush sql-drop --default-file
@keopx
keopx / win_linux_dual_boot_xps_15_9560.md
Created Oct 21, 2017 — forked from spenserlee/win_linux_dual_boot_xps_15_9560.md
Personal notes for dual booting Windows and Linux on XPS 15 9560
View win_linux_dual_boot_xps_15_9560.md

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 Oct 16, 2017
Drupal - Bash shell script to fix Drupal permissions
View fix-drupal-permissions.sh
#!/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
View varnish-purge-cache.sh
# Purge all Varnish cache
varnishadm "ban req.url ~ /"
@keopx
keopx / Deflate.md
Last active Sep 27, 2017
Compresion
View Deflate.md
@keopx
keopx / ImageStyleGenerator.php
Created Sep 1, 2017
Drupal 8 generate image style
View ImageStyleGenerator.php
<?php
/**
* Create images with timeline ImageStyle.
*/
protected function createImages() {
$style = ImageStyle::load('timeline');
$style_extra = ImageStyle::load('timeline_extra');
$nodes = $this->getNodes();
foreach ($nodes as $node) {