Skip to content

Instantly share code, notes, and snippets.

View diyfr's full-sized avatar

Stéphane diyfr

  • Nantes, FR
View GitHub Profile
@diyfr
diyfr / cors.conf
Created May 23, 2017 09:13
Apache Proxy CORS configuration for fcm.googleapis.com
<VirtualHost *:80>
ServerName domain.com # configure your domain
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
#Don't miss to enable mod_header and mod_proxy
#replace fcm.googleapis.com in fcm endpoint registration
ProxyRequests Off
<Location /fcm/>
@diyfr
diyfr / InstallGogs_ubuntu16.04.md
Last active May 24, 2017 11:52
Install an private web-based Git repository manager on ubuntu 16.04 : Gogs
@diyfr
diyfr / client.sh
Last active July 3, 2017 07:25
Sécurisation d'un serveur apache avec des certificat utilisateurs
#!/bin/bash
# =============================================================================
# Application : Génération de certificat utilisateur
# Fichier : domain.sh
# Description : Script de génération de certificat utilisateur
# Version : 1.0
# =============================================================================
# Historique :
# 29/06/2017 : 1.0 diyfr - creation
# =============================================================================
mkdir myorga
cd myorga
mkdir certs
mkdir crl
mkdir newcerts
mkdir private
mkdir req
@diyfr
diyfr / lisez-moi.md
Created July 12, 2017 06:58
Mémo coniguration Ubuntu server

Format UTF8

dpkg-reconfigure locales

Mise à l'heure

dpkg-reconfigure tzdata
@diyfr
diyfr / createPWA.bat
Last active July 21, 2017 08:36
Transform a started angular 4 project with angular-cli to a Progressive Web App
@echo off
if [%1]==[] (
@echo "Project name missing !!"
goto eof
)
if exist %~s1\NUL (
@echo "Project Exist !!"
goto eof
)
@diyfr
diyfr / chekApp.md
Last active August 30, 2017 13:26
Check your app
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;

public String getAppSignature(Context context) {
  String result = null;
  try {
    PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(),PackageManager.GET_SIGNATURES);
@diyfr
diyfr / ColumnMapping.java
Last active November 20, 2017 13:15
Use javax.persistence.Column in SQL2o project
package fr.diyfr.sql2o.helper;
import javax.persistence.Column;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
public class ColumnMapping {
@diyfr
diyfr / memo.md
Last active November 24, 2017 08:49
Dockerisez votre poste dev

Installer docker

Nombreux tutos dispo sur le net, pour mémo à minima

sudo apt-get install docker.io 

Portainer un 'superviseur' dans votre navigateur web

on rappatrie l'image

docker pull portainer
@diyfr
diyfr / memo.md
Last active December 18, 2017 14:00
Memo update Docker Image
#!/bin/bash
docker pull myregistry.example.com/myapp:latest  
docker stop myapp  
docker rm myapp  
docker rmi myregistry.example.com/myapp:current  
docker tag myregistry.example.com/myapp:latest myregistry.example.com/myapp:current  

Simple docker start