Skip to content

Instantly share code, notes, and snippets.

View raihan2006i's full-sized avatar

Miah Raihan Mahmud Arman raihan2006i

  • Manchester, United Kingdom
View GitHub Profile
@db0sch
db0sch / regenerate_credentials.md
Last active July 30, 2024 12:59
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
@UsamaAshraf
UsamaAshraf / Gemfile
Last active May 23, 2021 16:42
N+1 Queries, Batch Loading and Active Model Serializers
# ...
# https://github.com/exAspArk/batch-loader
gem 'batch-loader'
@Guidoom
Guidoom / gist:d5db0a76ce669b139271a528a8a2a27f
Last active September 17, 2024 17:56
Sample odoo.conf file
[options]
#
# WARNING:
# If you use the Odoo Database utility to change the master password be aware
# that the formatting of this file WILL be LOST! A copy of this file named
# /etc/odoo/openerp-server.conf.template has been made in case this happens
# Note that the copy does not have any first boot changes
#-----------------------------------------------------------------------------
# Odoo Server Config File - TurnKey Linux
PostgreSQL Data Types AWS DMS Data Types Redshift Data Types
INTEGER INT4 INT4
SMALLINT INT2 INT2
BIGINT INT8 INT8
NUMERIC (p,s) If precision is 39 or greater, then use STRING. If the scale is => 0 and =< 37 then: NUMERIC (p,s) If the scale is => 38 and =< 127 then: VARCHAR (Length)
DECIMAL(P,S) If precision is 39 or greater, then use STRING. If the scale is => 0 and =< 37 then: NUMERIC (p,s) If the scale is => 38 and =< 127 then: VARCHAR (Length)
REAL REAL4 FLOAT4
DOUBLE REAL8 FLOAT8
SMALLSERIAL INT2 INT2
SERIAL INT4 INT4
@dagjaneiro
dagjaneiro / lvh_ssl.md
Last active August 5, 2021 18:00
lvh.me ssl

Install nginx

$ brew install nginx

Edit nginx.conf

$ vim /usr/local/etc/nginx/nginx.conf
@dideler
dideler / upgrade-postgres-9.3-to-9.4.md
Last active June 8, 2020 03:24
Upgrading PostgreSQL from 9.3 to 9.4 when upgrading Ubuntu 14.04 to 14.10

TL;DR

Create a backup:

pg_dumpall > mybackup.sql

Perform the upgrade:

sudo pg_dropcluster 9.4 main --stop
@zetavg
zetavg / preference.rb
Last active August 29, 2015 14:05
ActiveAdmin rails-settings-cached
ActiveAdmin.register_page "Preference" do
menu priority: 2
content do
form :action => admin_preference_update_path, :method => :post do |f|
f.input :name => 'authenticity_token', :type => :hidden, :value => form_authenticity_token.to_s
panel "Preference" do
fieldset do
ol do
li do
@paulallies
paulallies / gist:0052fab554b14bbfa3ef
Last active August 3, 2024 16:45
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin <branch-name>
@ball-hayden
ball-hayden / README.md
Last active September 21, 2018 09:07
ActiveAdmin Bootstrap

ActiveAdmin Bootstrap

This is a rough proof of concept.

There will be broken things.

Comments are welcome.

Installation

@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active September 22, 2024 09:10
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository