Skip to content

Instantly share code, notes, and snippets.

View nrdufour's full-sized avatar

Nicolas R Dufour nrdufour

View GitHub Profile
@fl64
fl64 / docker-mod.yml
Created April 4, 2019 16:05
Ansible playbook for modifying /etc/docker/daemon.json config (based on https://stackoverflow.com/questions/50796341/add-a-new-key-value-to-a-json-file-using-ansible)
- hosts: all
become: yes
gather_facts: false
vars:
tasks:
- name: Check that the /etc/docker/daemon.json exists
stat:
path: /etc/docker/daemon.json
register: stat_result
@mosquito
mosquito / README.md
Last active May 4, 2024 12:42
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@davinkevin
davinkevin / MultipartFileSender
Created February 10, 2015 16:31
Implementing HTTP byte-range requests in Spring 4 and other framework...
package lan.dk.podcastserver.utils.multipart;
import lan.dk.podcastserver.utils.MimeTypeUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@boardstretcher
boardstretcher / install_fpm.sh
Last active October 4, 2019 02:15
Install FPM on centos 6.5
# install ruby, rubygems and all requirements, then install FPM (effing package manager)
# fpm: https://github.com/jordansissel/fpm
# as root
# update system, install requirements
yum update -y
yum install ruby-devel gcc curl libyaml-devel
# get the ruby version manager and install
curl -L get.rvm.io | bash -s stable
@BenMatheja
BenMatheja / gist:9230138
Last active May 24, 2023 05:00
mopidy port 80 proxy pass with nginx on raspberry pi
sudo apt-get update
sudo apt-get install nginx
sudo service nginx start
sudo vi /etc/nginx/sites-enabled/default
##### VI output, oder nano jenachdem mit was du die ändern willst ###
server {
#listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
@AlbertMoscow
AlbertMoscow / prime_factors.exs
Created July 10, 2013 09:50
The Prime Factors Kata implemented in elixir
defmodule PrimeFactors do
@moduledoc """
Inspired by Uncle Bob's algorithm:
http://butunclebob.com/ArticleS.UncleBob.ThePrimeFactorsKata
"""
@doc """
Функция generate/1 получает целое число в качестве параметра
и возвращает все простые делители этого числа в виде списка.
"""
@alertor
alertor / jira-behing-nginx-ssl
Last active April 27, 2023 15:45
Atlassian JIRA behind nginx + SSL
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf
server {
listen 80;
server_name jira.example.com;
access_log off;
return 301 https://$server_name$request_uri;
}
# /etc/nginx/conf.d/jira.conf
server {
@btoone
btoone / curl.md
Last active April 2, 2024 20:18
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@mtigas
mtigas / gist:952344
Last active April 3, 2024 07:57
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes: