Skip to content

Instantly share code, notes, and snippets.

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

Xorus xorus

🏠
Working from home
View GitHub Profile
from __future__ import division
import cv2
import argparse
import sys
def center_from_faces(matrix):
# face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
# print sys.path[0] + '/opencv/lbpcascade_profileface.xml'/home/xorus/projects/reboot/bin/opencv/haarcascade_frontalface_default.xml
#!/bin/bash
# SSH key forwarding MUST be enabled
source ./sync_config.sh
pwd=`pwd`
cd $staging_shared_path
echo 'Dump database'
# In deploy.rb
namespace :symfony do
namespace :doctrine do
task :cache do
invoke 'symfony:console', 'doctrine:cache:clear_metadata'
invoke 'symfony:console', 'doctrine:cache:clear_query'
invoke 'symfony:console', 'doctrine:cache:clear_result'
end
task :migrate do
invoke 'symfony:console', 'doctrine:migrations:migrate'
<?php
/**
* Created by PhpStorm.
* User: jgonzalez
* Date: 11/17/16
* Time: 3:55 PM
*/
namespace COETBundle\CSV;
@xorus
xorus / nearest_md_color.html
Created March 29, 2016 12:27
Javascript : nearest material design color
<!doctype html>
<html>
<head>
<title></title>
</head>
<body>
<input type="color" id="color">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tinycolor/1.3.0/tinycolor.js"></script>
<script>
<?php
// ultra basique et non sécurisé
if($_SERVER['REQUEST_METHOD'] === 'POST' && $_SERVER['HTTP_X_GITHUB_EVENT'] == 'push'){
$path = getProjectPath();
exec("cd ".$path." && git pull origin master");
}
}
/**

intégerer le script stupid_deployement_script.php

https://gist.github.com/mickaelandrieu/8b611cd3003e2e4b5b05

Pour intégrer basiquement ce script dans votre projet, il vous faut, sur votre serveur VPS/dedié :

  • Télécharger ce script dans un dossier accessible depuis le web (par exemple sur mon serveur mon dossier "web" est dans /var/www/html)

  • Cloner le dépôt de votre projet annuel sur le serveur (dans un dossier web du coup)

#!/bin/bash
# https://gist.github.com/xorus/8bd4c7c54d01908af37e
certsFolder=/etc/letsencrypt/live
certName=cert.pem
expirationDays=14
letsencryptCmd='/opt/letsencrypt/letsencrypt-auto --config /etc/letsencrypt/cli.ini'
expirationDelay=$((60*60*24*$expirationDays))
toRenew=()
@xorus
xorus / lets-encrypt-renew.md
Last active February 10, 2016 18:31
Let's encrypt renew

Let's encrypt renewal with nginx

Script based on this : https://gist.github.com/xorus/27d5fb2bdba94e80425c

Putting this script in my crontab should renew automatically my domain names certificates.

Note : I installed letsencrypt to /opt/letsencrypt

I am using a nginx webserver and I didn't want downtime for certificate renewal.