Skip to content

Instantly share code, notes, and snippets.

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

Basant Besra besrabasant

🏠
Working from home
View GitHub Profile
@besrabasant
besrabasant / ssh-certificate-authentication.md
Created March 17, 2024 11:39 — forked from allthingsclowd/ssh-certificate-authentication.md
How to configure SSH Certificate based Authentication - Great for large scale deployment and management of servers

SSH Certificate based Authentication - Quick Guide

Certificate Authority (CA) Server Host Server(s) Client(s)
Host Server Certificate Configuration
This is the server typically managed by a security team. The root CA private keys are held on this server and should be protected. If these keys are compromised it will be necessary to Revoke & Rotate/Recreate ALL Certificates!! These are the servers that are being built or reprovisioned. The Host CA Signed Certificate is used to prove Host Authenticity to clients. It is sent to the ssh client during the initial handshake when a ssh client attempts to login. The user laptop or server that's runing the ssh client. The Client CA Signed Certificate is used to prove Client Authenticity to the Host Server
Step 1. Create HOST CA signing keys : Example ssh-keygen -t rsa -N '' -C HOST-CA -b 4096 -f host-ca Step 2. Let's generate a fresh set of ssh RSA HOST keys with 4096 bits. Typically the keys are generated by default
@besrabasant
besrabasant / Laravel-Container.md
Created April 23, 2019 02:35
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Translations: Korean (by Yongwoo Lee)

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

@besrabasant
besrabasant / rafQueue.js
Created July 19, 2023 04:57
Utility script for queuing promises
/**
* requestAnimationFrame polyfill from Paul Irish
* http://paulirish.com/2011/requestanimationframe-for-smart-animating/
* MIT license
*/
var lastTime = 0,
vendors = ["ms", "moz", "webkit", "o"]
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x] + "RequestAnimationFrame"]
@besrabasant
besrabasant / about.md
Last active March 3, 2023 06:48
Submitting Forms with Turbolinks ( tested with Laravel );
@besrabasant
besrabasant / ReadMe.md
Created June 18, 2022 17:41
Asus M16 - Arch Linux / Manjaro - Configure System Keys Properly
@besrabasant
besrabasant / ReadMe.md
Created June 15, 2022 18:32
Bluetooth Volume too low (only in Arch Linux / Manjaro)
@besrabasant
besrabasant / readme.md
Created June 14, 2022 14:45
ASUS Rog M16 - Arch Linux - Control Blutooth audio
@besrabasant
besrabasant / docker-aliases.sh
Created September 4, 2021 10:02 — forked from jgrodziski/docker-aliases.sh
Useful Docker Aliases
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #
@besrabasant
besrabasant / readme.md
Last active June 8, 2020 05:13
Download Docker Images without Docker Pull
@besrabasant
besrabasant / script.js
Last active May 7, 2020 15:02
Get Query String Parameters as JSON Object with JavaScript
function getUrlParameter(name, defaultValue = "") {
query = query.substring(location.search.indexOf("?") + 1);
var re = /([^&=]+)=?([^&]*)/g;
var decodeRE = /\+/g;
var decode = function(str) {
return decodeURIComponent(str.replace(decodeRE, " "));
};