Skip to content

Instantly share code, notes, and snippets.

View dunmaksim's full-sized avatar
🏠
Working from home

Dunaevsky Maxim dunmaksim

🏠
Working from home
View GitHub Profile
echo "Sign NVIDIA and ORACLE kernel modules for using them with EFI mode in Debian Linux"
VERSION="$(uname -r)"
SHORT_VERSION="$(uname -r | cut -d . -f 1-2)"
MODULES_DIR=/lib/modules/${VERSION}
KBUILD_DIR=/usr/lib/linux-kbuild-${SHORT_VERSION}
cd "${MODULES_DIR}/updates/dkms"
for i in *.ko ; do
echo "Signing file ${i}"
sudo "${KBUILD_DIR}"/scripts/sign-file sha256 /root/MOK.priv /root/MOK.der "$i"
@dunmaksim
dunmaksim / startup.js
Created October 1, 2017 18:10
Dojo Toolkit "inherited" with JS strict mode
require([
"dojo/_base/declare",
"dijit/_WidgetBase"
], function (declare){
"use strict";
return declare("WidgetClass", _WidgetBase, {
startup: function startup(){
this.inherited({
callee: startup
}, arguments);
@dunmaksim
dunmaksim / loader.js
Last active September 26, 2017 17:24
Dojo Toolkit with CSRF Token from cookies at any request
require([
"dojo/request/notify",
"dojo/cookie",
"dojo/domReady!"
], function (notify, cookie) {
notify("send", function (response, cancel) {
response.xhr.setRequestHeader('X-CSRFToken', cookie("csrftoken"));
});
});