Skip to content

Instantly share code, notes, and snippets.

View satblip's full-sized avatar

Louis Borsu satblip

View GitHub Profile
@satblip
satblip / gist:e743a1f0d43399936deedd084e8946f3
Created September 13, 2018 10:46 — forked from Iristyle/gist:5005653
Configure HAProxy for userlists

Create SHA512 passwords

# make sure to use a leading space so that the command is not stored in your bash history!!
 mkpasswd -m sha-512 password1
# generates -> $6$yMgsow58.g/Z$mBjHfdVzqcF/LN.iwV23Eyqg.yGPTsp9pOwaStsJ6c4I4zL7BhucVVAkv5guf7OVRr8Pw0mHF4NrWBRCG5ci7/
 mkpasswd -m sha-512 password2
# generates -> $6$RZ86vRkQ$aRKN1HOsk6bDHBbMhS7jSo/p1NGFl4PvwY3KpU.72i./LvITi41nL84EkxOFXl.6Bmhynj/L7pYbfF0rUHtOB0
@satblip
satblip / gist:9512ad6262098d3aaa94
Created May 30, 2015 15:12
Mustache Interview
<div class="interview">
{{#content.prelude}}
<p class="prelude">{{{ content.prelude }}}</p>
{{/content.prelude}}
{{#content.questionnaire}}
<p class="question">{{ question }}</p>
<p class="reponse">{{ reponse }}</p>
# See http://help.papertrailapp.com/kb/hosting-services/aws-elastic-beanstalk/
sources:
/home/ec2-user: https://github.com/papertrail/remote_syslog2/releases/download/<VERSION>/remote_syslog_linux_amd64.tar.gz
files:
"/etc/log_files.yml":
mode: "00644"
owner: root
group: root
/*
* Decide on your cache-busting strategy. In this example, we use the current timestamp, which will
* force a change every time the app is visited, but not every time the partial is loaded within a
* visit. Even better would be to use a hash of the file's contents to ensure that the file is always
* reloaded when the file changes and never reloaded when it isn't.
*/
var cacheBustSuffix = Date.now();
// Optionally, expose the cache busting value as a constant so other parts of your app can use it.
ngModule.constant("cacheBustSuffix", cacheBustSuffix);
var json;
json = [
{
foo: {
bar: ['ka', 'boom']
}
}, {
foo: {
bar: ['sna', 'fu']
@satblip
satblip / Json_except.rb
Last active December 20, 2015 18:18
Exception with JSON Rendering in Rails
# I use this code to render the JSON
format.js { render :json => @courses_list.to_json( :except => [ :account_id, :default_view, :public_syllabus, :storage_quota_mb, :apply_assignment_group_weights, :calendar ] )}
# But it still give me this as result :
[
{
"account_id":1,
"course_code":"Audio Mastering 101 - 0913",
@satblip
satblip / Merging two JSON.rb
Last active December 20, 2015 18:09
Merging two JSON
#How I retrieve my JSON :
class CoursesController < ApplicationController
require 'net/https'
require "uri"
require "json"
# List with the courses'information from several sources
def list
# Option 2