Skip to content

Instantly share code, notes, and snippets.

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

Laurent Declercq nuxwin

🏠
Working from home
View GitHub Profile
=pod
Here is a list of CPAN distributions which B<may> have external Makefiles.
I have not built or used any of these, so your mileage may vary.
=cut
my %distros = {
"$CPAN/authors/id/A/AG/AGENT/Lemplate-0.15.tar.gz" => { "doc/Makefile" => 1, "src/Makefile" => 1 },
@nuxwin
nuxwin / Application\Service\MemcachedStorageFactory.php
Created April 23, 2018 22:46 — forked from dkemper/Application\Service\MemcachedStorageFactory.php
Zend Framework 2 - Session Memcached Configuration with Failover
<?php
namespace Application\Service;
use Zend\Cache\Storage\Adapter\MemcachedOptions;
use Zend\Cache\Storage\Adapter\MemcachedResourceManager;
use Zend\Cache\StorageFactory;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\Session\SaveHandler\Cache;
@nuxwin
nuxwin / gnome-tracker-disable.md
Created April 5, 2018 14:32 — forked from vancluever/gnome-tracker-disable.md
GNOME Tracker Disable

Disabling GNOME Tracker and Other Info

GNOME's tracker is a CPU and privacy hog. There's a pretty good case as to why it's neither useful nor necessary here: http://lduros.net/posts/tracker-sucks-thanks-tracker/

After discovering it chowing 2 cores, I decided to go about disabling it.

Directories

@nuxwin
nuxwin / gist:049bae4bdad2fe1dddd8d61ea4b2b084
Created October 11, 2017 18:53 — forked from discordier/gist:ed4b9cba14652e7212f5
options for phpStorm @noinspection annotation
javascript
ES6ValidationInspection
JSAccessibilityCheckInspection
JSBitwiseOperatorUsageInspection
JSCheckFunctionSignaturesInspection
JSClosureCompilerSyntaxInspection
JSCommentMatchesSignatureInspection
JSComparisonWithNaNInspection
JSConsecutiveCommasInArrayLiteralInspection
@nuxwin
nuxwin / mojo_chat.pl
Created June 18, 2017 00:22 — forked from jberger/mojo_chat.pl
Mojolicious chat example
#!/usr/bin/env perl
use Mojolicious::Lite;
# storage
my $clients = {};
# helpers (methods on app/controller/template)
helper 'send_to_all' => sub {
my ($self, $message) = @_;
@nuxwin
nuxwin / mbox-count.py
Created May 28, 2017 23:29 — forked from greencm/mbox-count.py
Count the number of messages in an mbox file
#!/usr/bin/env python
# $Id$
# Author: <cmgreen@uab.edu>
# Purpose: Count the number of mails in an mbox file
# Created: Fri Jun 28 10:39:13 CDT 2013
import sys
from mailbox import mbox
import re
@nuxwin
nuxwin / gpg.md
Created March 28, 2017 00:09 — forked from LauLaman/gpg.md
Use GPG to sign commits using git & PHPStorm

1 - install GPG tools : https://gpgtools.org/

2 - Create new key for your github email

3 - Add key to git on your local machine: git config --global user.signingkey YOURKEY

4 - configure git to sign all commits: git config --global commit.gpgsign true

5 - add to the bottom of ~/.gnupg/gpg.conf:

@nuxwin
nuxwin / busyroot.sh
Created August 13, 2016 23:33 — forked from weakish/busyroot.sh
#sh script to set up a #chroot #busybox #ssh environment
#!/bin/sh
# by Jakukyo Friel <weakish@gmail.com> under GPL v2.
### Set up a chroot busybox SSH environment
## requires
# wget -- to download pubkey and busybox
# sharutils -- to generate random password
## Config
# i-MSCP Listener::Named::NotifySecondary listener file
# Copyright (C) 2016 Marc Pujol <kilburn@la3.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@nuxwin
nuxwin / README.md
Created April 12, 2016 22:51 — forked from renchap/README.md
One-line certificate generation/renews with Letsencrypt and nginx

Prerequisites : the letsencrypt CLI tool

This method allows your to generate and renew your Lets Encrypt certificates with 1 command. This is easily automatable to renew each 60 days, as advised.

You need nginx to answer on port 80 on all the domains you want a certificate for. Then you need to serve the challenge used by letsencrypt on /.well-known/acme-challenge. Then we invoke the letsencrypt command, telling the tool to write the challenge files in the directory we used as a root in the nginx configuration.

I redirect all HTTP requests on HTTPS, so my nginx config looks like :

server {