Skip to content

Instantly share code, notes, and snippets.

View JulienBlancher's full-sized avatar
🏠
Working from home

Julien Blancher JulienBlancher

🏠
Working from home
View GitHub Profile
@JulienBlancher
JulienBlancher / upgrade-postgres-9.4-to-9.6.md
Created April 27, 2017 17:10 — forked from dmitrykustov/upgrade-postgres-9.4-to-9.6.md
Upgrading PostgreSQL from 9.4 to 9.6 on Debian Jessie

To use the most modern version of Postgres software we need to add postgresql repository. Edit /etc/apt/sources.list or create /etc/apt/sources.list.d/pgdg.list and add there a line: deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main Then import the repository signing key, and update the package lists:

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update

Install a new version of PostgreSQL server.

Once the Debian upgrade finished, I used dpkg-query -l postgresql* to check which versions of postgres I have installed.

@JulienBlancher
JulienBlancher / ldap42.js
Last active October 23, 2015 09:49
Bind 42 LDAP in NodeJS
'use strict';
/**
* Module dependencies.
*/
var ldap = require('ldapjs'),
config = require('../../config/config');
/**
* SList students
@JulienBlancher
JulienBlancher / server_checker.sh
Created February 1, 2015 10:09
Server Checker
#!/bin/bash
echo "---------Start Of Check----------" >> /var/log/serv_check
echo "Check of server availability started at `date +%D-%T`" >> /var/log/serv_check
if ! pgrep -x apache2 > /dev/null
then
echo "Apache is NOT alive !" >> /var/log/serv_check
echo "Apache is NOT alive !" | mail -s "[`date +%D-%T`] APACHE CRITICAL ERROR" ju.blancher@gmail.com
else
@JulienBlancher
JulienBlancher / commit.sh
Last active August 29, 2015 14:07
Sample commit and dump BDD script
#/bin/sh
# Constants
DB_NAME=
MYSQL_USER=
MYSQL_PASS=
ABS_PROJECT_ROOT=
DUMP_FILENAME=dump-sql-`date +%y-%m-%d-%T`.sql
COMMIT_MSG=$1
MYSQLDUMP_BIN=`which mysqldump`
@JulienBlancher
JulienBlancher / filter.d_nginx-auth.conf
Last active March 26, 2024 12:52
Fail2ban Config with Nginx and SSH
#
# Auth filter /etc/fail2ban/filter.d/nginx-auth.conf:
#
# Blocks IPs that makes too much accesses to the server
#
[Definition]
failregex = ^<HOST> -.*"(GET|POST).*HTTP.*"
ignoreregex =
@JulienBlancher
JulienBlancher / bash_identification
Last active August 29, 2015 14:06
Vim & Shell config
#!/bin/bash
trap "echo 'This will be notified.'" SIGHUP SIGINT SIGTERM
echo "Name:"
read NAME
while [ -z "$NAME" ]
do
printf '\033[0;31;40m'
echo "Name mandatory. Please enter your name:"