Skip to content

Instantly share code, notes, and snippets.

View HLFH's full-sized avatar

Gaspard d'Hautefeuille HLFH

View GitHub Profile
@lxneng
lxneng / gist:0b79d373cda4bdfe3dcc
Created August 6, 2014 06:21
mongodb distinct multiple fields
collection = db.getCollection('foo')
result = collection.aggregate(
[
{"$group": { "_id": { fa: "$fa", fb: "$fb" } } }
]
);
printjson(result);
@hardware
hardware / main.cf
Last active July 26, 2020 16:24
/etc/postfix/main.cf - Fichier de configuration de Postfix
#######################
## GENERALS SETTINGS ##
#######################
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
delay_warning_time = 4h
mailbox_command = procmail -a "$EXTENSION"
@mwf
mwf / Installation-tutorial-for-Git-Server-on-OS-X.md
Last active June 15, 2021 08:10
Mac OS X 10.9 - Create system user and allow ssh login

A small tutorial for how to set up Git Server on Mac OS X. The main dificulty was to create a "system" user (aka "daemon", uid<=500) and allow ssh login for it.

  1. I need 'git'-user to be system - not visible in standart users list.
  2. I need to allow ssh access only for some users/groups.

The tutorial for Git server setting up - http://git-scm.com/book/ca/Git-on-the-Server-Setting-Up-the-Server

So I need to create system user 'git' with homefolder.

System user creation script - http://serverfault.com/a/532860. I've modified it a little and uploaded here https://gist.github.com/mwf/20cbb260ad2490d7faaa#file-create_sys_user-sh.

@kwk
kwk / README.md
Created October 1, 2014 13:52
Forgot to sign-off commits?

No problem,

run

git filter-branch --msg-filter "cat - && echo && echo 'Signed-off-by: Your Name <Your.Name@example.com>'" HEAD~2..HEAD

To sign-off the last two commits.

Then force to push them to the remote repo with the -f option:

@chrisjacob
chrisjacob / Gemfile
Last active February 6, 2020 08:26
Simple guide to integrating Pages v1.0.0 with Rails v4.1.1
gem 'rails', '4.1.1'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
gem 'jquery-turbolinks'
# Gems for twitter LESS -> CSS and JS support
gem 'execjs'
@yannvery
yannvery / CHRUBY_add_ruby_version.md
Last active December 8, 2023 00:51
CHRUBY - How to install a new ruby version

Install a new ruby version with chruby

OSX

First of all you must update ruby-build to update definitions list.

brew update

And update ruby-build

@17twenty
17twenty / readme.md
Created September 6, 2015 21:00
Using systemd-networkd

For those of you who want to try out systemd-networkd, you can read on, and find out in this tutorial how to switch from NetworkManager to systemd-networkd on Linux.

Requirement systemd-networkd is available in systemd version 210 and higher. Check the version of your systemd before proceeding.

$ systemctl --version

Switch from Network Manager to Systemd-Networkd

It is relatively straightforward to switch from Network Manager to systemd-networkd (and vice versa).

```
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.1.0/gems/ffi-1.9.10/ext/ffi_c
/usr/bin/ruby2.1 -r ./siteconf20151118-18985-1l1bsx7.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
@aeris
aeris / hpkp-tlsa.sh
Created January 17, 2016 21:18
Generate HPKP or TLSA fingerprint
#!/bin/bash
case "$1" in
hpkp)
case "$2" in
key)
openssl rsa -in "$3" -outform der -pubout 2>/dev/null | openssl dgst -sha256 -binary | openssl enc -base64
;;
csr)
openssl req -in "$3" -pubkey -noout | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -binary | openssl enc -base64
@arno-di-loreto
arno-di-loreto / openapi_specification_fka_swagger_specification_tutorial.md
Last active May 5, 2022 13:46
OpenAPI Specification (fka Swagger Specification) tutorial files from [API Handyman blog](http://apihandyman.io)