Skip to content

Instantly share code, notes, and snippets.

View akash-gajjar's full-sized avatar
🎯
Focusing

Aakash Gajjar akash-gajjar

🎯
Focusing
View GitHub Profile
@akash-gajjar
akash-gajjar / logger.js
Created April 2, 2024 09:39
Logger using winston
import dotenv from 'dotenv';
import winston, { addColors, format } from 'winston';
dotenv.config();
const formatParams = (info) => {
const { timestamp, level, message, label, ...args } = info;
return `${timestamp} ${level} ${label}: ${message} ${Object.keys(args).length ? JSON.stringify(args, '', '') : ''}`;
};
@akash-gajjar
akash-gajjar / README.md
Created March 27, 2024 08:22
Increase swap size

[Redhat recommends][redhat-swap-link] swap should be at-least 1.5-2x size of available ram. Having low swap can result in degraded system performance when ram usage is high, to further increase the swap size we can take below steps

Below commands should be executed as root

  1. Create Swap file of 25GB
dd if=/dev/zero of=/swapfile1 bs=1024M count=25
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'prettier', 'import'],
extends: [
'eslint:recommended',
@akash-gajjar
akash-gajjar / assembly.speaker-utterances.json
Created March 18, 2024 05:59
assembly.speaker-utterances.json
{
"success": true,
"data": {
"utterances": [
{
"speaker": "A",
"sentences": [
{
"confidence": 0.87960375,
"end": 3150,
@akash-gajjar
akash-gajjar / sample.json
Created March 15, 2024 12:04
assembly ai output
This file has been truncated, but you can view the full file.
{
"success": true,
"data": {
"transcript": {
"id": "0b45ec57-83af-4947-87e3-567803c308f6",
"language_model": "assemblyai_default",
"acoustic_model": "assemblyai_default",
"language_code": "en_us",
"status": "completed",
"audio_url": "https://cdn.assemblyai.com/upload/4e3e11d1-7537-4909-b6fa-17268f0df170",
{
"$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/schema-catalog.json",
"version": 1,
"schemas": [
{
"name": "1Password SSH Agent Config",
"description": "Configuration file for the 1Password SSH agent",
"fileMatch": ["**/1password/ssh/agent.toml"],
"url": "https://developer.1password.com/schema/ssh-agent-config.json"
},
@akash-gajjar
akash-gajjar / driver_timeline.js
Created January 31, 2024 07:15
Driver Change in Vehicle name using MongoDB query
[
{
$match: {
driver_id: ObjectId(
"656d9b8c6a91175eb8c3ea3a"
),
vehicle_name: { $nin: ["", "0", null] },
// vehicle_name: "5405"
},
},
[
{
'$match': {
'driver_id': new ObjectId('657953b26a91175eb8b6bc93'),
'load_id': {
'$exists': true,
'$nin': [
'', null
]
}
@akash-gajjar
akash-gajjar / backup-restore.sh
Last active June 22, 2023 12:42
A script to perform backup and restore operations for a MongoDB database.
#!/bin/bash
# Script: backup-restore.sh
# Description: A script to perform backup and restore operations for a MongoDB database.
# Author: Aakash Gajjar
# Last modified: 2023-06-03
# S3 bucket to upload database backup file
bucketName=""