Skip to content

Instantly share code, notes, and snippets.

@nickels
nickels / webapp.py
Created August 6, 2019 21:24 — forked from cedbeu/webapp.py
Minimal Flask application - Basic single-file design pattern
#!/usr/bin/python
# coding: utf-8
from flask import Flask
app = Flask(__name__)
@app.route('/')
def entry_point():
return 'Hello World!'
@nickels
nickels / update-adblock-dnsmasq.sh
Created March 25, 2018 20:30 — forked from Ar0xA/update-adblock-dnsmasq.sh
USG DNS adblock/malwareblock
#!/bin/bash
#
#DNS adblock/malware block for USG
#
#Orginal script: https://community.ubnt.com/t5/UniFi-Routing-Switching/Use-USG-to-block-sites-apps-like-ER/td-p/1497045
#
#Howto: SSH into your USG:
#sudo su -
#vi /config/user-data/update-adblock-dnsmasq.sh (add file content)
#ESC :wq
@nickels
nickels / turn_all_off.lua
Created September 19, 2017 20:23 — forked from leeroybrun/turn_all_off.lua
Fibaro LUA scenes
--[[
%% autostart
%% properties
%% globals
--]]
NB_DEVICES = 300
function turnAllOff()
fibaro:debug('Turn all devices off.')
<?php
use Illuminate\Support\Facades\Auth;
use App\Http\Controllers\Controller;
class SomeController extends Controller
{
public function store()
{
$timesheet = request()->validate([
@nickels
nickels / laravel-forge-deploy.sh
Created August 1, 2017 10:37 — forked from rap2hpoutre/laravel-forge-deploy.sh
Laravel Forge deploy script without downtime
# stop script on error signal
set -e
# remove old deployment folders
if [ -d "/home/forge/deploy" ]; then
rm -R /home/forge/deploy
fi
if [ -d "/home/forge/backup" ]; then
rm -R /home/forge/backup
fi
@nickels
nickels / supervisor.md
Last active August 29, 2022 13:25
Supervisor sudoers setup
groupadd supervisor
usermod -a -G supervisor <myusername>

/etc/supervisor/supervisor.conf

[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0770                      ; socket file mode (default 0700)
chown=root:supervisor
@nickels
nickels / validation_rules.php
Last active May 20, 2017 09:06
Laravel | Date Validation Tricks
<?php
$this->validate($request, [
'start_date' => 'date_format:d/m/Y|after:tomorrow',
'end_date' => 'date_format:d/m/Y|after:start_date',
]);
@nickels
nickels / unifi_ssl_import.sh
Created August 6, 2016 21:16 — forked from stevejenkins/unifi_ssl_import.sh
Import and use SSL certificates (including Let's Encrypt) with the Ubiquiti UniFi Controller on Unix/Linux Systems
#!/usr/bin/env bash
# unifi_ssl_import.sh
# UniFi Controller SSL Certificate Import Script for Unix/Linux Systems
# by Steve Jenkins <http://www.stevejenkins.com/>
# Incorporates ideas from https://source.sosdg.org/brielle/lets-encrypt-scripts
# Version 2.2
# Last Updated June 26, 2016
# REQUIREMENTS
@nickels
nickels / openpgp.txt
Created May 1, 2016 18:25
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:e7c44d3d6cda9c0b53604c1ff5839e2f165a11a4]