Skip to content

Welcome to Tech by Example

Menu
  • Home
  • Posts
  • System Design Questions
Menu

Posts

What does chmod o+w command mean in bash or terminal

Posted on August 9, 2021August 9, 2021 by admin

Overview There are three components that are in the picture when it comes to managing the permissions of a file.  User – Abbreviated by ‘u’ Group – Abbreviated by ‘g’ Other– Abbreviated…

JSON parse a file or string in Ruby Language

Posted on August 7, 2021August 7, 2021 by admin

Overview json module of ruby can be used a JSON parse a file or string in ruby language https://ruby-doc.org/stdlib-2.6.3/libdoc/json/rdoc/JSON.html It provides a parse function that can be used to parse a file….

Run Ruby language code in command line or terminal – Single-line and Multiline

Posted on August 7, 2021August 7, 2021 by admin

Overview It is possible to run a ruby code directly on a command line or the terminal itself.  We need to pass the -e flag. This is the syntax for the same…

How to handle failure in a command in bash or terminal

Posted on August 7, 2021August 7, 2021 by admin

Overview In case the failure of the command should not stop the execution of the program,  then the below way can be used.  If the command fails then the output will be…

Check if a file is writable or not in Ruby language

Posted on August 4, 2021August 4, 2021 by admin

Overview File class of ruby provides the below method that can be used to check if a file is writable by the effective user and group id of the current process. Here…

Get or Extract Query Params from a URL in Ruby Language

Posted on July 28, 2021July 28, 2021 by admin

Overview URI module can be used to parse a URL and extract all parts https://ruby-doc.org/stdlib-2.5.1/libdoc/uri/rdoc/URI.html Once the given URL is parsed correctly, then it will return the URI object. We can then…

Get full hostname and port from a URL in Ruby Language

Posted on July 26, 2021July 26, 2021 by admin

Overview URI module of ruby can be used to get all parts from a URL.  This module can be used to parse a URL and extract all parts https://ruby-doc.org/stdlib-2.5.1/libdoc/uri/rdoc/URI.html Once the given…

Convert Query Param String to Query Param Hash in Ruby Language

Posted on July 23, 2021July 23, 2021 by admin

Overview Assume we have below query param string We want the output as Program Below is the program for the same Output

Extract a URL from a string in Ruby Language

Posted on July 23, 2021July 23, 2021 by admin

Overview URI module can be used to extract URL from a given string https://ruby-doc.org/stdlib-2.5.1/libdoc/uri/rdoc/URI.html We can use the Extract method of the URI module https://ruby-doc.org/stdlib-2.5.1/libdoc/uri/rdoc/URI.html#method-c-extract Below is the signature of the method…

Parse a URL and extract all the parts in Ruby Language

Posted on July 23, 2021July 23, 2021 by admin

Overview URI module can be used to parse a URL and extract all parts https://ruby-doc.org/stdlib-2.5.1/libdoc/uri/rdoc/URI.html Once the given URL is parsed correctly, then it will return the URI object. We can then…

Posts pagination

Previous 1 … 13 14 15 16 Next
©2025 Welcome to Tech by Example | Design: Newspaperly WordPress Theme