Skip to content

Instantly share code, notes, and snippets.

View florianajir's full-sized avatar
🛠️
Building a secret project

Florian Ajir florianajir

🛠️
Building a secret project
View GitHub Profile
@florianajir
florianajir / mozjpeg-install.sh
Created July 4, 2019 12:49
mozjpeg install on Amazon Linux 2
sudo su
yum groupinstall "Development Tools" -y
yum install nasm -y
cd /tmp
wget https://github.com/mozilla/mozjpeg/archive/v3.3.1.tar.gz
tar -xzf v3.3.1.tar.gz
cd mozjpeg-3.3.1
autoreconf -fiv
@florianajir
florianajir / forever_consumer.sh
Created November 7, 2018 16:26
keep alive a bash command forever
nohup watch -n0 "path/to/bin/console rabbitmq:consumer delete -w" &
@florianajir
florianajir / lamp-amazon.md
Last active October 24, 2018 14:49
LAMP on Amazon linux

Pour définir les autorisations sur les fichiers

  1. Ajoutez votre utilisateur (dans ce cas, ec2-user) au groupe apache.
[ec2-user ~]$ sudo usermod -a -G apache ec2-user
  1. Déconnectez-vous, puis reconnectez-vous pour sélectionner le nouveau groupe, puis vérifiez votre adhésion.
@florianajir
florianajir / fix-symfony-permissions.sh
Created September 7, 2018 17:16
Fixing permission for symfony
sudo setfacl -R -m u:"apache":rwX -m u:`whoami`:rwX var/cache var/log
sudo setfacl -dR -m u:"apache":rwX -m u:`whoami`:rwX var/cache var/log
@florianajir
florianajir / tailf-win.md
Last active February 17, 2023 11:12
Tail log file on windows

Windows PowerShell

Without filter

Get-Content myTestLog.log –Wait

With filter

Get-Content myTestLog.log -wait | where { $_ -match “WARNING” }

@florianajir
florianajir / install-ubuntu-pkg.sh
Last active February 17, 2023 11:13
ubuntu essential dev packages
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get dist-upgrade -y -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold"
sudo apt-get install build-essential git grub-customizer sublime-text vim htop zsh
#!/bin/bash
if [ -z "$1" ]; then
echo "`basename $0` {start|stop}"
exit
fi
case "$1" in
start)
/usr/bin/Xvfb :99 -ac -screen 0 1024x768x8 &
;;
@florianajir
florianajir / sku_gen_draft.php
Last active December 19, 2017 15:53
Generate random identifier
<?php
const SKU_LENGTH = 24;
const PREFIX_SEPARATOR = '-';
public function createSku($prefix)
{
$prefix .= self::PREFIX_SEPARATOR;
$randLength = self::SKU_LENGTH - count($prefix);
$sku = $prefix . $this->generateRandom($missingLength);
@florianajir
florianajir / fido_fido.php
Created November 7, 2014 14:32
PHP FIDO analyzer (need FIDO installed as python module)
<?php
/**
* Created on 3 sept. 2013
* @author Florian Ajir <florianajir@gmail.com>
*
* Librairie PHP permettant l'identification de document électronique
* en faisant appel au programme FIDO
* @link <http://www.openplanetsfoundation.org/software/fido>
* basé sur le registre technique PRONOM