Skip to content

Instantly share code, notes, and snippets.

View renchap's full-sized avatar

Renaud Chaput renchap

View GitHub Profile

Keybase proof

I hereby claim:

  • I am renchap on github.
  • I am renchap (https://keybase.io/renchap) on keybase.
  • I have a public key ASDLBkDn1_rWkVXFxFwPi0pJqUlxM-PB9VDg-OHbGvd4sAo

To claim this, I am signing this object:

@renchap
renchap / shrine_concat_test.rb
Created August 31, 2016 11:25
shrine_concatenation
class ImageParts << ActiveRecord::Base
include PartUploader[:file]
belongs_to :image
end
class Image << ActiveRecord::Base
include ImageUploader[:file]
has_many :image_parts
[...]
@renchap
renchap / README.md
Last active September 24, 2024 14:39
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 {
### Keybase proof
I hereby claim:
* I am renchap on github.
* I am renchap (https://keybase.io/renchap) on keybase.
* I have a public key whose fingerprint is 1472 7DB9 0955 2EE8 8263 20C6 78AB 8C20 FBA2 CD92
To claim this, I am signing this object:
form = new FormData()
form.append('character[name]', name)
form.append('character[year]', year)
$.ajax(
url: $(e.currentTarget).data('post-url')
dataType: 'json'
type: 'patch'
data: form
).done (data) ->
console.log data
@renchap
renchap / nodes_stats.rb
Created October 1, 2013 15:49
Summarize the hardware resources for a set of chef nodes
# hostname patters to search
patterns=["a-search*", "b-search*"]
TERA_SIZE = 1073741824.0*1024
GIGA_SIZE = 1073741824.0
MEGA_SIZE = 1048576.0
KILO_SIZE = 1024.0
# Return the file size with a readable style.
def human_size(size, precision=3)
From ec2fc33bd8404699bebe7170e0e65d558185f29e Mon Sep 17 00:00:00 2001
From: Renaud Chaput <[email protected]>
Date: Wed, 18 Feb 2009 21:04:40 +0100
Subject: [PATCH] Cosmetic changes to character page
---
app/controllers/characters_controller.rb | 2 +-
app/views/changes/_change.html.haml | 3 +-
app/views/characters/show_valid.html.haml | 36 +++++++++++++++++------------
public/stylesheets/sass/general.sass | 10 ++++++++