Skip to content

Instantly share code, notes, and snippets.

View griimick's full-sized avatar
🦫
Where's my fish?

Soumik griimick

🦫
Where's my fish?
View GitHub Profile
@mcattarinussi
mcattarinussi / gpg-ssh-setup.md
Last active April 14, 2025 02:34
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@steven2358
steven2358 / ffmpeg.md
Last active April 25, 2025 15:57
FFmpeg cheat sheet
@BoGnY
BoGnY / README.md
Last active April 22, 2025 17:56
[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

This is a step-by-step guide on how to enable auto-signing Git commits with GPG for every applications that don't support it natively (eg. GitHub Desktop, Eclipse, Git Tower, ...)

Requirements

  • Install GPG4Win: this software is a bundle with latest version of GnuPG v2, Kleopatra v3 certificate manager, GNU Privacy Assistant (GPA) v0.9 which is a GUI that uses GTK+, GpgOL and GpgEX that are respectively an extension for MS Outlook and an extension for Windows Explorer shell
  • Install Git for Windows: so you can have a *nix based shell, this software is a bundle with latest version of Git which use MINGW environment, a Git bash shell, a Git GUI and an extension for Windows Explorer shell (Make sure your local version of Git is at least 2.0, otherwise Git don't have support for automatically sign your commits)
  • Verify
@johnsoncodehk
johnsoncodehk / ClampAngle.cs
Last active April 26, 2025 20:57
Unity Clamp Angle
public static float ClampAngle(float angle, float min, float max) {
float start = (min + max) * 0.5f - 180;
float floor = Mathf.FloorToInt((angle - start) / 360) * 360;
return Mathf.Clamp(angle, min + floor, max + floor);
}
@Dammic
Dammic / vimrc
Last active November 3, 2024 16:24
"vimrc file maintained by Damian Michalski for personal use
"Based on vimrc from Marek Tkaczyk
" NOTE: you need to create 'backup', 'swap', 'undo' and undodir folders inside ~/.vim
" NOTE: in order for airline to look good, you need to install and select powerline fonts pack
" NOTE: markonm/traces.vim is incompatible with neovim - to make it work, turn off inccommand
" NOTE: in order to make language client work, you need to execute:
" yarn global add javascript-typescript-langserver
" That will install javascript-typescript-stdio
@satwikkansal
satwikkansal / cheatsheet.cpp
Last active December 25, 2024 23:50
C++ STL cheatsheet for competitive progrmming
/*
This a header file that includes every standard library.
You can use it to save time.
NOTE: This header file may not be recognized by compilers
other than gcc.
*/
#include <bits/stdc++.h>
/*
//Use this if the above header file doesn't work.
@preethamhegdes
preethamhegdes / OkHttpUtil.java
Last active October 19, 2024 03:24
OkHttp Client Ignore certificate
import okhttp3.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.net.ssl.*;
import java.net.*;
import java.security.cert.CertificateException;
/*
okhttp version used 3.8.1
@chourobin
chourobin / 0-bridging-react-native-cheatsheet.md
Last active April 22, 2025 14:27
React Native Bridging Cheatsheet
const schema = require('./schema')
const db = require('./connection')
const fileName = './elastic-dump-jsonlines.txt'
const readJson = require('./read-json')
db.once('open', function () {
console.log('Connected to DB.')
readJsonLines()
})
@kevinadi
kevinadi / mongodb-ssl.sh
Last active March 24, 2025 10:32
Script to create self-signed CA certificates, server certificates, and client certificates for testing MongoDB with SSL
#!/bin/sh
# Generate self signed root CA cert
openssl req -nodes -x509 -newkey rsa:2048 -keyout ca.key -out ca.crt -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=root/CN=`hostname -f`/[email protected]"
# Generate server cert to be signed
openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=server/CN=`hostname -f`/[email protected]"
# Sign the server cert