Skip to content

Instantly share code, notes, and snippets.

View Lewiscowles1986's full-sized avatar
🤓

Lewis Cowles Lewiscowles1986

🤓
View GitHub Profile
@Lewiscowles1986
Lewiscowles1986 / stage1.sh
Last active October 13, 2017 17:53
OpenFAAS Wireless Setup Raspbian Stretch
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
# set the access point password
PWD=e2c5Fg_X0o!xne33
#!/bin/sh
pecl download mailparse
tar -xvf mailparse-3.0.2.tgz
cd mailparse-3.0.2/
phpize
./configure
sed -i 's/#if\s!HAVE_MBSTRING/#ifndef MBFL_MBFILTER_H/' ./mailparse.c
make
make test
@Lewiscowles1986
Lewiscowles1986 / git-clone-auto.js
Last active September 23, 2017 23:46
Git Clone Auto (per-page)
(function(username) {
const repos_css_Selector = '[itemprop*="codeRepository"]';
const git_clone_command_string = 'git clone git@github.com:';
return [].slice.call(
document.querySelectorAll(repos_css_Selector)
).map(function(val, idx) {
return git_clone_command_string+username+'/'+val.innerText;
}).join('\n');
})(document.querySelector(
@Lewiscowles1986
Lewiscowles1986 / jenkins.svg
Created September 19, 2017 17:42
JenkinsCI SVG Logo (Optimised)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Lewiscowles1986
Lewiscowles1986 / octoprint.service
Last active September 18, 2017 08:43
OctoPrint SystemD service
[Unit]
Description=OctoPrint
After=network.target
[Service]
ExecStart=/opt/OctoPrint/venv/bin/octoprint
Restart=always
[Install]
WantedBy=default.target
@Lewiscowles1986
Lewiscowles1986 / dh-diagram.svg
Last active November 16, 2021 06:22
SSH with asymmetric key UML Sequence
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Lewiscowles1986
Lewiscowles1986 / fix-virtualbox
Created September 7, 2017 16:30
Fix Virtualbox
#!/bin/bash
#
# Fix Kernel updates in Xenial breaking Virtualbox DKMS...
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
@Lewiscowles1986
Lewiscowles1986 / business-insider-fu.js
Created September 7, 2017 12:11
BusinessInsider FU
setInterval(function(){
[].slice.call(document.querySelectorAll('iframe, .fc-dialog-overlay, .fc-root.fc-dialog-container')).forEach(function(elem){
elem.remove();
document.body.className = document.body.style = "";
});
}, 1000);
@Lewiscowles1986
Lewiscowles1986 / middleware-year-monthly-breakdown.sql
Created September 2, 2017 09:02
Nice monthly breakdown SQL
/*
* Uses MySQL SQL Syntax
*/
SELECT
YEAR(O.`when`) as `year`,
MONTH(O.`when`) as `month`,
COUNT(O.id) as `Orders Passed`, CONCAT('$',(COUNT(O.id) * 2)) as `earned`
FROM middleware.order_link O
GROUP BY `year`, `month`
UNION
@Lewiscowles1986
Lewiscowles1986 / Dockerfile
Last active September 1, 2017 09:58
Libreoffice Docker
FROM ubuntu:16.04
MAINTAINER CD2 Team <codesign2@icloud.com>
ENV DEBIAN_FRONTEND noninteractive
RUN useradd -m libreoffice
ENV LIBREOFFICEPREFERREDMIRROR http://download.documentfoundation.org/libreoffice/stable/5.4.1/deb/x86_64/
ENV LIBREOFFICEPACKAGE LibreOffice_5.4.1_Linux_x86-64_deb.tar.gz