Skip to content

Instantly share code, notes, and snippets.

View francois-blanchard's full-sized avatar
😁

François Blanchard francois-blanchard

😁
View GitHub Profile
@francois-blanchard
francois-blanchard / 0_backup_server.md
Last active April 16, 2022 08:27
Backup server with gem Backup and Whenever

Backup server with gem Backup and Whenever

Config Backup

Install backup gem

$ gem install backup

Generate Backup files see doc for genrate's options

@francois-blanchard
francois-blanchard / checkbox_nested.md
Created April 3, 2015 14:45
Create nested attributes with checkbox

Create nested attributes with checkbox

# Class
has_many :sc_invited_celebrities
accepts_nested_attributes_for :proposed_posts, :sc_invited_celebrities, :answer_to_questions
# Controller
def new
 @social_campaign = SocialCampaign.new
@francois-blanchard
francois-blanchard / add_user_mysql.md
Created December 11, 2014 10:11
Add user MySQL

Add user MySQL

> CREATE DATABASE name_database;
> CREATE USER 'name_user'@'ip_or_localhost' IDENTIFIED BY 'choose_password';
> GRANT ALL PRIVILEGES ON name_database.* TO 'name_user'@'ip_or_localhost';
> FLUSH PRIVILEGES;

Delete user

@francois-blanchard
francois-blanchard / error_capistrano_deploy_could_not_parse_object.md
Last active January 13, 2021 10:05
Error Capistrano deploy - fatal: Could not parse object 'xx...xx'

Error Capistrano deploy - fatal: Could not parse object 'xx...xx'

  1. Connect you to your server $ ssh user@myserver
  2. Go to your deploy path and select the shared directorycd /your/directory/deploy/shared
  3. Remove the git cache rm -rf cached-copy
  4. Retry to deploy & have fun ;)
@francois-blanchard
francois-blanchard / debug_travis_build.md
Last active September 15, 2020 08:55
How to debug a failed travis.ci build

How to debug a failed travis.ci build

1/ Go to travais build

https://travis-ci.com/gitUser/gitRepo/builds/XXXXXX

build

2/ Connect to travis build with ssh

@francois-blanchard
francois-blanchard / ip_instance.md
Last active August 24, 2020 10:20
Google cloud - Manage ip instance with gcloud
@francois-blanchard
francois-blanchard / mysqlcheck.md
Last active July 26, 2020 16:23
Check and Repair MySQL Tables Using Mysqlcheck

Check and Repair MySQL Tables Using Mysqlcheck

Check a Specific Table in a Database

$ mysqlcheck -c database_name table_name -u root -p

Check All Tables in a Database

@francois-blanchard
francois-blanchard / README.md
Created August 17, 2018 15:27
Concat csv files in current directory (mac osx version)

Intro

This script concat all csv file (by default order) in one csv file result.csv only with first and second columns. Additional behaviour : skip 8 first lines (header) and 5 last lines (footer)

Requirements

brew install coreutils

Tips

@francois-blanchard
francois-blanchard / multi_ip_remote_mysql.md
Created December 11, 2014 11:50
MySQL Server: Bind To Multiple IP Address

MySQL Server: Bind To Multiple IP Address

$ vi /etc/mysql/my.cnf
> bind-address    = 0.0.0.0
> #skip-networking
## Block all connections to 3306 ##
@francois-blanchard
francois-blanchard / config_server_with_chef_for_rails.md
Last active December 1, 2017 12:52
Build server with chef for deploy rails app

Configure server for deploy rails app

Objective

Prepare a server for a Rails app with MySQL (percona) + NGINX (passenger)
Deploy rails app in new server with Capistrano v3

For this example we need :