Skip to content

Instantly share code, notes, and snippets.

View mavwolverine's full-sized avatar

Viraj Kanwade mavwolverine

View GitHub Profile
@mavwolverine
mavwolverine / Dockerfile
Last active July 20, 2025 23:22
next.js runtime assetPrefix
# This is snippet of next.js build Dockerfile
...
# placeholder hack for replacement at startup
ENV NEXT_PUBLIC_CDN_DOMAIN=http://MY_CDN_DOMAIN_REPLACE_ME
ENV NEXT_PUBLIC_BASE_PATH=/MY_BASE_PATH_REPLACE_ME
...
@mavwolverine
mavwolverine / next+14.2.30.patch
Created July 20, 2025 17:58
Next.js standalone app server.js hostname setup from env NEXT_HOSTNAME
diff --git a/node_modules/next/dist/build/utils.js b/node_modules/next/dist/build/utils.js
index ce30a5f..24c6f23 100644
--- a/node_modules/next/dist/build/utils.js
+++ b/node_modules/next/dist/build/utils.js
@@ -1487,8 +1487,8 @@ const dir = path.join(__dirname)
process.env.NODE_ENV = 'production'
process.chdir(__dirname)
-const currentPort = parseInt(process.env.PORT, 10) || 3000
-const hostname = process.env.HOSTNAME || '0.0.0.0'
@mavwolverine
mavwolverine / next+14.2.30.patch
Created July 20, 2025 03:02
Access logs in Next.js production build
diff --git a/node_modules/next/dist/server/lib/start-server.js b/node_modules/next/dist/server/lib/start-server.js
index ed79818..b41b07c 100644
--- a/node_modules/next/dist/server/lib/start-server.js
+++ b/node_modules/next/dist/server/lib/start-server.js
@@ -39,6 +39,14 @@ const _appinfolog = require("./app-info-log");
const _turbopackwarning = require("../../lib/turbopack-warning");
const _trace = require("../../trace");
const _ispostpone = require("./router-utils/is-postpone");
+require('pino-http-print');
+const _logger = require('pino-http')(
@mavwolverine
mavwolverine / aws-key-pair-private.sh
Created July 19, 2024 04:23
get private key from AWS key pair
KEY_PAIR_NAME="XYZ"; aws ssm get-parameter --name /ec2/keypair/$(aws ec2 describe-key-pairs --filters "Name=key-name,Values=$KEY_PAIR_NAME" --query "KeyPairs[*].KeyPairId" --output text) --with-decryption --query "Parameter.Value" --output text
showthread.php/1507523-Bhagya-Dile-Tu-Mala-10th-October-2022-Video-Watch-Online?highlight=bhagya+dile+mala,Bhagya Dile Tu Mala 10th October 2022 Video Watch Online
showthread.php/1507162-Bhagya-Dile-Tu-Mala-7th-October-2022-Video-Watch-Online?highlight=bhagya+dile+mala,Bhagya Dile Tu Mala 7th October 2022 Video Watch Online
showthread.php/1506991-Bhagya-Dile-Tu-Mala-6th-October-2022-Video-Watch-Online?highlight=bhagya+dile+mala,Bhagya Dile Tu Mala 6th October 2022 Video Watch Online
showthread.php/1506806-Bhagya-Dile-Tu-Mala-5th-October-2022-Video-Watch-Online?highlight=bhagya+dile+mala,Bhagya Dile Tu Mala 5th October 2022 Video Watch Online
showthread.php/1506614-Bhagya-Dile-Tu-Mala-4th-October-2022-Video-Watch-Online?highlight=bhagya+dile+mala,Bhagya Dile Tu Mala 4th October 2022 Video Watch Online
showthread.php/1506428-Bhagya-Dile-Tu-Mala-3rd-October-2022-Video-Watch-Online?highlight=bhagya+dile+mala,Bhagya Dile Tu Mala 3rd October 2022 Video Watch Online
showthread.php/1506206-Bhagya-Dile-Tu-Mala-1st-Oct
@mavwolverine
mavwolverine / aws_mfa_creds.sh
Last active August 12, 2020 17:54
AWS CLI with MFA
#!/bin/bash
# source ./aws_mfa_creds.sh <MFA KEY> <ORIG AWS PROFILE NAME - optional, default>
# https://aws.amazon.com/premiumsupport/knowledge-center/authenticate-mfa-cli/
# Works on MacOS. Might need changes to date command params for linux
if [ -n "$AWS_SESSION_TOKEN_EXPIRATION" ]
then
if [ $(date -jf "%Y-%m-%dT%H:%M:%SZ" "$AWS_SESSION_TOKEN_EXPIRATION" +"%s") -gt $(date +"%s") ]
@mavwolverine
mavwolverine / requirements_mac.txt
Created April 18, 2020 23:35
Spyder-ide requirements_mac.txt - Created this gist since spyder is not interested https://github.com/spyder-ide/spyder/pull/12387
# We can not refer to an environment.yml file from another
# So to get performant launches on mybinder.org, we have copied
# the contents of this file to binder/environment.yml. If you
# make changes here, please copy them over there too.
applaunchservices >=0.1.7
atomicwrites >=1.2.0
chardet >=2.0.0
cloudpickle >=0.5.0
diff-match-patch >=20181111
intervaltree
@mavwolverine
mavwolverine / ls_build.sh
Created October 27, 2018 17:48
ls -R Build
#!/bin/bash
pwd
ls -R Build
@mavwolverine
mavwolverine / linuxium-create-android-sdcard-split
Created January 25, 2018 22:27
linuxium-create-android-sdcard-split
#!/bin/bash
# Linuxium's script to create a bootable SD card with Android for RK3188 devices
SDCARD="/dev/sdc"
SOURCE_DIR='~'
WORKING_DIR=`pwd`
ANDROID_DIR=${WORKING_DIR}/Android
IMAGE_DIR=${ANDROID_DIR}/Image
@mavwolverine
mavwolverine / DisplayProfileSwitcher.scpt
Last active October 23, 2016 07:02
Quick display profile switcher for Mac (tested on el capitan)
-- Author: Viraj Kanwade
-- Initial inspiration was iOS 'Night Shift' like feature on Mac
-- Hacked together from various code snippets on forums
-- Tested only on El Capitan for main display
(*
Pre-steps:
Create display profiles
System Preferences > Dispalys > Color