Skip to content

Instantly share code, notes, and snippets.

keopx keopx

View GitHub Profile
@keopx
keopx / gpg-import-and-export-instructions.md
Created Jan 15, 2019 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys
View gpg-import-and-export-instructions.md

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
# or, instead of backing up trustdb...
@keopx
keopx / gist:c059cf76ec46799c90a7cf29d43eb0d4
Created Dec 4, 2018 — forked from mrconnerton/gist:1979037
node form in ctools modal drupal 7
View gist:c059cf76ec46799c90a7cf29d43eb0d4
<?php
/*
Make Sure you include:
ctools_include('modal');
ctools_modal_add_js();
On the pages you put your link.
*/
@keopx
keopx / phpcs.xml.dist
Created Sep 13, 2018
drupal: /core/phpcs.xml.dist
View phpcs.xml.dist
Reworked the script to use XML instead. This works a lot better. I do have to edit the XML file to remove some invalid characters such as EOL characters which end up in the XML file.
If you install PHP CodeSniffer and the ruleset using the instructions from #10, you can then generate the coding standards report with:
$ ./modules/coder/vendor/bin/phpcs --standard=phpcs.xml --extensions=css,inc,info,install,js,module,php,profile,test,theme --ignore=core/vendor,core/assets/vendor --report=xml core/ > report.xml
You'll need to edit the XML to remove a couple of illegal characters, then finally generate the phpcs.xml file:
$ ./phpcs-generate.php report.xml > phpcs.xml
@keopx
keopx / 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 )
View XPS-15 9560 Getting Nvidia To Work on KDE Neon
# 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
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 / fix-drupal8-permissions.sh
Created Nov 7, 2017 — forked from GreenSkunk/fix-drupal8-permissions.sh
Drupal - Bash shell script to fix Drupal 8 permissions where the PHP Handler is FastCGI.
View fix-drupal8-permissions.sh
#!/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 / 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

You can’t perform that action at this time.