Skip to content

Instantly share code, notes, and snippets.

View alexbonhomme's full-sized avatar

Alexandre Bonhomme alexbonhomme

View GitHub Profile
@alexbonhomme
alexbonhomme / macosx-install-php-oracle-oci8-pdo_oci.md
Last active March 27, 2024 08:49 — forked from krisanalfa/macosx-install-php-oracle-oci8-pdo_oci.md
Install OCI8 and / or PDO_OCI on OSX via Brew
@alexbonhomme
alexbonhomme / 99-proxy
Last active May 17, 2021 08:47
Ce script permet d'activer/désactiver le proxy de Lille 1 dans l'env (.bashrc) et sur les applications suivantes : Git, Maven, Network Manager, Eclipse. !! Attention !! Vous devez avoir configuré le proxy sur vos applications au préalable. Ce script n'est qu'un simple 'toggle'. Vous devez aussi éditer les variables de configurations si vous n'ut…
#!/bin/sh
USER=alex # <--- Put your username here
SSID=LILLE1
INTERFACE=$1
STATUS=$2
case $INTERFACE in
wlan0)
case $STATUS in
@alexbonhomme
alexbonhomme / make-release.sh
Last active January 29, 2019 08:31
Release script
#! /bin/bash
if [[ "$#" -lt 1 ]]; then
printf "\033[0;31mUsage: $0 version \e[0m\n"
exit -1
fi
RELEASE_VERSION=$1
BRANCH_NAME="release-$RELEASE_VERSION"
@alexbonhomme
alexbonhomme / installation.sh
Last active January 8, 2018 11:17
RPI 3 Timemachine
# Hostname
echo "mnemosyne" | sudo tee /etc/hostname > /dev/null
sudo sed -i 's/raspberrypi/mnemosyne/g' /etc/hosts
# Fix locales
echo "LANG=\"en_GB.UTF-8\"
LC_MESSAGES=\"en_GB.UTF-8\"
LANGUAGE=\"en_GB.UTF-8\"
LC_CTYPE=\"en_GB.UTF-8\"
LC_ALL=\"en_GB.UTF-8\"" | sudo tee /etc/default/locale > /dev/null
--- configure 2017-09-12 15:15:16.000000000 +0200
+++ configure12 2017-09-12 15:14:41.000000000 +0200
@@ -5005,7 +5005,7 @@
;;
- 9.0)
+ 12.1)
@alexbonhomme
alexbonhomme / update_username.sh
Created July 20, 2017 10:26
Update Github username in local repos
# Update and convert old HTTPS sources
find . -path "*/.git/config" -exec sed -i '' -e "s,url = https://github.com/blckshrk,url = git@github.com:alexbonhomme,g" {} \;
# Update SSH sources
find . -path "*/.git/config" -exec sed -i '' -e "s,url = git@github.com:blckshrk,url = git@github.com:alexbonhomme,g" {} \;
# checks
find . -path "*/.git/config" -print0 | xargs -0 grep 'alexbonhomme'

Workflow de mise en production pour Symfony 3

Clone du dépot

git clone ...

Vérfier les deps Symfony

php bin/symfony_requirements

Installation deps

@alexbonhomme
alexbonhomme / git_tips.md
Last active February 3, 2017 18:07
GIT tips

Déplacer les N derniers commits vers une NOUVELLE branche (ne fonctionne pas avec une branche déjà créée)

git branch newbranch
git reset --hard HEAD~N
git checkout newbranch

Renommer un tag local/distant

@alexbonhomme
alexbonhomme / post-receive
Created July 14, 2016 14:17
Push to deploy GIT hook
#!/bin/bash
while read oldrev newrev ref
do
if [[ $ref =~ .*/master$ ]] || [[ $ref =~ .*/develop$ ]];
then
export branch=${ref:11}
echo "$branch received. Deploying $branch branch..."
git --work-tree=/home/user/www --git-dir=/home/user/repo checkout -f $branch

Local server

php app/console server:run

php app/console server:stop

Routes list

php app/console debug:router

Send spool emails (SwiftMailer)

php app/console swiftmailer:spool:send --message-limit=10 --env=prod