Macbok M2 – Ruby on Rails installation – Problem [Solved]

Ruby – User RVM for Ruby installation and use ruby version greater than 3 for better performance.


Install via official site

use youtube link how to install mysql here.

Add below line in ~/.bash_profile file :

export PATH=${PATH}:/usr/local/mysql-8.0.33-macos13-arm64/bin

where you may have to change mysql version in the path ie. mysql-8.0.33-macos13-arm64 to your mysql bin path.

It took more than 24 hours to solve this problem so I posted it in my blog here.

Thanks & Regards,

Manish Shrivastava

PWA enabled website

  1. Create your website code.
  2. Create manifest.json in the home directory with below code.
  "name": "My One Page PWA",
  "short_name": "PWA",
  "description": "A simple one-page PWA",
  "start_url": "/index.html",
  "display": "standalone",
  "background_color": "#ffffff",
  "theme_color": "#000000",
  "icons": [
      "src": "icons/icon-192x192.png",
      "sizes": "192x192",
      "type": "image/png"
      "src": "icons/icon-512x512.png",
      "sizes": "512x512",
      "type": "image/png"

3. Link manifest.josn in your project index file.

<link rel="manifest" href="/manifest.json">

4. Create a service-worker.js file.

self.addEventListener('install', (event) => {
  event.waitUntil('my-cache').then((cache) => {
      return cache.addAll([

self.addEventListener('fetch', (event) => {
    caches.match(event.request).then((response) => {
      return response || fetch(event.request);

5. Add the Register the service worker code to your main JavaScript file ( i.e. app.js)

if ('serviceWorker' in navigator) {
  window.addEventListener('load', () => {
      .then((registration) => {
        console.log('Service worker registered:', registration);
      .catch((error) => {
        console.error('Service worker registration failed:', error);

6. Host your website in HTTPS

7. Test your website via Chrome’s Lighthouse or the Application panel in Chrome DevTools.


How Ruby Developer can learn Blockchain development?

Question: I am a 10 year experienced ruby developer, I want to work in blockchain which language will I have to learn


As Ruby (widely used for Rails development) is not used directly for Blockchain development. You will have to learn a language which is more compatible with Blockchain development. i.e. Solidity, Golang, C++ Or Node.js

So, you will likely need to learn Solidity for developing smart contracts on the Ethereum blockchain.

Solidity is a high-level programming language that is similar to JavaScript and is designed specifically for writing smart contracts that run on the Ethereum Virtual Machine (EVM) It is a statically typed language that supports inheritance, libraries, and complex user-defined types.

Solidity is not the only language used in blockchain development, but it is the most widely used for smart contract development on the Ethereum platform. Other blockchain platforms may use different languages, such as Golang for the Hyperledger Fabric blockchain, or C++ for the EOS blockchain.

While your experience with Ruby will not directly translate to Solidity or other blockchain languages, your existing programming knowledge and experience should help you learn and adapt quickly. You may want to start by studying Solidity‘s syntax, data types, and control structures, as well as its specific features related to blockchain development such as interacting with the blockchain, managing transactions and handling errors.

Get started Learning BlockChain

Learn Solidity Programming Language: This is designed for developing smart contracts that run on Ethereum. Click here to get started with Solidity.

Learn Flat and Relational DB

Learn Data Structure: i.e. Stack, LinkedList, and Queue.

Learn Terms related with blockchain ie. Mining, Public Distributed Ledger, Hash Encryption, Proof of work etc.

Learn How does Ethereum, HyperLedger, Hashgraph works?

Understand the Economics behind blockchain:

  1. Cryptography and Economics
  2. Cryptography in blockchain invoices hashing, Digital Signatures, and Proof of Work
  3. Hashing uses a cryptography algorithm using (sha256 in bitcoin and ethash in ethereum)
  4. Digital Signature: Private Key and Public Key.
  5. POW requires a miner to solve a mathematical puzzle to be able to add a block to the blockchain

Start Coding and Creating your own smart contract.Create own distributed application in Ethereum.

PHP, Rails, dJango developer to Web 3.0 development Guide

Web 2.0 refers to the second generation of the World Wide Web, which emphasized the ability of users to interact and collaborate with each other online. This was made possible by the development of web-based social networking sites, wikis, blogs, and other interactive technologies.

Web 3.0, also known as the “Semantic Web,” refers to the next generation of the web, which is expected to be more intelligent and able to understand and interpret the meaning of the data on the web. It is based on technologies such as artificial intelligence and machine learning, and it is designed to enable computers to understand and process the data on the web in a more human-like way. Web 3.0 is still in development and it is not yet clear exactly what form it will take or how it will be used, but it has the potential to revolutionize many aspects of the internet and the way we use it.

Web3 is a term that refers to the next generation of the World Wide Web, which is expected to be more decentralized and distributed than the current web. It is based on technologies such as blockchain and peer-to-peer networking, and it is designed to enable users to have more control over their online data and interactions. Web3 technologies are still in development, and it is not yet clear exactly what form they will take or how they will be used, but they have the potential to revolutionize many aspects of the internet and the way we use it.

Ok, Now Let’s understand what is BlockChain?

A blockchain is a digital record-keeping system that is decentralized and distributed. It is made up of a series of blocks that are connected in a chain, with each block containing a record of multiple transactions. The transactions are secured through cryptography, and once they are recorded in a block, they cannot be altered.

One of the main benefits of a blockchain is that it allows multiple parties to trustlessly record and verify transactions without the need for a central authority. This makes it a secure and transparent way to store and transfer data and assets. Blockchains are used in a variety of applications, including cryptocurrency, supply chain management, and voting systems.

For a Web Developer, What is what will be the difference from normal web hosting to a blockchain project hosting ?

There are several key differences between hosting a traditional web application and hosting a blockchain project:

Decentralization: One of the main characteristics of blockchain technology is that it is decentralized, meaning that it is not controlled by any single entity. This is in contrast to traditional web hosting, which is usually centralized and relies on servers owned and operated by a single company.

Consensus: In a blockchain, transactions are validated and added to the ledger through a process called consensus, in which participating nodes agree on the validity of the transactions. This is in contrast to traditional web hosting, where a single server or database is responsible for storing and processing transactions.

Scalability: Blockchain projects can be more challenging to scale than traditional web applications due to the need for consensus among participating nodes. This can make it more difficult to add new users or increase transaction volume.

Security: Blockchain technology is generally considered to be more secure than traditional web applications due to the decentralized nature of the network and the use of cryptography to secure transactions.

Costs: Hosting a blockchain project can be more expensive than hosting a traditional web application due to the need for specialized hardware and the resources required to maintain and secure the network.

BlockChain and It’s Uses in Hospital, Cryptocurrencies and Games development

Blockchain is a distributed ledger technology that allows multiple parties to record and verify transactions without the need for a central authority. It consists of a network of computers that each maintain a copy of a shared digital ledger, which records transactions in a secure and transparent manner.

One of the main uses of blockchain is to enable secure and transparent financial transactions. For example, it can be used to facilitate the exchange of cryptocurrencies, such as Bitcoin. Blockchain can also be used to track the ownership of assets, such as real estate or art, and to enable secure and efficient supply chain management.

In addition to its use in financial and business applications, blockchain has the potential to revolutionize a wide range of industries, including healthcare, education, and the public sector, by providing a secure and transparent way to store and transfer data.

BlockChain uses in Hospital Management:

Blockchain technology has the potential to transform the way healthcare is managed and delivered. Some potential applications of blockchain in hospital management include:

  1. Electronic medical records: Blockchain could be used to store and manage electronic medical records (EMRs) in a secure and transparent manner. This could help to improve the accuracy and accessibility of patient records, as well as reduce the risk of errors and fraud.
  2. Clinical trial management: Blockchain could be used to track and verify the results of clinical trials, ensuring that the data is accurate and cannot be altered. This could help to improve the integrity and reliability of clinical research.
  3. Supply chain management: Blockchain could be used to track the movement of medical supplies and equipment, helping to ensure that the right products are delivered to the right place at the right time.
  4. Payment processing: Blockchain could be used to facilitate secure and efficient payment processing for healthcare services, reducing the risk of fraud and errors.
  5. Data sharing: Blockchain could be used to enable secure and efficient data sharing between different healthcare providers, helping to improve patient care and coordination.

Overall, the use of blockchain in healthcare has the potential to improve the efficiency, security, and transparency of hospital management, ultimately leading to better patient care.

BlockChain uses in Game Management:

Blockchain technology has the potential to transform the game industry in a number of ways. Some potential uses of blockchain in game development include:

  1. In-game asset ownership: Blockchain can be used to track the ownership of in-game assets, such as virtual items or currencies. This can help to ensure that players have true ownership of the assets they acquire in-game, rather than simply having a license to use them.
  2. In-game marketplaces: Blockchain can be used to facilitate secure and transparent in-game marketplaces, where players can buy and sell in-game assets. This can help to create more vibrant and active in-game economies.
  3. Game development funding: Blockchain can be used to facilitate crowdfunding for game development projects. This can help to democratise the process of game development and enable more independent developers to get their projects off the ground.
  4. In-game voting: Blockchain can be used to enable players to vote on game updates and other decisions related to the game. This can help to create more community-driven and player-driven games.

Overall, the use of blockchain in game development has the potential to create more immersive and engaging gaming experiences, as well as more transparent and fair economic systems within games.

BlockChain uses in Coin/Cryptocurrencies:

Blockchain technology is often used in the development of cryptocurrencies, also known as coins. Some specific ways in which blockchain is used in coin development include:

  1. Secure and transparent record-keeping: Blockchain technology allows for the secure and transparent tracking of transactions, which is essential for the proper functioning of a cryptocurrency.
  2. Decentralized control: Cryptocurrencies are often designed to operate without a central authority, relying instead on a decentralized network of computers to verify and record transactions. This is made possible by the use of blockchain technology.
  3. Smart contracts: Some cryptocurrencies make use of smart contracts, which are self-executing contracts with the terms of the agreement between buyer and seller being directly written into lines of code. These smart contracts can be implemented on the blockchain, enabling secure and automated execution.
  4. Tokenization: Blockchain can be used to create tokens, which are digital assets that can represent a variety of things, including currencies, assets, or even voting rights. These tokens can be used in conjunction with cryptocurrency development.

Overall, blockchain technology plays a key role in the development of cryptocurrencies, enabling secure and transparent record-keeping, decentralised control, and the use of smart contracts and tokens.


There are many emerging technologies that have the potential to have a significant impact in the near future. Some of the most promising and exciting areas of technological development include:

  1. Artificial intelligenceand machine learning: These technologies are already having a significant impact on many industries, and their potential for further development is vast.
  2. Internet of Things (IoT): The IoT refers to the growing network of physical devices, vehicles, buildings, and other objects that are equipped with sensors and connected to the internet, enabling them to collect and exchange data.
  3. 5G: The next generation of cellular technology, 5G, is expected to bring faster data speeds and more reliable connections, which could enable a range of new applications and services.
  4. Virtual and augmented reality: These technologies have the potential to transform the way we work, learn, and interact with the world around us.
  5. Blockchain: This distributed ledger technology has the potential to revolutionise industries ranging from finance to supply chain management by providing a secure and transparent way to store and transfer data.
  6. Robotics: Advances in robotics technology are enabling the development of more advanced and capable machines that can assist with a wide range of tasks.
  7. Quantum computing: This technology has the potential to significantly increase computing power and could enable the development of new materials, drugs, and other breakthroughs that are currently beyond our reach.
  8. Renewable energy: As concerns about climate change continue to grow, there is increasing interest in technologies that can provide clean and renewable sources of energy.

How much a Rails update cost in the project?

Being a Rails update expert, I would like to suggest updating the ROR version. It will cost ZERO.

Did you hear correct! YES.

It will not cost you if done on time with a good resource with proper plan. Otherwise, It cost your customer trust which is invaluable.

Sometimes if the project running well on the live server with a handful of customers without any issue, rails update is taken less seriously.

also, Rails update is not considered as important task. But it may cost a lot if website may go down due to unsupported version of any third party dependencies mismatch.

SoX – Sound eXchange ubuntu commands

SoX is a cross-platform (Windows, Linux, MacOS X, etc.) command line utility that can convert various formats of computer audio files in to other formats. It can also apply various effects to these sound files, and, as an added bonus, SoX can play and record audio files on most platforms.

The screen-shot to the right shows an example of SoX first being used to process some audio, then being used to play some audio files.

10 Awesome Examples to Manipulate Audio Files Using Sound eXchange (SoX)

1. Combine Multiple Audio Files to Single File

using sox -m command mix the two audio file using terminal

$ sox -m first_part.wav second_part.wav whole_part.wav


$ soxmix first_part.wav second_part.wav whole_part.wav

2. Extract Part of the Audio File

Trim can trim off unwanted audio from the audio file. and set the custome starting and end time.

$ sox old.wav new.wav trim [SECOND TO START] [SECONDS DURATION].

  • SECOND TO START – Starting point in the voice file.
  • SECONDS DURATION – Duration of voice file to remove

The command below will extract first 15 seconds from input.wav and stored it in output.wav

$ sox input.wav output.wav trim 0 10

3. Increase and Decrease Volume Using Option -v

Option -v is used to change (increase or decrease ) the volume.

increase volume : –

$ sox -v 2.0 foo.wav bar.wav

decrease volume : –

$ sox -v -0.5 srcfile.wav test05.wav

$ sox -v -0.1 srcfile.wav test01.wav

4. Play an Audio Song

Sox provides the option for playing and recording sound files. This example explains how to play an audio file on Unix, Linux.

Syntax :play options Filename audio_effects

$ play -r 8000 -w music.wav

5. Play an Audio Song Backwards

Use the ‘reverse’ effect to reverse the sound in a sound file. This will reverse the file and store the result in output.wav

$ sox input.wav output.wav reverse

You can also use play command to hear the song in reverse without modifying the source file as shown below.

$ play test.wav reverse

6. Record a Voice File

You can also use rec command for recording voice. If SoX is invoked as ‘rec’ the default sound device is used as an input source.

$ rec -r 8000 -c 1 record_voice.wav

7. Changing the Sampling Rate of a Sound File

To change the sampling rate of a sound file, use option -r followed by the sample rate to use, in Hertz. Use the following example, to change the sampling rate of file ‘old.wav’ to 16000 Hz, and write the output to ‘new.wav’

$ sox old.wav -r 16000 new.wav

8. Changing the Sampling Size of a Sound File

If we increase the sampling size , we will get better quality. Sample Size for audio is most often expressed as 8 bits or 16 bits. 8bit audio is more often used for voice recording.

-b Sample data size in bytes
-w Sample data size in words
-l Sample data size in long words
-d Sample data size in double long words

$ sox -b input.wav -w output.wav

9. Changing the Number of Channels

The following example converts mono audio files to stereo.  Use Option -c to specify the number of channels .

$ sox stereo.wav -c 1 mono.wav avg -l

10. Speed up the Sound in an Audio File

To speed up or slow down the sound of a file, use speed to modify the pitch and the duration of the file. This raises the speed and reduces the time. The default factor is 1.0 which makes no change to the audio. 2.0 doubles speed, thus time length is cut by a half and pitch is one interval higher.

Syntax: sox input.wav output.wav speed factor

$ sox input.wav output.wav speed 2.0

Happy coding ..

Top 5 JavaScript framework for Web Developers

If you want to land a great JavaScript job or catch up on important tech for 2020 and important technologies in the new decade, this post is for you. The point of this post is not to tell you which tech stacks and frameworks are the “best” or most loved or most popular — but to shed some light on which ones give you the best odds of landing a great job in 2020 and beyond.It can be really hard to find the perfect framework for your requirements. In this article on the best JavaScript framework for 2020.

5 JavaScript frameworks : –

1. React js

React is a JavaScript library for building user interfaces. React js is most popular JavaScript frame work for front end web page designing and currently every front end developer react js is a first choice.

React is a front-end library developed by Facebook. It is used for handling the view layer for web and mobile apps. ReactJS allows us to create reusable UI components. It is currently one of the most popular JavaScript libraries and has a strong foundation and large community behind it.

2. Vue js

Vue js is a progressive framework for building user interfaces. Unlike other monolithic frameworks, Vue is designed from the ground up to be incrementally adoptable.

The core library is focused on the view layer only, and is easy to pick up and integrate with other libraries or existing projects. On the other hand, Vue is also perfectly capable of powering sophisticated Single-Page Applications when used in combination with modern tooling and supporting libraries.

3. Angular js

Angular is one of the most powerful and open-source JavaScript frameworks. Google operates this framework and is designed to use it to develop a Single Page Application (SPA).

This development framework is known primarily because it gives developers the best conditions to combine JavaScript with HTML and CSS. Over half a million websites, such as,, etc., use Angular.

jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.

With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript.

5, Node.js

Node.js is an open-source, server-side platform built on the Google Chrome JavaScript Engine. The number of websites. It is one of the most downloaded, cross-platform runtime environments for running JavaScript code.

Node.js is an asynchronous, single-threaded, non-blocking I/O model that makes it lightweight and efficient. The Node.js package ecosystem, npm, is also the largest open-source library ecosystem in the world.

Happy coding ….

#javascript #framework