How to keep MS teams always active, available, green status

1. Create a file called scroll.ps1 in a directory of your choice. The file can be named anything, but file extension needs to be .ps1

2. Copy following code to it.

Clear-host
Echo "Toggling Scrolllock..."
$WShell = New-Object -com "Wscript.Shell"
while ($true) {
$WShell.sendkeys("{SCROLLLOCK}")
Echo "1.."
Start-Sleep -Milliseconds 200
$WShell.sendkeys("{SCROLLLOCK}")
Start-Sleep -Seconds 250
Echo "2.."
}

3. Right click the file and select "Run with Powershell"

Rails Active Storage

What is Active Storage?

Active storage facilitates uploading files to cloud storage and attaching those files to Active Record objects.

Which storage services are supported?

Amazon S3, Google cloud, Microsoft Azure etc. as well as local disk-based service

Requirements

Various features of Active Storage depend on third-party software which Rails will not install, and must be installed separately:

Rails warning shebang line ending with \r - Lessons Learned 8

I was getting following error.

$ rails s
/home/uday/.rbenv/versions/2.7.5/bin/ruby: warning: shebang line ending with \r may cause problems

How I fixed it?

I navigated to the ruby file located in the bin folder(bin/rails). At the bottom of the Visual Studio Code editor(status bar), you should be able to see a button CRLF(control character). Click on it and change it to LF.

This is because Windows uses by default uses the CRLF control character and now that you are using a Windows subsystem for Linux, the control character should be LF

Rails error - Address already in Use - Lessons Learned 7

When I tried to start rails server $rails s

I was getting following error.

Address already in use - bind(2) for "127.0.0.1" port 3000 (Errno::EADDRINUSE)

This meant that the process was running already.

How I fixed it?

$ lsof -wni tcp:3000
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
ruby    55037 uday   15u  IPv4 359795      0t0  TCP 127.0.0.1:3000 (LISTEN)
ruby    55037 uday   16u  IPv6 359796      0t0  TCP [::1]:3000 (LISTEN)
$ kill -9 55037  # 55037 is the process id.
$ lsof -wni tcp:3000
$ rails s

Install Rails 7, Bootstrap using importmap (Part 2)

As seen in previous post, I tried to install Rails 7 and Botstrap using command:

$rails new app-name -j esbuild --css bootstrap

The problem with this approach is

  • It does not install importmap which is recommended default for Rails 7.
  • It installed so many node_modules.
  • I could not install Font Awesome because I did not have importmap.

So my thinking was to create a new Rails 7 app (so that Importmap will be default) and THEN ADD Bootstrap to it.