Skip to content

Instantly share code, notes, and snippets.

View rakeshtembhurne's full-sized avatar
😉
Writing a Book

Rakesh Tembhurne rakeshtembhurne

😉
Writing a Book
View GitHub Profile
@rakeshtembhurne
rakeshtembhurne / postgres_install.sh
Last active February 18, 2025 11:58
bash: Install Postgres Database for usage in LAN
#!/bin/bash
DB_USER="admin"
DB_PASSWORD=$(openssl rand -base64 16)
DB_NAME="connectors"
DB_HOST=$(hostname -I | awk '{print $1}')
# Ensure PostgreSQL listens on all interfaces
configure_postgresql() {
sudo sed -i "s/^#listen_addresses = 'localhost'/listen_addresses = '*'/" /var/lib/pgsql/data/postgresql.conf
@rakeshtembhurne
rakeshtembhurne / next-self-host.sh
Created October 27, 2024 00:42
Next JS Self Hosting Script
#!/bin/bash
# Taken from: https://github.com/leerob/next-self-host/blob/main/deploy.sh
# Env Vars
POSTGRES_USER="myuser"
POSTGRES_PASSWORD=$(openssl rand -base64 12) # Generate a random 12-character password
POSTGRES_DB="mydatabase"
SECRET_KEY="my-secret" # for the demo app
NEXT_PUBLIC_SAFE_KEY="safe-key" # for the demo app
@rakeshtembhurne
rakeshtembhurne / .tmux.conf
Created October 1, 2024 17:16
tmux config file
set -g default-terminal "screen-256color"
unbind-key C-b
set -g prefix C-Space
bind-key C-Space send-prefix
unbind %
bind | split-window -h
unbind '"'
@rakeshtembhurne
rakeshtembhurne / server.js
Created June 4, 2024 12:29
NodeJS: NextJS Server to create production server with locally. created https certificates
const { createServer } = require("https");
const { parse } = require("url");
const next = require("next");
const fs = require("fs");
const port = 3000;
// const dev = process.env.NODE_ENV !== "production";
const dev = false;
const app = next({ dev });
const handle = app.getRequestHandler();
@rakeshtembhurne
rakeshtembhurne / package.json
Created June 16, 2023 03:34
StandardJS: Adding standardjs settings into nodejs package.json
"standard.options": {
"ignore": [
"node_modules/**"
],
"javascript.format.enable": false,
"javascript.validate.enable": false,
"standard.enable": true,
"standard.autoFixOnSave": true,
"standard.validate": [
"javascript",
"use strict";
const puppeteer = require("puppeteer");
const _ = require('lodash');
const log = data => console.log(data);
async function autoScroll(page){
await page.evaluate(async () => {
@rakeshtembhurne
rakeshtembhurne / data.json
Created October 29, 2020 03:22
Output Data for testing
[
{
"date": "2020-09-30T09:15:00.000Z",
"open": 21482.3,
"high": 21514.75,
"low": 21405.05,
"close": 21468.9,
"volume": 533150,
"time": "Sep 30, 2020 2:45 PM",
"hma": 21360.62454978355,
@rakeshtembhurne
rakeshtembhurne / dailyOi.js
Created February 24, 2020 13:50
Extracts daily OI information of NIFTY and BANKNIFTY
const csv = require("csvtojson");
const _ = require('lodash');
const logD = data => {
console.log(data);
process.exit();
}
const args = process.argv.slice(2);
if (args.length !== 1 || !args[0]) {
{
"explore_tabs": [
{
"tab_id": "home_tab",
"tab_name": "homes",
"pagination_metadata": {
"has_next_page": true,
"items_offset": 18,
"section_offset": 5,
"search_session_id": "c20a7c71-74be-42e9-843f-927a4dafd9da",
function isChatMessage(message) {
if (message.__x_isSentByMe) {
return false;
}
if (message.__x_isNotification) {
return false;
}
if (!message.__x_isUserCreatedType) {
return false;
}