SSH Online Code Editor Terminal Security Issue - ruby-on-rails

I am currently going through a tutorial with Ruby On Rails through a third party code editor.
It's currently walking me through through the process of getting my stuff onto a git repository and I have set up an SSH key from within the terminal of the online code editor itself. (not my computers code editor)
Using the command cat ~/.ssh/id_rsa.pub I accidentally printed it onto the console and am worried about security. It was the only way I could carry on with the tutorial. I did manage to push my application to the repo successfully. Is it wise to generate SSH Keys through other online code editors? Does it matter?
Any help and advice is greatly appreciated.
Thanks
Dan

Related

What is the cause of the Security Constraints Not Satisfied Error when using sam deploy ---guided?

I am attempting to follow the Hello World example for deploying an AWS Serverless Application, but I get a Security Constraints Not Satisfied Error when using sam deploy --guided. I'm pressing Enter at each prompt to accept the defaults per the tutorial.
The curious bit--to me--is if I use the AWS Toolkit extension for VS Code to deploy the app it works fine, so I don't think it has anything to do with my IAM permission config, but I'm new to this so I'm not ruling it out.
Recently the guided deploy was updated to include a prompt confirming if you were ok with not having any authorization defined. At the same time, a check was added that would fail the guided deploy if you answer 'No'. (See the relevant part of the commit here.)
This means that, as of this commit, you can't go through the AWS Hello World tutorial by responding with Enter to accept the default options.
To successfully deploy from the command line you'll need to confirm 'Yes' that you're ok with not having any authorization defined, and then it should work as expected.
During your sam deploy --guided, at the following question you need to answer YES.
OR
You can do sam deploy which skip that

How to change code on live Ruby On Rails

I am new to Ruby on Rails.
I have a site deployed on server and I'm accessing it with putty with hostIP and an RSA key.
How can I update the code on the deployed site? If the code is modified, do we have to rebuild (or run) the code?
Just edit the code using editor (vim, nano, or whatever), then restart your web server. But that's not the right way to do it. You should edit it in your local machine, and use a deployment tool like Capistrano. See below.
https://www.digitalocean.com/community/tutorials/how-to-automate-ruby-on-rails-application-deployments-using-capistrano
Modify the code with your favourite editor(vim/emacs/Sublime Text...) or IDE like Rubymine, save the change,
Refresh your webpage, your modification should take effect.

How to make use of .jsp LDAP code and other java files in ruby on rails?

I am very exited to join this community. Here is my problem.
I am doing a project in ruby on rails which basically is to develop an interface to take applications from people then run some algorithm like Gale-Shapely for example in background after deadline and then output the results in a new page. I had the gale shapely algo coded in Java and C++ languages. The problem is we have to contact LDAP server in our institute in-order to verify the credentials of the person who is willing to fill the form. And there is a proper Java code written for that purpose which should only be used in order to contact LDAP server as per our insti rules. I ran the .jsp code by installing tomcat7 and it is working perfectly. But, now the problem I had written some code for filling form etc.. in ruby on rails. But, I am not able to use this .jsp file in the login form in rails. I searched a lot on net but I didnt found any.
Apart from this another problem is how to run my java Gale-Shapely code in background? One solution is again re-writing the entire code in ruby and use database info to run algo. Is there any method that I can give my database info to this java program and capture its output?
I solved this by using netldap gem present in rails. I realized that similar to the java code which uses an LDAP library, there is this netldap library in ruby. So, I used it to get the credentials and verify the identity of person and also to get other details from LDAP server.

How do i make my windows command line more user friendly for running Ruby on rails?

I am new to RoR and am looking for a way, if possible, to make the Windows command line more user friendly like the mac system. Specifically an easier way to copy and paste, such as using short cut keys, but other suggestions are welcome to. So far I have managed to re-size the window and change the font and font size.
Please keep in mind that i am not technically proficient in this area and answers with steps would be greatly appreciated.
Thanks
Download GitBash :D
Here's a link: GitBash installation links and howto
It'll use bash instead of window's CLI, and makes stuff like GIT or SSH a breeze.
How to copy and paste the output of commands/files to clipboard with gitbash
Link

Where do I put the files I want to be displayed on my webpage on my webhost?

So I just finished the railstutorial.org twitter clone example and I want to put it online with my web hosting provider bluehost. Right now all I have is a file called sample_app with all of the rails stuff in it. And it works fine when I visit it on localhost:3000.
So I go to my bluehost file manager and there are 9 different folders, like public_html, public_ftp, rails_apps, www, tmp, access_logs, ect. Ive uploaded sample_app into this overall directory and into the public_html directory itself. But when I visit my website it just displays the html in a default.html file in the public_html directory.
What exactly is telling my hosting service to use public_html/default.html of any of the hundereds of different files and folders that are in other places on my server space? How do I find this thing and tell it to instead use sample_app or public_html/sample_app and then process everything in that to display my rails application?
Ive tried using bluehost support and they emailed me and said this would be accomplished by creating a symlink which links ~/rails_apps/NinetyNine/public to ~/public_html. I have no idea how to do this and the guides I find online all tell me to enter a series of commands. I dont know whether to do this in a terminal on my ubuntu system or some command prompt that bluehost provides. If it is at a terminal on my system which directory should I be in? any attempts I have made on my system have resulted in a no such file or directory error. When I asked bluehost to explain this they said that this was outside of the scope of their support and had to do with web development not hosting. It struck me as odd that they were unwilling to explain their own response to my problem but whatever.
If anyone of you could help me or point me in the right direction I would very much appreciate it. Thank you
What is telling my hosting service to use public_html/default.html ?
That would be a setting the web server configuration, probably Apache.
In Apache's case, the public_html directory is usually enabled with the
UserDir directive.
The default.html, is also an Apache configuration, DirectoryIndex.
Answering these because you asked: but typically, the global Apache configuration
is maintained by your provider (though you usually have some means to customize
parts of it).
Create the symlink from public_html to
They like gave you a command like (maybe not exactly)
$ ln -s ~/rails_apps/NinetyNine/public public_html
That is something that is intended to be run on your webhost, from a command prompt,
at the top of your home directory.
Look for docs on bluehost for finding out how to get SSH shell access.
That's where you'll enter the command.
More generally, however, you want to make sure you read the docs on how your
provider wants you to upload applications. Bluehost seems to have very nice
docs here:
https://my.bluehost.com/cgi/help/rails
Why your hosting provided said it was out of scope.
You're a beginner, and that's officially OK. Welcome!
But if you asked them a question like "Do I enter these commands on my computer
or yours", they are definitely going to politely respond that this out of scope;
meaning -- "We can't hand-hold you through this". If you ran a gas station and
someone asked you how to use the pump, you'd tell them. But if they then asked
"OK but do I put the gas in my car or yours?" you'd be reluctant to answer, because
there's some fundamental missing.
So how do I get more pointers, directions on this stuff?
Lots of approaches. By the far the best is to do as much stuff as you can on
your own computer. In your case, you could easily set up your own Apache
(Macs and Linux frequently ship with it - readily installable on Windows), and
that would clear up a lot of the conceptual issues.
Good luck!

Resources