Skip to content

Instantly share code, notes, and snippets.

View vinaysshenoy's full-sized avatar

Vinay Shenoy vinaysshenoy

  • https://www.qweebi.com
  • Bangalore, India
View GitHub Profile
@vinaysshenoy
vinaysshenoy / date_format.sh
Created January 14, 2025 03:56
UTC date format
date -u '+%Y.%m.%d%H%M'
@vinaysshenoy
vinaysshenoy / build.sh
Created November 15, 2024 05:38
Bundle minimal JRE with application
#!/usr/bin/env bash
./gradlew -version
./gradlew shadowJar --no-daemon
jdkModules=$(jdeps --print-module-deps --ignore-missing-deps ./build/libs/application.jar)
echo "Building JRE with modules: $jdkModules"
rm -rf ./build/libs/jre
jlink --compress zip-6 --strip-debug --no-header-files --no-man-pages --output ./build/libs/jre --add-modules "$jdkModules"
@vinaysshenoy
vinaysshenoy / commants.sh
Created September 27, 2024 08:05
Rclone stuff
# Empty bucket
rclone delete --rmdirs {{config_name}}:{{bucket_name}}
@vinaysshenoy
vinaysshenoy / ci.yml
Last active June 26, 2024 04:32
Generate DB docs automatically
- name: Check DB schema docs
run: |
DOCS_FOLDER="/tmp/qweebi-docs-gen/"
mkdir -p $DOCS_FOLDER
chmod 777 $DOCS_FOLDER
./flyway/generate_db_docs.sh versions.env -nohtml $DOCS_FOLDER
GENERATED_SCHEMA_HASH=$(md5sum -t /tmp/qweebi-docs-gen/db.public.xml | cut -c 1-32)
EXISTING_SCHEMA_HASH=$(md5sum -t ./flyway/docs/db.public.xml | cut -c 1-32)
echo "Generated schema hash: $GENERATED_SCHEMA_HASH, Saved schema hash: $EXISTING_SCHEMA_HASH"
ARG NODE_VERSION
# Typescript build
FROM node:$NODE_VERSION as builder
# Server build
WORKDIR /src
COPY ./src ./src
COPY index.ts ./
COPY tracing.ts ./

Create zip on macos without the hidden directories (for elasticbeanstalk)

zip -rX v0.49.4.zip . -x '**/.DS_Store' -x '.DS_Store'
unzip -v v0.49.4.zip
@vinaysshenoy
vinaysshenoy / gamebar.ps1
Created February 17, 2024 05:09
Disable gamebar completel;y
Get-AppxPackage Microsoft.XboxGamingOverlay | Remove-AppxPackage
reg add HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR /f /t REG_DWORD /v "AppCaptureEnabled" /d 0
reg add HKEY_CURRENT_USER\System\GameConfigStore /f /t REG_DWORD /v "GameDVR_Enabled"
@vinaysshenoy
vinaysshenoy / resettablePostgreSQLContainer.ts
Last active December 24, 2023 08:21
PostgreSQL Testcontainer that allows restting the database without dropping the schema in between test runs
import { PostgreSqlContainer, StartedPostgreSqlContainer } from "@testcontainers/postgresql"
class ResettablePostgreSqlContainer extends PostgreSqlContainer {
private dumpSaveDirectory: string = ""
override async start(): Promise<StartedResettablePostgreSqlContainer> {
const container = await super.start()
return new StartedResettablePostgreSqlContainer(this.dumpSaveDirectory, container)
}
kill -9 $(lsof -ti:8080)
@vinaysshenoy
vinaysshenoy / serve.sh
Created October 10, 2023 07:13
Python server
python3 -m http.server 8080