Wednesday 4 December 2013

Learn Ruby Language and Be an exploit coder-1





Hi Friends .
I am going to start Ruby Language tutorials by learning which u guyz will be able to Write your own exploits and also to learn other languages easily.
so im assuming that u guyz know how to install ruby on your OS, incase you guyz don't know , u can tell me i'll write an article on it aswell.




Remember, you ought to have spent a decent quantity of your time in This exersice learning a way to install a text editor, run the text editor, run the Terminal, and work with each of them. If you haven't done that then don't persist. you'll not have a decent time. this can be the sole time i will begin Associate in Nursing exercise with a warning that you simply shouldn't skip or get prior to yourself.

Type the subsequent into one file named exploit1.rb. this can be vital as Ruby works best with files ending in .rb

  • puts "Hello World!"
  • puts "Hello once more"
  • puts "I like typewriting this."
  • puts "This is fun."
  • puts 'Yay! Printing.'
  • puts "I'd abundant rather you 'not'."
  • puts 'I "said" don't bit this.'

Then in Terminal run the file by typing:

ruby exploit1.rb

If you probably did it right then you ought to see identical output I actually have below. If not, you have got done one thing wrong. No, the pc isn't wrong.

What you ought to See.


  • $ ruby exploit1.rb
  • Hello World!
  • Hello Again
  • I like typewriting this.
  • This is fun.
  • Yay! Printing.
  • I'd abundant rather you 'not'.
  • I "said" don't bit this.
  • $
You may see the name of your directory before the $ that is okay, however if your output isn't precisely the same, conclude why and fix it.

If you have got a mistake it'll appear as if this:

  • ruby exploit1.rb
  • exploit1.rb:4: programming error, surprising tCONSTANT, expecting $end
  • puts "This is fun."
  •           ^
It's important that you simply will scan these since you'll be creating several of those mistakes. Even I build several of those mistakes. Let's inspect this line-by-line.

Here we have a tendency to ran our command within the terminal to run the exploit1.rb script.
Ruby then tells U.S.A. that the file hacklikepro1.rb has a mistake on line four.
It then prints this line for U.S.A..
Then it puts a ^ (caret) character to purpose at wherever the matter is.
Finally, it prints out a "syntax error" and tells U.S.A. one thing regarding what can be the error. typically these area unit terribly cryptic, however if you copy that text into a look engine, you'll realize some other person who's had that error and you'll be able to in all probability find out a way to fix it.
Extra Credit
You will even have additional Credit. the additional Credit contains belongings you ought to try and do. If you cannot, skip it and are available back later.

For this exercise, strive these things:


Make your script print another line.
Make your script print only 1 of the lines.
Put a # (octothorpe) character at the start of a line. What did it do? try and conclude what this character will.
From currently on, I will not justify however every exercise works unless Associate in Nursing exercise is completely different.


No comments:

Post a Comment