Skip to content

Instantly share code, notes, and snippets.

View francois-blanchard's full-sized avatar
😁

François Blanchard francois-blanchard

😁
View GitHub Profile
@pierrax
pierrax / squash_merge_release.md
Last active June 8, 2016 07:02
How to merge a release branch before deploying

#Go to the release branch

git checkout RELEASE_date

#Pull the last changes

git pull origin RELEASE_date
@yannvery
yannvery / RSpec_cheatsheet.md
Last active February 22, 2018 20:32
RSpec cheatsheet

RSpec Cheatsheet

Specs layers

 +-----------------------------------------------------------------------------------------+

   +----------+                                                       +------------------+
   |          |                                                       |                  |
   |  View    |                                                       |                  |
   |  Specs   |            View                                       |                  |

Remove old kernels files

You can see should restart the server when you see *** System restart required *** when you start ssh
You can restart with sudo shutdown -r now
You can see your current kernel version with uname -r
You can see all kernel versions in /lib/modules/

1) Delete perimated packages

sudo apt-get autoclean

@yannvery
yannvery / ubuntu_cleanup_packages.md
Last active May 19, 2022 09:44
Ubuntu - Purge old kernels and unused modules

Ubuntu - Purge old kernels and unused modules

Purge old kernels

Open terminal and check your current kernel:

uname -r

DO NOT REMOVE THIS KERNEL!

@yannvery
yannvery / cleanup_ubuntu_mailbox.md
Created January 6, 2016 08:44
Cleanup Ubuntu mailbox

All mails received by a user are stored into: /var/mail/username

Open mailbox without initial display: mail -N
Then delete all mails: d *

class MyKlass
  include
  CONSTANTS
  belongs_to
  has_one
  has_many
  accepts_nested_attributes_for
  attr_accessible
 validates
@learncodeacademy
learncodeacademy / deployUser.md
Last active October 8, 2022 18:56
Adding a deploy user in Linux

(wherever it says url.com, use your server's domain or IP)

Login to new server as root, then add a deploy user

sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy

And Update the new password

##Merge many has_many

def get_fb_users
	FacebookUser.from("
		(
			(
				#{self.facebook_recipients_users.to_sql}
			) union (
				#{self.facebook_users.to_sql}
			)
@yannvery
yannvery / log_level.rb
Created June 25, 2014 07:54
Manage log level in a Rails console
#To turn it off
old_logger = ActiveRecord::Base.logger
ActiveRecord::Base.logger = nil
#To turn it back on
ActiveRecord::Base.logger = old_logger