Skip to content

Instantly share code, notes, and snippets.

View hungpk's full-sized avatar
😁
Available

Kent Pham hungpk

😁
Available
  • Ho Chi Minh City, Vietnam
View GitHub Profile
@hungpk
hungpk / rails http status codes
Created March 2, 2018 03:24 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@hungpk
hungpk / nginx.conf
Created September 14, 2018 10:47 — forked from parente/nginx.conf
nginx.conf recipe for username-based authorization levels for a Docker registry
user www-data;
worker_processes 1;
daemon off;
events {
worker_connections 1024;
}
http {
upstream docker-registry {
require 'cgi'
require 'active_support'
def verify_and_decrypt_session_cookie(cookie, secret_key_base = Rails.application.secret_key_base)
cookie = CGI::unescape(cookie)
salt = 'authenticated encrypted cookie'
encrypted_cookie_cipher = 'aes-256-gcm'
serializer = ActiveSupport::MessageEncryptor::NullSerializer
key_generator = ActiveSupport::KeyGenerator.new(secret_key_base, iterations: 1000)