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
vendor
composer.lock
upstream foo_app {
server 127.0.0.1:3000;
}
server {
listen 80;
# listen [::]:80 default_server ipv6only=on;
root /home/user/foo/foo_web/public;
#!/usr/bin/env php
<?php
/*
Copyright 2013 Stuart Carnie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
@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 {
# 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 / 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
@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 / 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 / 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 / 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