Skip to content

Instantly share code, notes, and snippets.

View surajmandalcell's full-sized avatar
🏃‍♂️
Working

Suraj Mandal surajmandalcell

🏃‍♂️
Working
View GitHub Profile
App is listening on http://localhost:5500
Fetching stock data...
[2024-02-04T02:34:28.059Z] Warning: Error from HTTP request. AggregateError
[2024-02-04T02:34:28.059Z] Error: Failed to complete negotiation with the server: AggregateError
[2024-02-04T02:34:28.059Z] Error: Failed to start the connection: AggregateError
Connection error: AggregateError
at internalConnectMultiple (node:net:1114:18)
at afterConnectMultiple (node:net:1667:5) {
code: 'ECONNREFUSED',
[errors]: [

AWS EKS Prometheus Grafana Demo by Suraj Mandal

Use these commands during the demo

Note Please make sure the eks kubernetes version you are using is 1.23 I had issues with the latest one(1.27)

Install aws cli

brew install awscli
@surajmandalcell
surajmandalcell / env-backup.sh
Last active June 5, 2022 17:49
If you maintain your repositories in a single folder grouped by org or such this backs them up, not the most efficient
# Variables
filename='.env-list.txt'
backupdir='~/Documents/backups__/envfiles'
rm -rf $filename
find . -name '*.env' >> $filename
while IFS="" read -r p || [ -n "$p" ]
do
if [[ "._" == *"$p"* ]]; then
@surajmandalcell
surajmandalcell / error.ts
Last active February 13, 2022 07:33
Angular observable mock & error handling utils to shift from direct api to mock data when developing(for legacy code)
import { HttpErrorResponse } from '@angular/common/http';
import { throwError } from 'rxjs/internal/observable/throwError';
export function errorHandler(error: HttpErrorResponse) {
return throwError(error);
}
@surajmandalcell
surajmandalcell / reqUrl.js
Created December 25, 2021 04:23 — forked from wilsonpage/reqUrl.js
A function I made that wraps the node http.request function to make it a little more friendly. In my case I am using it for API route testing.
// module dependencies
var http = require('http'),
url = require('url');
/**
* UrlReq - Wraps the http.request function making it nice for unit testing APIs.
*
* @param {string} reqUrl The required url in any form
* @param {object} options An options object (this is optional)
@surajmandalcell
surajmandalcell / amazon-linux-2-docker-compose-install.md
Last active August 25, 2021 06:58
Install docker and docker-compose in amazon linux 2
sudo amazon-linux-extras install -y docker && sudo service docker start && \
sudo usermod -a -G docker ec2-user && \
sudo chkconfig docker on && \
sudo yum install -y git && \
sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) \
-o /usr/local/bin/docker-compose && \
sudo chmod +x /usr/local/bin/docker-compose && \
docker-compose version && \
sudo reboot
@surajmandalcell
surajmandalcell / file-upload.tsx
Created May 29, 2021 22:51 — forked from Sqvall/file-upload.tsx
File Upload with Chakra UI and react-hook-form
import { ReactNode, useRef } from 'react'
import { Button, FormControl, FormErrorMessage, FormLabel, Icon, InputGroup } from '@chakra-ui/react'
import { useForm, UseFormRegisterReturn } from 'react-hook-form'
import { FiFile } from 'react-icons/fi'
type FileUploadProps = {
register: UseFormRegisterReturn
accept?: string
multiple?: boolean
children?: ReactNode
@surajmandalcell
surajmandalcell / lazy-load-nvm.sh
Created February 12, 2021 05:25 — forked from rtfpessoa/lazy-load-nvm.sh
NVM lazy loading script
#!/bin/bash
#
# NVM lazy loading script
#
# NVM takes on average half of a second to load, which is more than whole prezto takes to load.
# This can be noticed when you open a new shell.
# To avoid this, we are creating placeholder function
# for nvm, node, and all the node packages previously installed in the system
# to only load nvm when it is needed.
@surajmandalcell
surajmandalcell / submime_text3_settings_mac.txt
Last active February 8, 2021 13:35
submime text settings mac
{
"color_scheme": "Packages/ayu/ayu-dark.sublime-color-scheme",
"font_face": "Operator Mono Medium",
"font_size": 13,
"hot_exit": true,
"ignored_packages":
[
"Vintage"
],
"open_files_in_new_window": false,
@surajmandalcell
surajmandalcell / name.js
Created November 10, 2020 11:04 — forked from tkon99/name.js
Random Name Generator for Javascript
/*
(c) by Thomas Konings
Random Name Generator for Javascript
*/
function capFirst(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
function getRandomInt(min, max) {