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 / aws_command_line.sh
Last active August 29, 2015 14:03
AWS Commande Line
# Install OSX via pip
$ sudo easy_install pip
$ sudo pip install awscli
# AWS Configuration
$ mkdir ~/.aws/
$ touch config
# file : ~/.aws/config
#
@francois-blanchard
francois-blanchard / error_github_large_files_detected.sh
Last active August 29, 2015 14:04
Github error : Large files detected.
# Github error : Large files detected.
$ git push origin mon_repo
#=> Counting objects: 283, done.
# Delta compression using up to 8 threads.
# Compressing objects: 100% (125/125), done.
# Writing objects: 100% (183/183), 32.68 MiB | 79.00 KiB/s, done.
# Total 183 (delta 97), reused 109 (delta 55)
# remote: error: GH001: Large files detected.
# remote: error: Trace: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
@francois-blanchard
francois-blanchard / 0_generate_secret_key_rails.sh
Created July 25, 2014 13:59
Generate secret key for rails app production
rake secret
- Launching Keychain Access via Spotlight
- Ensure that expired certificates are visible by selecting”Show Expired Certificates” from the View menu
- Search for “Digicert”.
- Right-click the certificate with a red X and select “Delete DigiCert High Assurance EV Root CA”
- The certificate may not look removed until Keychain Access is restarted
- Restart your browsers
SOURCE : https://www.yesthatallen.com/fixing-an-old-digicert-issue/
@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 :

@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 / backup_and_restore_database.md
Last active August 29, 2015 14:06
Backup and Restore MySQL database

Backup and Restore MySQL database

backup

$ mysqldump -u root -p [database_name] > dumpfilename.sql

restore

$ mysql -u root -p [database_name] < dumpfilename.sql
@francois-blanchard
francois-blanchard / combine_active_record_object.md
Created September 23, 2014 09:22
Combine two ActiveRecord objects

Combine two ActiveRecord objects

scope1 = Model.relations1.where(:color => 'blue')
scope2 = Model.relations2.where(:color => 'red')

combine_ids = (scope1 + scope2).uniq
result = Model.where(id: combine_ids)
@francois-blanchard
francois-blanchard / log_files_rails.md
Created September 23, 2014 13:06
Create log files system on Rails

Create log files system on Rails

# config/initializers/log_files.rb
MY_LOG = Logger.new("#{Rails.root}/log/tasks/mylog.log")

# call in your model
MY_LOG.info("Hello world")
@francois-blanchard
francois-blanchard / delay_sidewid_specific_queue.rb
Created October 1, 2014 15:31
Sidekiq delay task on a specific queue
# example worker
class TestWorker
include Sidekiq::Worker
sidekiq_options :queue => :high
def perform
60.times do
MyModel.delay(:queue => 'high').test_sidekiq
end