Skip to content

Instantly share code, notes, and snippets.

View Remiii's full-sized avatar
👨‍💻
remibarbe.fr

Rémi Barbe Remiii

👨‍💻
remibarbe.fr
View GitHub Profile
@Remiii
Remiii / README.md
Last active March 12, 2017 09:06
Setup django-poc

Setup django-poc

Setup env

$ mkvirtualenv django-poc -p python3 -a pathToTheProject
$ pip install django
$ pip install -r requirements/local.txt

$ python -V
@Remiii
Remiii / README.md
Last active March 6, 2024 19:52
How to delete Vault (AWS Glacier) 🗻

How to delete Vault (AWS Glacier)

This Gist give some tips in order to remove AWS Glacier Vault with AWS CLI (ie. https://aws.amazon.com/en/cli/).

Step 1 / Retrive inventory

$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --vault-name YOUR_VAULT_NAME --account-id YOUR_ACCOUNT_ID --region YOUR_REGION
@Remiii
Remiii / AssetsUpdateHeadersCommand.php
Last active September 18, 2015 08:32
Update headers assets on S3 (CloudFront)
<?php
// src/remiii/UtilsBundle/Command/Assets/AssetsUpdateHeadersCommand.php
namespace remiii\UtilsBundle\Command\Assets ;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand ;
use Symfony\Component\Console\Input\InputArgument ;
use Symfony\Component\Console\Input\InputInterface ;
use Symfony\Component\Console\Input\InputOption ;
@Remiii
Remiii / README.md
Created September 2, 2015 19:47
Facebook generator

Facebook generator

Drop in photos folder your photos with firstname and lastname in title... do the following things et voila ;-)

Clean photos with ImageMagick (options)

$ for i in ./photos/*.JPG ; do convert -colorspace GRAY "$i" "${i%.*}.jpg" ; done
$ for i in ./photos/*.JPG ; do convert -resize 250 "$i" "${i%.*}.jpg" ; done
@Remiii
Remiii / README.md
Last active August 28, 2015 13:59
Hubot MamaCake (Paris 18e)
@Remiii
Remiii / .htaccess
Created August 22, 2015 09:40
Symfony 2 redirect www to non-www with Apache .htaccess
# Use the front controller as index file. It serves as a fallback solution when
# every other rewrite/redirect fails (e.g. in an aliased environment without
# mod_rewrite). Additionally, this reduces the matching process for the
# start page (path "/") because otherwise Apache will apply the rewriting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex app.php
# Disabling MultiViews prevents unwanted negotiation, e.g. "/app" should not resolve
# to the front controller "/app.php" but be rewritten to "/app.php/app".
<IfModule mod_negotiation.c>
@Remiii
Remiii / README.md
Last active August 29, 2015 14:27
How to setup HTTPS on Apache / Ubuntu

How to setup HTTPS on Apache / Ubuntu

$ sudo apt-get update
$ sudo apt-get install ssl-cert 
$ sudo a2enmod ssl
$ sudo service apache2 restart
$ sudo mkdir /etc/apache2/ssl
@Remiii
Remiii / README.md
Created August 19, 2015 16:36
Generate a CSR with OpenSSL
@Remiii
Remiii / README.md
Created August 19, 2015 15:31
Mac pfctl Port Forwarding for your VM/Docker

Mac pfctl Port Forwarding for your VM/Docker

Add rules

$ cat /etc/pf.anchors/remiii.forwarding
rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port 80 -> 127.0.0.1 port 10080
rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port 443 -> 127.0.0.1 port 10443

Enable rules

<?php
namespace remiii\UtilsBundle\Command\Assets ;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand ;
use Symfony\Component\Console\Input\InputArgument ;
use Symfony\Component\Console\Input\InputInterface ;
use Symfony\Component\Console\Input\InputOption ;
use Symfony\Component\Console\Output\OutputInterface ;