Skip to content

Instantly share code, notes, and snippets.

View vishnu-narayanan's full-sized avatar
🎯
Focusing

Vishnu Narayanan vishnu-narayanan

🎯
Focusing
View GitHub Profile
@vishnu-narayanan
vishnu-narayanan / purge_old_conversations.rb
Created February 9, 2026 11:21
delete conversations older than x months
# Purge conversations created before a given cutoff date.
# Copy this script to the ./scripts directory and run it with:
# Usage:
# bundle exec rails runner scripts/purge_old_conversations.rb
#
# Ensure
# you have a full database backup (pg_dump) before running.
# scale up sidekiq workers to ensure you have capacity for background deletion jobs this will enqueue
BATCH_SIZE = 500
@vishnu-narayanan
vishnu-narayanan / aws-marketplace-takedown-request.md
Created October 30, 2025 10:25
aws-marketplace-takedown-request.md

Subject: Unauthorized Marketplace Listings of “Chatwoot”

I, Vishnu Narayanan, am an authorized maintainer and representative of Chatwoot Inc., the copyright holder and rights owner of the open-source software Chatwoot (https://github.com/chatwoot/chatwoot). We hold the trademark and brand rights (name “Chatwoot”, Chatwoot logo, and related branding) in association with this product.

We have identified the following listings on AWS Marketplace that reproduce, distribute, or present Chatwoot software and/or branding in a way that misleads buyers into believing these are official Chatwoot products endorsed by Chatwoot Inc.:

  1. https://aws.amazon.com/marketplace/pp/prodview-qlivbq3rnamxm — “Chatwoot: Customer Experience Platform by Optick”
  2. https://aws.amazon.com/marketplace/pp/prodview-d4mxx67of3phu — “Websoft9 Applications Hosting Platform for Chatwoot”

These listings use the Chatwoot name and branding without our authorization, and they appear to suggest an official relationship with Chatwoot Inc. This

@vishnu-narayanan
vishnu-narayanan / cw-web-logs-opensearch.log
Created August 13, 2025 16:14
cw-web-logs-opensearch.log
Aug 13 16:11:52 ip-10-11-149-224 systemd[1]: chatwoot-web.1.service: Consumed 3.099s CPU time.
^CAug 13 16:11:54 ip-10-11-149-224 systemd[1]: chatwoot-web.1.service: Scheduled restart job, restart counter is at 387.
Aug 13 16:11:54 ip-10-11-149-224 systemd[1]: Started chatwoot-web.1.service.
Aug 13 16:11:56 ip-10-11-149-224 chatwoot-web.1[81337]: => Booting Puma
Aug 13 16:11:56 ip-10-11-149-224 chatwoot-web.1[81337]: => Rails 7.1.5.1 application starting in production
Aug 13 16:11:56 ip-10-11-149-224 chatwoot-web.1[81337]: => Run `bin/rails server --help` for more startup options
Aug 13 16:11:56 ip-10-11-149-224 chatwoot-web.1[81337]: [DEPRECATED] Bundler.rubygems.all_specs has been removed in favor of Bundler.rubygems.installed_specs
Aug 13 16:11:56 ip-10-11-149-224 chatwoot-web.1[81337]: I, [2025-08-13T16:11:56.436294 #81337] INFO -- : [dotenv] Loaded .env
Aug 13 16:11:56 ip-10-11-149-224 chatwoot-web.1[81337]: I, [2025-08-13T16:11:56.436347 #81337] INFO -- : [dotenv] Loaded .env
Aug 13 16:11:57 ip-10-11-
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
val config = ChatwootConfiguration(
accountId = 47, // e.g. 1
apiHost = "https://staging.chatwoot.com", // e.g. "https://app.chatwoot.com"
accessToken = "bj2GSWhRH6rktMSQfUtV7Sg4", // Your API access token
@vishnu-narayanan
vishnu-narayanan / chatwoot_db_setup
Last active October 5, 2024 15:40
chatwoot_db_setup
pg_pass=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 15 ; echo '')
sudo service postgresql start
sudo -i -u postgres psql << EOF
\set pass `echo $pg_pass`
CREATE USER chatwoot CREATEDB;
ALTER USER chatwoot PASSWORD :'pass';
ALTER ROLE chatwoot SUPERUSER;
UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';
DROP DATABASE template1;
CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE';
WITH qmr AS (
SELECT service_class, 'query_cpu_time' ::VARCHAR(30) qmr_metric, MEDIAN(query_cpu_time ) p50, PERCENTILE_CONT(0.99) WITHIN GROUP (ORDER BY query_cpu_time ) p99, MAX(query_cpu_time ) pmax FROM svl_query_metrics_summary WHERE userid > 1 GROUP BY 1
UNION ALL SELECT service_class, 'query_blocks_read' ::VARCHAR(30) qmr_metric, MEDIAN(query_blocks_read ) p50, PERCENTILE_CONT(0.99) WITHIN GROUP (ORDER BY query_blocks_read ) p99, MAX(query_blocks_read ) pmax FROM svl_query_metrics_summary WHERE userid > 1 GROUP BY 1
UNION ALL SELECT service_class, 'query_execution_time' ::VARCHAR(30) qmr_metric, MEDIAN(query_execution_time ) p50, PERCENTILE_CONT(0.99) WITHIN GROUP (ORDER BY query_execution_time ) p99, MAX(query_execution_time ) pmax FROM svl_query_metrics_summary WHERE userid > 1 GROUP BY 1
UNION ALL SELECT service_class, 'query_queue_time' ::VARCHAR(30) qmr_metric, MEDIAN(q
WITH qmr AS (
SELECT service_class, 'query_cpu_time' ::VARCHAR(30) qmr_metric, MEDIAN(query_cpu_time ) p50, PERCENTILE_CONT(0.99) WITHIN GROUP (ORDER BY query_cpu_time ) p99, MAX(query_cpu_time ) pmax FROM svl_query_metrics_summary WHERE userid > 1 GROUP BY 1
UNION ALL SELECT service_class, 'query_blocks_read' ::VARCHAR(30) qmr_metric, MEDIAN(query_blocks_read ) p50, PERCENTILE_CONT(0.99) WITHIN GROUP (ORDER BY query_blocks_read ) p99, MAX(query_blocks_read ) pmax FROM svl_query_metrics_summary WHERE userid > 1 GROUP BY 1
UNION ALL SELECT service_class, 'query_execution_time' ::VARCHAR(30) qmr_metric, MEDIAN(query_execution_time ) p50, PERCENTILE_CONT(0.99) WITHIN GROUP (ORDER BY query_execution_time ) p99, MAX(query_execution_time ) pmax FROM svl_query_metrics_summary WHERE userid > 1 GROUP BY 1
UNION ALL SELECT service_class, 'query_cpu_usage_percent' ::VARCHAR(30) qmr_metric, MEDIAN(q
#!/bin/bash
set -x
## Pre-commit hook validation script for the developers.
## Variables
HOOK_FILE_URL="https://raw.githubusercontent.com/Flux7Labs/central-repo-git-hooks/master/.pre-commit-config.yaml"
ARGS="--all-files"
PKGS="pre-commit cfn-lint flake8 checkov"
BASEDIR="/tmp/hooks"
HOOK_FILE="${BASEDIR}/hookfile"
mkdir -p ${BASEDIR}
@vishnu-narayanan
vishnu-narayanan / chatwoot.sh
Last active October 10, 2022 10:17
chatwoot installation script
#!/usr/bin/env bash
#description: chatwoot installation script
#OS: Ubuntu 18.04 LTS
#script_version: 0.1
#maintainer: vishnu@pepalo.com
apt update && apt upgrade -y
apt install -y curl
@vishnu-narayanan
vishnu-narayanan / MainActivity.java
Created November 6, 2015 09:14
Camera2 Dual CameraAccess
package com.vn.twins;
import android.annotation.TargetApi;
import android.app.Activity;
import android.graphics.SurfaceTexture;
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCaptureSession;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraDevice;
import android.hardware.camera2.CameraManager;