Ruby Cheatsheet



  • Site menu:
  1. Ruby Regex Cheat Sheet
  2. Ruby Cheatsheet Github
  3. Ruby Codecademy
Ruby cheat code

Reverse Shell Cheat Sheet If you’re lucky enough to find a command execution vulnerability during a penetration test, pretty soon afterwards you’ll probably want an interactive shell. If it’s not possible to add a new account / SSH key /.rhosts file and just log in, your next step is likely to be either trowing back a reverse shell. Regular Expressions Cheat Sheet for Python, PHP, Perl, JavaScript and Ruby developers. The list of the most important metacharacters you'll ever need. Ruby cheatsheet This is a cheatsheet for Ruby beginners and contains links to resources and some simple examples to get started with Ruby.

Posted by xmodulo on Apr 2, 2021 3:03 AM EST
Xmodulo; By Dan Nanni
Mail this story
Print this story

Main power of tcpdump packet sniffing tool comes from its flexible packet filtering rules and versatile protocol dissector. As you may know, only the sky is the limit when it comes to packet-level monitoring with tcpdump. This post provides a comprehensive tcpdump cheat sheet with detailed examples.

Main power of tcpdump packet sniffing tool comes from its flexible packet filtering rules and versatile protocol dissector. As you may know, only the sky is the limit when it comes to packet-level monitoring with tcpdump. This post provides a comprehensive tcpdump cheat sheet with detailed examples.

Nav
» Read more about: Story Type: Tutorial; Groups: Linux

This topic does not have any threads posted yet!

You cannot post until you login.


Ruby Regex Cheat Sheet

  • PDF Link: cheatsheet-ruby-A4.pdf, Category: languages
  • Blog URL: https://cheatsheet.dennyzhang.com/cheatsheet-ruby-A4
  • Related posts: Golang CheatSheet, Python CheatSheet, #denny-cheatsheets
Ruby Cheatsheet

File me Issues or star this repo.

1.1 Summary

NameComment
Check syntaxruby -c my.rb
Generate random keyr = Random.new, r.rand(10...42)
Install ruby 2.4GitHub: Ubuntu install ruby 2.4
Install package with specific versiongem install rubocop -v '0.44.1'
Install package with a range of versionsgem install rails -v '~>4.0.0'
Install package with a range of versionsgem install rails -v '>3.1, <4.1'
Get RubyGem envgem env
Check whether variable is nilif value.nil?
Run system commandsystem('commandhere')
Run bash commandstdin, stdout, stderr = Open3.popen3('ls .')

1.2 List

Ruby Cheatsheet Github

NameComment
Check existence[‘Cat’, ‘Dog’, ‘Bird’].include? ‘Dog’
Find iteml1.find_index(x)
Remove item from listl1.delete_at(2)
Remove duplicate entries[1,2,2,1,4,4,5,6,7,8,5,6].uniq
Deep copy a listl1=l.dup

1.3 String

NameComment
Substringstring[1..3]
Search substring“option=name=bob”.index(“name”)
Replace“Welcome to PHP Essentials!”.gsub(“PHP”, “Ruby”)
Remove trailing comma“ab;123;”.chomp(“;”)
Strip whitespacehost = host.strip()

1.4 Integer

1.5 Conversion

NameComment
Convert string to int“14”.toi, “1,112”.delete(‘,’).toi
Round float to 2 digits(5.65235534).round(2)
Format datetimeputs time.strftime('%Y-%m-%d %H:%M:%S')

1.6 Dict & Set

1.7 File

NameComment
Check whether directory existFile.directory?('xxx')
Check whether files existFile.file?('hello.rb')
Read file to stringcontents = File.read('filename')
  • Write to file

Ruby Codecademy

Ruby cheat sheets

1.8 Code Snippets

  • Get ip from eth0
  • Get hostname
  • Get hostname from ip
Ruby Cheatsheet

1.9 More Resources