Skip to content

Instantly share code, notes, and snippets.

View hmtanbir's full-sized avatar
🏠
Working from home

HM Tanbir hmtanbir

🏠
Working from home
  • BDMADE
  • Dhaka
View GitHub Profile
@hmtanbir
hmtanbir / regenerate_credentials.md
Created November 22, 2022 02:37 — forked from db0sch/regenerate_credentials.md
How to regenerate the master key for Rails 5.2 credentials

If your master.key has been compromised, you might want to regenerate it.

No key regeneration feature at the moment. We have to do it manually.

  1. Copy content of original credentials rails credentials:show somewhere temporarily.
  2. Remove config/master.key and config/credentials.yml.enc
  3. Run EDITOR=vim rails credentials:edit in the terminal: This command will create a new master.key and credentials.yml.enc if they do not exist.
  4. Paste the original credentials you copied (step 1) in the new credentials file (and save + quit vim)
  5. Add and Commit the file config/credentials.yml.enc
@hmtanbir
hmtanbir / MetaWrapper.jsx
Created April 19, 2023 05:17 — forked from Showrin/MetaWrapper.jsx
A component that implements basic SEO to any NextJS app
import Head from 'next/head';
import PropTypes from 'prop-types';
const MetaWrapper = (props) => {
const {
title,
description,
type,
imageUrl,
contentUrl,
@hmtanbir
hmtanbir / fix-libv8-mac.txt
Created August 8, 2024 16:49 — forked from fernandoaleman/fix-libv8-mac.txt
Fixing libv8 and therubyracer on Mac
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install