how to edit pg_hba.conf using gedit [closed] - ruby-on-rails

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am trying to make changes to my pg_hba.conf file. I cd /etc/postgresql/9.1/main
$ sudo gedit pg_hba.conf
make my changes, but then the directory looks like this:
$ ls
environment pg_hba.conf~ start.conf
pg_ctl.conf pg_ident.conf
pg_hba.conf postgresql.conf
What way can I edit pg_hba.conf without this double file business? If I don't run sudo I get an error in gedit that I don't have permissions necessary to open the file

Those files ending with a ~ (tilde) are backup files. Gedit creates them, you can switch that off in the gedit preferences under File saving.
Or you can use an editor that does not leave those files around, like nano.

Related

Suddenly I came to be unable to execute all commands(example:$ ruby -v, $ mysql --version, etc...) at all [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
My ruby ​​version is "2.6.6", my mysql version is "5.7", my mysql2 version is 0.5.3, my rails version is 5.0.7.2, and my Xcode version is 12.5.
I use macOS Big Sur(version 11.4) and the text editor "Atom".
I'm planning to release my Rails application with the URL of HEROKU(example. https://[My APP Name].herokuapp.com).
I edited ~/.bash_profile as below and I pushed esc, :x, Enter and I executed source ~/.bash_profile before suddenly I came to be unable to execute all commands(example:$ ruby -v, $ mysql --version, etc...) at all.
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export SECRET_KEY_BASE=GENERATED_CODE
Even now, I can't open ~/.bash_profile ,using this command vim ~/.bash_profile.
quick fix
The easiest way to fix this is to just move your ~/.bash_profile out of the way, e.g.
/bin/mkdir ~/temp-store-bash-profile
/bin/mv ~/.bash_profile ~/temp-store-bash-profile
From there, you can just load up a new terminal, edit your ~/temp-store-bash-profile/.bash_profile file commenting out the offending export line, move it back, and you are good to go.
Detailed fix
Of course, unloading your ~/.bash_profile file every time it's messed up is a less than ideal situation. If you'd like to edit it in place, keep reading.
To get you back into vi, the full default path for the pre-installed vim editor is /usr/bin/vim . You can use that instead of vim as a drop-in replacement. So /usr/bin/vim ~/.bash_profile
Once you are there you may, in vim,
:next ~/.bash_profile /etc/paths /etc/paths.d/*
This will load most if not all of the default PATH sources into your editor. You can go to the next file in the queue with :next and the previous file with :prev . This will allow you to fully cherry pick what you'd like from your PATH and set up your PATH exactly the way you'd like it.
When all else fails, make a new user
An easier method to find out what your default PATH variable is, and sometimes the only way if you've sufficiently messed up your environment (though it is overkill for your situation) is to create a new user profile, then
echo "${PATH}" > /tmp/default_path
You can do this with any variable you'd like the default for. You will then be able to read this from your profile with a dirty environment.

Not able to install hstore in rails 4 on CENTOS [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I am using rails 4 with database as postgres9.4.While using hstore type column for dynamic field .I am getting error
PG::UndefinedFile: ERROR: could not open extension control file
"/usr/pgsql-9.4/share/extension/hstore.control": No such file or
directory : CREATE EXTENSION IF NOT EXISTS
"hstore"/var/www/Q3/mailchimp/campaign_app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in async_exec'
/var/www/Q3/mailchimp/campaign_app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:592:inblock in exec_no_cache'
/var/www/Q3/mailchimp/campaign_app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:473:in block in log'
/var/www/Q3/mailchimp/campaign_app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/notifications/instrumenter.rb:20:in
instrument'
/var/www/Q3/mailchimp/campaign_app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:467:in log'
/var/www/Q3/mailchimp/campaign_app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:592:inexec_no_cache'
/var/www/Q3/mailchimp/campaign_app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:584:in execute_and_clear'
/var/www/Q3/mailchimp/campaign_app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:160:in
exec_query'
/var/www/Q3/mailchimp/campaign_app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:342:in enable_extension'
/var/www/Q3/mailchimp/campaign_app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:662:in
block in method_missing'
I try
sudo yum install postgresql postgresql-contrib
sudo yum install postgresql-server.x86_64 postgresql94-contrib.x86_64
but don't work for me
In Centos i by mistake install postgres8.3 packages but i was using postges9.4.
After removing postgres8.3 packages it works fine

rails standalone installer package for rail 3.xx [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Where can I find rails standalone installer package for the rails v.3.x.x?
I know I can use gem command and specify a particular version to download.
Is that available to download on some website like rubyforge?
Thanks in advance,
If you're using windows, you can use RailsInstaller
git clone git://github.com/rails/rails.git
git checkout v3.1.1
List all versions:
git tag -l
https://github.com/rails/rails

Running Phantomjs on Heroku [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Is there a way to run phantomjs, a command-line tool, on Heroku?
check out this buildpack:
https://github.com/stomita/heroku-buildpack-phantomjs
I also am able to run the x86_64 build of PhamtomJS, just stuck in my app's vendor directory:
http://phantomjs.org/download.html
In Version 1.5 we got rid of the Xvfb and Xlib dependencies.
Now this should be pretty simple.
I'd suggest:
checkout the source
build a binary with the given script (check the options to build the version without xvfb)
be happy :)
Ariya, the main author, also did a good job at incorporating Qt in our codebase directly, so we have a tailored, stripped down Qt that does just what PhantomJS needs and no more :)
I'm not familiar with Phantom, but it looks like a binary, in which case there's a Heroku buildpack which might help you out here:
https://github.com/ryandotsmith/null-buildpack

What is the best way to compare 2 folder trees on windows? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I'm moving a repository from sourcesafe to subversion and I need to ensure that vital points are equal. Is it any existing command / tool for windows that allows me to compare two folder trees that they are equal (has equal folder structure and files of same content)? The ideal will be something command-line like:
some_cool_compare c:\current_vss c:\current_svn -exclude .svn;*.vspscc;*.scc
Is it some tool / command exist or I need to write a script of my own?
If you can use a GUI tool, the best I tried is WinMerge - open source.
If not, then diff is your friend.
Beyond compare allows you to do that and much more.
It's one of those tools I can't live without.
Take a look here for a reference on the scripting options
You could also execute tree > tree.txt in both folders and then diff both tree.txt files with any file based diff tool (git diff).
As I am reluctant to install new programs into my machine, this PowerShell script (from Hey, Scripting Guy! Blog) helped me solve my problem. I only modified the path to suit my case:
$fso = Get-ChildItem -Recurse -path F:\songs
$fsoBU = Get-ChildItem -Recurse -path D:\songs
Compare-Object -ReferenceObject $fso -DifferenceObject $fsoBU
SyncToy is a free application from Microsoft with a "Preview" mode for comparing two paths. For example:
You can then choose one of three modes ("Synchronize", "Echo" and "Contribute") to resolve the differences.
Lastly, it comes with SyncToyCmd for creating and synchronizing folder pairs from the CLI or a Scheduled Task.
You can use git for exactly this purpose. Basically, you create a git repository in folder A (the repo is in A/.git), then copy A/.git to B/.git, then change to B folder and compare simply by running git diff.
And the --exclude functionality can be achieved with .gitignore.
So, sticking to your example (but using bash shell on Linux):
# Create a Git repo in current_vss
pushd current_vss
printf ".svn\n*.vspscc\n*.scc" >> .gitignore
git init && git add . && git commit -m 'initial'
popd
# Copy the repo to current_svn and compare
cp -r current_vss/.git* current_svn/
pushd current_svn
git diff
Did you try:
Araxis Merge?
It allows you to visualize changes and selectively merge specific differences in files and folders.

Resources