Skip to content

Instantly share code, notes, and snippets.

View ChakshuGautam's full-sized avatar
😁

Chakshu Gautam ChakshuGautam

😁
View GitHub Profile
@ChakshuGautam
ChakshuGautam / postgres_recovery.md
Created October 18, 2023 02:03 — forked from supix/postgres_recovery.md
Postgres error: Missing chunk 0 for toast value in pg_toast

The problem

In some cases, it is possible that PostgreSQL tables get corrupted. This can happen in case of hardware failures (e.g. hard disk drives with write-back cache enabled, RAID controllers with faulty/worn out battery backup, etc.), as clearly reported in this wiki page. Furthermore, it can happen in case of incorrect setup, as well.

One of the symptoms of such corruptions is the following message:

ERROR: missing chunk number 0 for toast value 123456 in pg_toast_45678

This almost surely indicates that a corrupted chunk is present within a table file. But there is a good way to get rid of it.

@ChakshuGautam
ChakshuGautam / WoC Projects.md
Last active December 28, 2022 05:54 — forked from Harshil-Jani/Org_Project_Status.md
Samagra Projects (Winter of Code 3.0 GDSC IIIT Kalyani)

Samagra Development

Project 1 : X-Admin Generator

Generator connects the bridge between the CRUD APIs that comes from Sunbird-RC and the FrondEnd which is named as X-Admin. The generator currently has two instances which could be generated.

  1. A general purpose Admin based on REST or GraphQL
  2. An Admin for Sunbird-RC's generated CRUD APIs.

The general-puspose admin comes with a json-server and json-graphql-server servers so, APIs needs to be local. But, You can write your own data provider and make the best use out of it.

@ChakshuGautam
ChakshuGautam / cacheMiddleware.ts
Created February 1, 2022 04:19 — forked from daniellwdb/cacheMiddleware.ts
Prisma cache middleware
import type { Prisma } from "@prisma/client"
import { redis } from "../redis"
type CacheMiddlewareOptions = {
model: Prisma.ModelName
action: Prisma.PrismaAction
keys?: string[]
defaultValues?: Record<string, unknown>
ttlInSeconds: number
}
@ChakshuGautam
ChakshuGautam / Procfile
Created October 24, 2018 17:47 — forked from ellefsen/Procfile
Heroku with Google Cloud SQL and cloud_sql_proxy with PHP / Laravel
web: (bash ./start.sh) & vendor/bin/heroku-php-nginx public/

These are notes while researching a way to convert a browser/website to a stream. This could be used for Facebook Live or for webrecording. TL'DR:

  • I started with Phantomjs - but that didn't support the html5 video tag
  • SlimerJS supports it, but there is no way to record audio directly (though this might come from desktop audio)
  • So I moved to research ffmpeg/X11/XVFB to record it with linux which works
  • But ffmpeg has no easy way to mix streams/overlays to I moved on to OBS with overlay browser support
  • I started researching options OBS in docker and it needed best a GPU , so I move to nvidia-docker
  • And so came across building game servers on EC2/AWS using GPUs and managed to run OBS inside of GPU g2x.large machine
  • I tried streaming to twich , which works great and managed to restream 4K 60FPS youtube on an AWS instance
  • Remote control works through OBS-Remote but OBS has kinda limit in types of features