Skip to content

Instantly share code, notes, and snippets.

:shipit:
chillin

Gabriel Le Breton GabLeRoux

View GitHub Profile
@GabLeRoux
GabLeRoux / _service.md
Created May 30, 2018 — forked from naholyr/_service.md
Sample /etc/init.d script
View _service.md

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@GabLeRoux
GabLeRoux / how-to-add-ssh-key-to-remote-host.md
Last active Sep 5, 2018
Generate a new ssh key and add it to remote server's authorized_keys
View how-to-add-ssh-key-to-remote-host.md

1. Generate yourself a new ssh key

# Generate new ssh key (from github)
# https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
ssh-keygen -t rsa -b 4096 -C "email@example.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/EXAMPLE_rsa
@GabLeRoux
GabLeRoux / aws-attach-AWSElasticBeanstalkMulticontainerDocker-to-elasticbeanstalk.sh
Created Mar 22, 2018
Attach AWSElasticBeanstalkMulticontainerDocker to elasticbeanstalk's aws-elasticbeanstalk-service-role from command line
View aws-attach-AWSElasticBeanstalkMulticontainerDocker-to-elasticbeanstalk.sh
# example using profile in ~/.aws/config
aws --profile some-profile-name \
iam attach-role-policy \
policy-arn arn:aws:iam::aws:policy/AWSElasticBeanstalkMulticontainerDocker \
--role-name aws-elasticbeanstalk-service-role
@GabLeRoux
GabLeRoux / why-i-hate-php.md
Last active Jan 22, 2018
One of the reasons why I don't like PHP
View why-i-hate-php.md

nope.php:

<?php

echo "some undefined variable" + $undefined_shit;
echo "please don't print";
php nope.php
View Rails-add-user-in-rails-console.md

This is quite a 'classic' problem and the immediate thought ("just do it mySQL") doesn't work here because of the need to have the rails piece that encodes a password that is entered.

So you need to actually use rails, something like this (this should all be happening in your local development environment which is the default when working locally):

You need to create a user.

Try this:

cd the_root_of_the_project
@GabLeRoux
GabLeRoux / how-to-jupyter.md
Last active May 22, 2017
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
View gpaste-client-help.md
gpaste-client --help
Usage:
  gpaste-client [history]: print the history with indexes
  gpaste-client history-size: print the size of the history
  gpaste-client get-history: get the name of the current history
  gpaste-client backup-history <name>: backup current history
@GabLeRoux
GabLeRoux / troubleshooting.md
Last active Jan 18, 2017
Unable to upgrade from v2016.3.3 to v2016.11.1 on debian 8.7
View troubleshooting.md
You can’t perform that action at this time.