Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Shipping code for humans

Gabriel Le Breton GabLeRoux

:shipit:
Shipping code for humans
View GitHub Profile
@GabLeRoux
GabLeRoux / .env.example
Last active Sep 13, 2022 — forked from HeshamMeneisi/docker-compose
Mount S3 as Docker Volume (docker-compose)
View .env.example
AWS_S3_BUCKET=
AWS_S3_ACCESS_KEY_ID=
AWS_S3_SECRET_ACCESS_KEY=
@GabLeRoux
GabLeRoux / env-to-json.py
Last active Sep 6, 2022
.env file to json using simple python
View env-to-json.py
#!/usr/bin/env python
import json
import sys
try:
dotenv = sys.argv[1]
except IndexError as e:
dotenv = '.env'
with open(dotenv, 'r') as f:
@GabLeRoux
GabLeRoux / ReadMe.md
Created Jul 31, 2019
Convert OPENSSH to RSA from command line
View ReadMe.md

Convert openssh keys to rsa keys

from something that starts with

-----BEGIN OPENSSH PRIVATE KEY-----

to something that starts with

@GabLeRoux
GabLeRoux / fix-ssl-cert-snakeoil.key-ubuntu-postgresql.sh
Created Apr 1, 2016
Fix postgresql error FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
View fix-ssl-cert-snakeoil.key-ubuntu-postgresql.sh
# > It happened to me and it turned out that I removed erroneously the postgres user from "ssl-cert" group, set it back with
gpasswd -a postgres ssl-cert
# Fixed ownership and mode
sudo chown root:ssl-cert /etc/ssl/private/ssl-cert-snakeoil.key
sudo chmod 740 /etc/ssl/private/ssl-cert-snakeoil.key
# now postgresql starts! (and install command doesn't fail anymore)
sudo /etc/init.d/postgresql start
View 0-ReadMe.md
@GabLeRoux
GabLeRoux / archlinux-virtualbox.sh
Last active Jan 14, 2022
Virtualbox archlinux notes
View archlinux-virtualbox.sh
# sudo /sbin/rcvboxdrv -h
# Unloading modules:
# Loading modules: modprobe: FATAL: Module vboxnetadp not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxnetflt not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxpci not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/4.4.3-1-ARCH
# Solution
# from https://forum.antergos.com/topic/818/can-t-run-my-vitualbox/4
@GabLeRoux
GabLeRoux / Install-php-mysql-apache-on-osx-with-brew.md
Last active Sep 6, 2021 — forked from niepi/osx_php_homebrew.setup.md
Detailed steps to install PHP, MySQL, Apache and some usefull extensions such as xDebug on a mac running Mac Os X. Also included: PostgreSQL.
View Install-php-mysql-apache-on-osx-with-brew.md

Install PHP, MySQL, PostgreSQL, Apache and xDebug on a Mac

You should have some tools installed like Homebrew, a text editor such as Sublime Text and it's subl command line app inside a bin folder and some basic terminal knowledge.

This gist is a more detailed version of niepi's gist with things that worked for me. It may help someone :)

Install PHP

$ brew install php --with-apache --with-mysql --with-pgsql --with-intl
@GabLeRoux
GabLeRoux / how-to-jupyter.md
Last active Jul 17, 2020
Use jupyter to take python notes, share and embed them <3
View how-to-jupyter.md

Installation

You'll need jupyter and some tools to draw plots :)

pip3 install jupyter
pip3 install matplotlib numpy pandas
jupyter notebook
@GabLeRoux
GabLeRoux / dynamicCoinChange.py
Last active Apr 20, 2020
Python Dynamic Coin Change Algorithm
View dynamicCoinChange.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# T: an array containing the values of the coins
# L: integer wich is the total to give back
# Output: Minimal number of coins needed to make a total of L
def dynamicCoinChange( T, L ):
Opt = [0 for i in range(0, L+1)]