Dinesh Sawant

Programmer having interests in Data Engineering, Linux and web backends.

How to enable row level security in Amazon Redshift

Where can we use row-level security? Suppose you have a report.orders table in Redshift. order_id customer_id country 1 400 India 2 555 US 3 555 US 4 555 US 5 300 Canada 6 300 Canada 7 300 Canada 8 300 India 9 300 India Your organization has different teams of data analysts who are responsible for different countries. From a data security perspective, it is wise to grant access to country-specific data to a team....

March 2, 2024 · Dinesh Sawant

Jetty Websocket With Spring Boot [New 2022]

In my old blog post, Jetty Websocket was getting created outside of Spring Context, and there was much more glue code to integrate it with Spring Boot. This blog post will provide you with a much cleaner approach to using Jetty WebSocket in Spring Boot. About this App I am going to build a websocket through which server will send random names to all it’s subscribers. At any given time all the subscribers will get same name....

May 20, 2022 · Dinesh Sawant

Useful Linux Bash Commands

Get disk information $ sudo lsblk -io KNAME,TYPE,SIZE,MODEL KNAME TYPE SIZE MODEL nvme0n1 disk 20G Amazon Elastic Block Store nvme0n1p1 part 20G nvme1n1 disk 46.6G Amazon EC2 NVMe Instance Storage nvme1n1p1 part 46.6G dm-0 lvm 46.6G nvme2n1 disk 20G Amazon Elastic Block Store nvme2n1p1 part 20G Get Linux OS information $ cat /etc/os-release NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7" Memory Usage $ free -h total used free shared buff/cache available Mem: 3....

March 11, 2022 · Dinesh Sawant

Install older Ruby versions on MacOS Catalina

While installing older ruby versions on macOS Catalina you may encounter errors regarding openssl. This is due to the dependency on openssl version 1.0. To compile ruby from source you will need to install openssl version 1.0. I faced similar problem, while installing ruby version 2.2.5 on macOs Catalina. Following solution helped to install old ruby version successfully. Steps 1. Install openssl v1.0 brew install rbenv/tap/openssl@1.0 2. Install ruby-2.2.5 by referencing openssl v1....

March 10, 2021 · Dinesh Sawant

My Setup for MacOS

Install ITerm Install HomeBrew Install oh-my-zsh Install powerlevel10k It is a zsh theme with a bunch of useful plugins. For Syntax Highlighting Run brew install zsh-syntax-highlighting Add source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh in ~/.zshrc Install Command Not Found Handler brew tap homebrew/command-not-found Add the following code in ~/.zshrc HB_CNF_HANDLER="$(brew --repository)/Library/Taps/homebrew/homebrew-command-not-found/handler.sh" if [ -f "$HB_CNF_HANDLER" ]; then source "$HB_CNF_HANDLER"; fi Once you install Syntax Highlighting and CNF Handler, you get following results when a command is not found....

February 1, 2021 · Dinesh Sawant