Skip to content

Instantly share code, notes, and snippets.

View johnwilson's full-sized avatar

John Wilson johnwilson

  • Infinite Blue Technologies
  • GH
View GitHub Profile
@johnwilson
johnwilson / qor-admin-view-templates.md
Created March 25, 2021 13:18
Get Latest version of Qor Admin View Templates

Qor Admin templates need to be in the following path of your project directory app/views/qor. This helps if you're using modules.

Use the following bash commands:

mkdir -p app/views
git clone https://github.com/qor/admin.git app/views
find app/views -mindepth 1 ! -regex '^app/views/views\(/.*\)?' -delete
mv app/views/views app/views/qor
@johnwilson
johnwilson / flynn-online-net-install.sh
Created November 30, 2019 15:18
Install Flynn PaaS on Online.net bare metal server
#!/usr/bin/env bash
#===========================================================
#
# Run this command:
#
# sudo SERVERS="Space separated list of IPs" bash install.sh
#
#===========================================================
@johnwilson
johnwilson / fix.wkhtmltopdf.odoo.snippetbucket.erp.open.source.seo.sh
Created November 8, 2018 10:44 — forked from tejastank/fix.wkhtmltopdf.odoo.snippetbucket.erp.open.source.seo.sh
Wkhtmltopdf failed (error code: -6). Message: The switch --header-spacing, is not support using unpatched qt, and will be ignored.The switch --header-html, is not support using unpatched qt, and will be ignored.The switch --footer-html, is not support using unpatched qt, and will be ignored.QXcbConnection: Could not connect to display. # https:/…
# https://www.snippetbucket.com/
# ODOO ERP Django PHP Android AngularJS implementation and customization.
# Most Simple and Quick Way:
cd /opt/
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
tar vxf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
cp wkhtmltox/bin/wk* /usr/local/bin/
And you can confirm with:
@johnwilson
johnwilson / setup-avahi.sh
Created May 14, 2018 10:46 — forked from davisford/setup-avahi.sh
Setup avahi-daemon on Ubuntu for so you can reach hostname `ubuntu.local` from host OS
sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan
/**
* Sample of serverside generation of Highcharts using an extension to jsdom in node.js.
*
* Usage:
* npm install jsdom
* npm install highcharts
* node highcharts-jsdom
*/
/* eslint-env node */
/**
* Sample of serverside generation of Highcharts using an extension to jsdom in node.js.
*
* Usage:
* npm install jsdom@v7.2.2 && npm install highcharts
* node highcharts-jsdom
*/
/* eslint-env node */
/* eslint no-console: 0 */
@johnwilson
johnwilson / simple-pagination.js
Created May 2, 2018 13:17 — forked from kottenator/simple-pagination.js
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@johnwilson
johnwilson / remove-plugin.js
Created March 21, 2018 18:30
Remove JQuery Plugin from DOM element
/*-----------------------------------------------------------
| Original author:
| * http://ub4.underblob.com/remove-jquery-plugin-instance/
------------------------------------------------------------*/
var destroyPlugin = function($elem, eventNamespace) {
// check if plugin has a namespace
var isInstantiated = !! $.data($elem.get(0));
if (isInstantiated) {
@johnwilson
johnwilson / gpg-import-and-export-instructions.md
Created January 12, 2018 09:28 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

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...

#!/bin/bash
set -e
cd /tmp
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-2.2.tar.gz
tar -xzf setuptools-2.2.tar.gz
cd setuptools-2.2
sudo jython27 setup.py install --prefix=/opt/jython27