Wednesday, June 22, 2022

Heroku Reviews - June 22, 22

 



WHAT


Deploy full stack apps (FE + BE + DB)

Deploy full stack apps without the need of all the technical skills needed for AWS

Prototyping - quick deployment

Build an entire pipeline (dev, test and prod)

Ship web apps without a lot of effort

Build app very quickly

Build, deploy and run your app very easily

Very helpful to build highly large data apps

Easy to deploy full stack applications fast without worrying about configuring


HOW


Connect your app using a Git repo and it will handle the deployment


USE


Simple and intuitive interface

Simple and easy to use, even for users with minimal knowledge of application architecture


EASY


Easy to setup

You can set up an entire environment very fast


DEPLOYMENT SPEED


Instant deployment

One-step deployment process

Their auto-maintenance and auto-deploy services saves a lot of time and effort


DEPLOYMENT EASE


Makes it easy to deploy apps without having the knowledge of managing a server

CLI tool - easy to deploy

Quick and easy deployment


INTEGRATIONS


Seamless integration with Git

Ease with which we can deliver updated code and new features

Add ons

Marketplace

Easy installation of plugins and add-ons

Integrate third-party website with Salesforce

Connect database with a single click with the help of plug in



LEARNING CURVE


Less to learn for developers


COMPLEXITY


Complexity < (AWS or GCP)


SCALING


Scales with you

Autoscale based on usage

Autoscale our platform


TOOLS


Migration tool

Powerful metrics to monitor the app


ZERO DOWNTIME


No downtime

Rolling restarts (to fix delays in requests during deploy)

Perform a rollback to a previous version with just one click


TIME SAVINGS


Saves a lot of time in creating and deploying new apps


COST SAVINGS


Streamline the process for developers and saves costs on app development

Reduced the dependence small teams have on Devops (saves costs)


DOCUMENTATION


for:

  using several environments

  tuning memory usage

  deploying from Dropbox

Detailed sample apps and code for starting a new app


SECURITY


Secure and protected ecosystem



Dev / Prod Environment Parity


Being able to switch from local to remote environment

You can work locally with remote database


WHO


Great for small teams and if you need to validate your product

Single developer or small teams can focus on the project and get it launched, without too much hassle








CONS


Once you get substantial traffic, you have to ask yourself whether your budget should focus on:


more dynos

code optimization

different platform


Support

Contract trap

License cose

Expensive

Gets expensive quickly

Non traditional server environment

Deploy fixed number of apps

Apps go to sleep if there is no user activity

Environment configuration setup is slightly complex (vs Netlify)

CI service is fairly limited (works fine with CircleCI & Travis)

Minimal language support

Low network performance

Upsell on features you may not need

To the uneducated, they will opt into unnecessary features that are otherwise free

Security add-ons like AWS would be nice

Need a separate service for repo like Github, rather than having everything inclusive

30 seconds restriction (not compatible with OS libraries)

Request gets stuck behind slow request

Hard to gauge the capacity needed

Hit by downtimes (not much to do once it goes down)

If AWS goes down Heroku will go down


SSH Basics

 We learned a little bit about the SSH protocol and how to use the ssh program to connect to a remote server.

SSH protocol was introduced for secure communication using the pub- lic key encryption on the network. OpenSSH is a collection of programs implementing this protocol and available to us.

Connecting to a remote server can be as easy as running ssh $USER@$HOST. In the case we create a server with password authentication, we can use ssh-copy-id to put the public key to the server and take advantage of SSH-keys only access.

We learned about SSH keys management. We can find our keys in ~/.ssh, generate new ones with ssh-keygen. We explored how ~/.ssh/authorized_keys is used for authorizing access using these keys and how SSH host keys are stored in ~/.ssh/known_hosts.

scp and sftp are the go-to tools for secure file transfer over SSH. Although using scp has some security implications given its original design, it’s safe to use in simple commands. rsync is another popular option.

Monday, June 13, 2022

Create a Node on VPS

  1. Signup for VPS provider such as Linode
  2. Create a node














Provisioning, Booting, Running


12 Factor App

 Heroku, with its 12-factor application model, has changed the way we think about building, deploying, and hosting web applications. 

The rise of containers, phoenix servers and continuous delivery has seen a move away from the usual approach to deploying web applications. Traditionally we have built an artifact and then installed that artifact into an application server. The result was long feedback loops for changes, increased build times and the not insignificant overhead of managing these application servers in production. Many of them are a pain to automate too. Most teams we work with favor bundling an embedded http server within your web application. There are plenty of options available: Jetty, SimpleWeb, Webbit and Owin Self-Host amongst others. Easier automation, easier deployment and a reduction in the amount of infrastructure you have to manage lead us to recommend embedded servers over application servers for future projects.

Cloud Native Apps

https://dev.to/syncsynchalt/safe-http3-experimentation-with-caddy-447f

https://requestmetrics.com/web-performance/http3-is-fast




Thursday, June 09, 2022

My notes

 

Secure Connection


  1. Establish secure connection from the workstation to the servers.
  2. Run deployment tasks
  3. Upload configuration files
  4. Log in
  5. Put the public key on the server
  6. Create a secure connection using the private key
  7. Avoid password based authentication
  8. Use SSH tunneling to reuse the connection for other services

SSH Keys


Setup passwordless login on the server

  • Use ssh-keygen to make a new pair of SSH keys
  • Create a virtual private server in the admin panel
  • Copy the SSH keys using ssh-copy-id utility for providers that setup password-based authentication

Success Criteria

Login using SSH as root

ssh root@server-hostname-or-ip-address

Remote Shell

  • Install ssh-agent on Mac OS
  • Connect to server from the client, use ssh command
  • Define USER environment variable to specify hte user on the host
  • Define HOST environment variable to specify the remote server's hostname or IP address
  • The default configuration file used is ~/.ssh/config
  • The default identity file (private key) is ~/.ssh/id_rsa
  • The identity_file, login_name and port values can be specified per host in the configuration file (~/.ssh/config)

File Transfers


Steps

  1. Signup for hosting provider
  2. Create a node
  3. Provision a node
  4. Deploy code
  5. Maintain node

  • Figure out which steps are done by the customer and which steps are done by the product.
  • Establish secure

Wednesday, June 08, 2022

MVP

 
















June 6, 2022 Tasks

Completed Tasks

  1. Deploy static blog for generating leads: https://www.deploygrid.live/
  2. Create the landing page and update the site: https://apigrid.dev/

Pending Tasks

  1. Create a demo of the product and ask for payment
  2. Search "company name sucks" to find the tradeoffs
  3. Breakdown the problem: What is the flow? Find the core problem.
  4. Solve one CORE problem
  5. Ask why five times and note down the answer for each why. 
  6. Write an article and promote based on the answers for 8
Practice building solutions. Build something in the chosen space. Product discovery is parallel to building a prototype.
  1. Build it fast
  2. Ship it
  3. Test the idea
  4. Tweak the initial idea

Tuesday, June 07, 2022

Deploy Grid Articles

  1. Brewfile
  2. DeMorgan's Law
  3. Jekyll + Tailwind
  4. Customizing DateTime format
  5. Cohesion
  6. Coupling
  7. 12 Factor Apps
  8. Naming methods by looking at Jira ticket description
  9. Avoid try and using the safe navigation operator
  10. Upgrading Puma, managing technical risk
  11. Procfile
  12. Foreman
  13. Install syntax highlighter in Jekyll
  14. Falcon server 
  15. Using constants and moving all related constants to one file
  16. JSON Schema validator for request and response validation
  17. Breaking complex conditional into simpler methods to make the code expressive
  18. Traceability from requirements to code to database (all layers)
  19. Deploying the ToDo apps for different stacks (available as open source) using the deployment tool

Monday, June 06, 2022

The onegrid.run Commands

Grid CLI Commands

Initialize a project and setup SSH keys
grid init

Create your first node
grid create node-name

View the current status of your node
grid status

View the health status of all the servers in your node
grid health

Push the source code to the node
grid deploy

Run any unix command on the production instance and view the output
grid run <unix command>
Example:
Show all the environment variables and their values
grid run ENV

Go to rails production console in sandbox mode:
grid console



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