Skip to content

Instantly share code, notes, and snippets.

pablosalgadom

Block or report user

Report or block pablosalgadom

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View restore_mac_trash.pl
#!/usr/bin/env perl
# Copyright (c) 2015 Sergey Lyubka
# All rights reserved
use Encode;
my $dir = "/Users/$ENV{USER}/.Trash";
sub read_file($) { local $/; open FD, $_[0] or die $_[0]; binmode FD; <FD>; }
@pablosalgadom
pablosalgadom / restore_mac_trash.pl
Created Nov 13, 2017 — forked from cpq/restore_mac_trash.pl
MacOS: restore all files from Trash folder to their original location
View restore_mac_trash.pl
#!/usr/bin/env perl
# Copyright (c) 2015 Sergey Lyubka
# All rights reserved
use Encode;
my $dir = "/Users/$ENV{USER}/.Trash";
sub read_file($) { local $/; open FD, $_[0] or die $_[0]; binmode FD; <FD>; }
@pablosalgadom
pablosalgadom / secret_key_base
Last active Aug 2, 2019
app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (RuntimeError)
View secret_key_base
So i was using Rails 4.1 with Unicorn v4.8.2 and when i tried to deploy my app it doesn't start properly and into the unicorn.log file i found this error message:
"app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (RuntimeError)"
After a little research i found that Rails 4.1 change the way to manage the secret_key, so if we read the secrets.yml file located at exampleRailsProject/config/secrets.yml (you need to replace "exampleRailsProject" for your project name) you will find something like this:
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@pablosalgadom
pablosalgadom / ruby.log
Created Sep 29, 2014
Ruby Segmentation Fault - Attempting to run $ RAILS_ENV=production rake db:create
View ruby.log
$ RAILS_ENV=production rake db:create
/usr/local/rvm/gems/ruby-2.1.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:888: [BUG] Segmentation fault
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0052 p:---- s:0189 b:0189 l:000188 d:000188 CFUNC :initialize
c:0051 p:---- s:0187 b:0187 l:000186 d:000186 CFUNC :new
c:0050 p:0020 s:0183 b:0183 l:000182 d:000182 METHOD /usr/local/rvm/gems/ruby-2.1.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:888
c:0049 p:0119 s:0179 b:0179 l:000178 d:000178 METHOD /usr/local/rvm/gems/ruby-2.1.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:568
c:0048 p:---- s:0172 b:0172 l:000171 d:000171 FINISH
You can’t perform that action at this time.