Monday, June 06, 2022

Compass

Who are the other players delivering the same functions?

Which player will win the inevitably win the IFR game in the long term?

What implications does this have on the business we are thinking of starting?


Saturday, May 28, 2022

Caddy Server Topics

Install Caddy Server

Caddy Server - Hello World

Caddy Server - API

Deploying Static Site using Caddy Server

Deploying Node.js app using Caddy Server

Deploying Zally using Caddy Server (Replace nginx and Apache with Caddy)

Caddy Server as Reverse Proxy for Micro Services

Using Caddy Server with a Rails app on EC2

Deploy a Dynamic Webapp on a Custom Domain using Caddy Server

Sunday, May 22, 2022

Bad Characteristics of the Developer Tool

 Plays loud and horrible music on page load

Displays dropping snow flakes

Displays lot of banner ads

Loads lot of images very slowly

Broken images and links on the page

Has many distractions on the page

Loads a blank page on the screen

Loads flashing headlines on the page

Loads animated gifs 

Overlay popup hides the page

Does not have any outcome

Links to unnecessary features

Lack of balance between design and content

Prompts installation of Java and flash to load applets and flash player

Not using web safe fonts

No button to click (no way to navigate)

Loading large images 

Too much text

No whitespace

No clear user journey

Slow site speed

100% bounce rate

No one completes the entire flow

No SSL

Completed Tasks for Keyword Research of OpenAPI Developer Tool

  • Search Google for "OpenAPI", check the results for relevance
  • Search Amazon for "OpenAPI", check the results for relevance
  • Search Google trends for "OpenAPI", worldwide and for the past 5 years.

Compare your keyword with: orchid care, improve memory, leadership skills, beekeeping and see if it falls within similar search volume. It falls within the profitable bandwidth.


Elevator Pitch for Zally

Zally is a linter for OpenAPI specifications.

  1. Capable of checking RESTful API design standards
  2. Gives early feedback for API designers
  3. Provides best practices and advices

Its standard configuration will check your APIs against the rules defined in Zalando's RESTful Guidelines, but anyone can use it out-of-the-box.

Web UI shows implemented rules and lints external files and inline API definitions.

Features

  • Support for OpenAPI 3 and (Swagger) OpenAPI 2 specifications
  • RESTful API, CLI and Web interface
  • Rich Check configuration
  • Ignore functionality (x-zally-ignore extension)
  • Java/Kotlin API for new Checks + helper functions

Monday, February 21, 2022

Installing mysql2 gem on Mac OS Monterey M1 chip

 gem install mysql2 -- --srcdir=/usr/local/mysql/include

bundle config --local build.mysql2 "--with-ldflags=-L/opt/homebrew/Cellar/zstd/1.5.2/lib"
bundle

fatal error: Unable to locate credentials

 Command:

$ aws s3 rm s3://YOUR_BUCKET/ --recursive --dryrun --exclude "*" --include "my-folder/*"


Run aws configure and provide the access key and secret key when prompted

Unsupported Python version detected: Python 2.7

Error:

Unsupported Python version detected: Python 2.7

To continue using this installer you must use Python 3.6 or later.

For more information see the following blog post: https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-python-2-7-in-aws-sdk-for-python-and-aws-cli-v1/


Change this command:

 sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

to

sudo /usr/bin/python3 ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws




Thursday, February 10, 2022

pyspark Installation

Install Latest Python

sudo apt update

 sudo apt -y upgrade

 python3 -V

Install Development Tools

sudo apt install -y build-essential libssl-dev libffi-dev python3-dev

sudo apt install software-properties-common -y

sudo add-apt-repository ppa:deadsnakes/ppa

sudo apt install python3.10

Install PIP 

sudo apt install -y python3-pip

Install pyspark

pip install pyspark

source ~/.profile

sudo apt install default-jdk scala git

Verify Spark Installation

pyspark

Python 3.8.10 (default, Nov 26 2021, 20:14:08) 

[GCC 9.3.0] on linux

Welcome to SPARK   version 3.2.1

Using Python version 3.8.10 (default, Nov 26 2021 20:14:08)

Spark context Web UI available at http://dollar.lan:4040

Spark context available as 'sc' (master = local[*], app id = local-1644524108365).

SparkSession available as 'spark'.

>>> big_list = range(1000)

>>> rdd = sc.parallelize(big_list, 2)

>>> odds = rdd.filter(lambda x:x %2 != 0)

>>> odds.take(5)

[1, 3, 5, 7, 9]                                  

Ctrl-D to exit


Wednesday, December 01, 2021

Rails 7 Sample Project

1. gem install rails -v v7.0.0.alpha2

2. rails new blog --css tailwind

3. rails g scaffold post title

4. rails action_text:install
5. rails db:create db:migrate

        Monday, November 29, 2021

        Share Folder in Mac with Multipass Ubuntu Instance

         Share Folder


        multipass mount local/folder/path multipass-instance-name

        multipass mount /Users/bparanj/cloud gold


        multipass info gold

        Name:           gold

        State:          Running

        IPv4:           192.168.64.2

        Release:        Ubuntu 20.04.3 LTS

        Image hash:     91740d72ffff (Ubuntu 20.04 LTS)

        Load:           0.71 0.53 0.32

        Disk usage:     2.6G out of 4.7G

        Memory usage:   241.0M out of 981.3M

        Mounts:         /Users/bparanj/cloud => /Users/bparanj/cloud

                            UID map: 501:default

                            GID map: 20:default

        Saturday, November 27, 2021

        ssh into multipass instance

         Launch Ubuntu instance:

        multipass launch --name gold   

        Copy the IP address from:

        multipass list 

        Log in to multipass instance:

        sudo ssh -i /var/root/Library/Application\ Support/multipassd/ssh-keys/id_rsa ubuntu@192.168.64.2



        Friday, November 19, 2021

        Tuesday, November 09, 2021

        Postgresql Post Install Message

         To migrate existing data from a previous major version of PostgreSQL run:

          brew postgresql-upgrade-database


        This formula has created a default database cluster with:

          initdb --locale=C -E UTF-8 /opt/homebrew/var/postgres

        For more details, read:

          https://www.postgresql.org/docs/14/app-initdb.html


        To restart postgresql after an upgrade:

          brew services restart postgresql

        Or, if you don't want/need a background service you can just run:

          /opt/homebrew/opt/postgresql/bin/postgres -D /opt/homebrew/var/postgres


        Zoom Link:

        sqlite3 install

        After brew install, the output: 

        If you need to have sqlite first in your PATH, run:

          echo 'export PATH="/opt/homebrew/opt/sqlite/bin:$PATH"' >> ~/.zshrc


        For compilers to find sqlite you may need to set:

          export LDFLAGS="-L/opt/homebrew/opt/sqlite/lib"

          export CPPFLAGS="-I/opt/homebrew/opt/sqlite/include"


        For pkg-config to find sqlite you may need to set:

          export PKG_CONFIG_PATH="/opt/homebrew/opt/sqlite/lib/pkgconfig"

        Monday, November 08, 2021

        Warning! PATH is not properly set up

        Warning! PATH is not properly set up, /Users/n1576925/.rvm/gems/ruby-3.0.2/bin is not at first place.

                 Usually this is caused by shell initialization files. Search for PATH=... entries.

                 You can also re-add RVM to your profile by running: rvm get stable --auto-dotfiles

                 To fix it temporarily in this shell session run: rvm use ruby-3.0.2

                 To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.


        In MacOS Monterey, add the following to .bash_profile:


        # RVM can encounter errors if it's not the last thing in .bash_profile

        export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to path for scripting (to manage Ruby versions)

        export PATH="$GEM_HOME/bin:$PATH"


        [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*


        The .zshrc has only one line:

        source ~/.bash_profile


        Tuesday, September 07, 2021

        Rails on Docker Tips

        1. Reduce size of the image

        RUN apt-get clean && rm -f /var/lib/apt/lists/*_*

        2. Combine update, install and clean:

        RUN apt-get update -y \

        && apt-get install -y -q package-name \

        && apt-get clean \

        && rm -f /var/lib/apt/lists/*_*

        3. Use a separate build stage

        FROM base-image AS builder

        COPY . /app

        RUN apt-get install build-essential \

        && bundle install --deployment


        FROM base-image

        COPY --from=builder /app /app

        4. Set the system locale

        RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \

        && locale-gen en_US.UTF-8

        ENV LANG en_US.UTF-8

        ENV LANGUAGE en_US:en

        5. Create an unprivileged user

        # After build

        RUN adduser -s /bin/sh -u 1001 -G root \

        -h /app -S -D rails \

        && chown -R rails /app

        USER rails

        6. Prefer exec form for CMD

        CMD ["bundle", "exec", "rails", "s"]

        7. Specify resource constraints in production

        requests:

          memory: "100Mi"

          cpu: 0.5

         limits:

          memory: "200Mi"

          cpu: 1.0

        8. Log to STDOUT or an external agent

        ENV RAILS_LOG_STDOUT=true



        Friday, August 27, 2021

        Dockerfile with caching for Rails 6.1

         FROM ruby:2.7


        LABEL maintainer="Brianna"


        RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -

        RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list


        RUN apt-get update -yqq && apt-get install -yqq \

            nodejs \

            npm \

            yarn


        RUN node -v


        COPY Gemfile* /usr/src/app/

        WORKDIR /usr/src/app


        RUN gem install bundler:'~> 2.1.4'

        RUN gem install rails

        RUN bundle install


        RUN echo $PWD

        COPY . /usr/src/app

        RUN rails webpacker:install


        CMD ["bin/rails", "s", "-b", "0.0.0.0"]


        https://drive.google.com/file/d/1nuZE88MOmMqiM2DMbur1RWPJvjUQ0rSf/view?usp=sharing

        Dockerfile for Rails 6.1

         FROM ruby:2.7


        RUN apt-get update -yqq

        RUN apt-get install -yqq nodejs npm

        RUN node -v


        RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -

        RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list

        RUN apt-get update -y

        RUN apt-get install yarn -y


        RUN gem install bundler:'~> 2.1.4'


        COPY . /usr/src/app

        WORKDIR /usr/src/app

        RUN bundle install

        RUN bin/rails webpacker:install