Skip to content

Instantly share code, notes, and snippets.

@yunga
yunga / index.html
Created March 8, 2024 21:44
SVG Unicode Emoji Favicon
<!doctype html>
<title>SVG Unicode Emoji Favicon</title>
<link rel='icon' href='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-size="99">🎮</text></svg>'>
<style>
body {
display : grid;
align-items : center;
justify-content : center;
@yunga
yunga / cryptography-file-formats.md
Created October 7, 2022 07:43 — forked from tuansoibk/cryptography-file-formats.md
Cryptography material conversion and verification commands
  1. Introduction
  2. Standards
  3. Common combinations
  4. Conversion
  5. Verification/Inspection
  6. Tips for recognising

Introduction

It happens that there are many standards for storing cryptography materials (key, certificate, ...) and it isn't always obvious to know which standard is used by just looking at file name extension or file content. There are bunch of questions on stackoverflow asking about how to convert from PEM to PKCS#8 or PKCS#12, while many tried to answer the questions, those answers may not help because the correct answer depends on the content inside the PEM file. That is, a PEM file can contain many different things, such as an X509 certificate, a PKCS#1 or PKCS#8 private key. The worst-case scenario is that someone just store a non-PEM content in "something.pem" file.

@yunga
yunga / jsClock.html
Created September 1, 2022 18:32
Javascript Clock Example
<!DOCTYPE html>
<title>Javascript Clock Example</title>
<style>
body {
font-family: Monospace;
font-weight: 600;
font-size: calc(100vw / 5.5);
-webkit-text-stroke: calc(100vw / 200) #000;
@yunga
yunga / octal_x86.txt
Created February 21, 2022 07:47 — forked from seanjensengrey/octal_x86.txt
x86 is an octal machine
# source:http://reocities.com/SiliconValley/heights/7052/opcode.txt
From: mark@omnifest.uwm.edu (Mark Hopkins)
Newsgroups: alt.lang.asm
Subject: A Summary of the 80486 Opcodes and Instructions
(1) The 80x86 is an Octal Machine
This is a follow-up and revision of an article posted in alt.lang.asm on
7-5-92 concerning the 80x86 instruction encoding.
The only proper way to understand 80x86 coding is to realize that ALL 80x86
#!/usr/bin/perl
# This filter changes all words to Title Caps, and attempts to be clever
# about *un*capitalizing small words like a/an/the in the input.
#
# The list of "small words" which are not capped comes from
# the New York Times Manual of Style, plus 'vs' and 'v'.
#
# 10 May 2008
# Original version by John Gruber:

GRUB INIT TUNE

A GRUB_INIT_TUNE uses the following format: tempo [freq duration] [freq duration]…

  • tempo: is the base for all note durations in beats per minute, 60 gives a second base (60s/60 = 1s), 120 gives a half-second base, etc.
  • freq: is the frequency (in hertz) of the sound (set 0 to produce a rest)
  • duration: is the duration of the sound in beats

You can preview the tunes below with the standalone index.html included in this gist.

@yunga
yunga / latency.txt
Created February 20, 2020 10:09 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
function linkHighlight() {
let colors = {
"HostBg": "#00F", "Host": "#FFF", "HostOut": "#000",
"DomainBg": "#808", "Domain": "#FFF", "DomainOut": "#000",
"OtherBg": "#F00", "Other": "#FFF", "OtherOut": "#000",
"WikiBg": "#FF0", "Wiki": "#000", "WikiOut": "#000",
};
let Hosts = {};
let Domains = {};
@yunga
yunga / Powershell Rosetta Stone.md
Last active April 4, 2024 07:50
Dos/Unix/Powershell Commands

Powershell Rosetta Stone

[CMD] [Unix] [Powershell] Synopsis
HELP [man] [Get-Help] Displays information about commands and concepts.
[apropos] [Get-Command] Gets all commands.
[Show-Command] Displays PowerShell commands in a graphical window.