Skip to content

Instantly share code, notes, and snippets.

View sheeeng's full-sized avatar
🐟
It's Wednesday! (ᗒᗣᗕ)՞

Leonard Sheng Sheng Lee sheeeng

🐟
It's Wednesday! (ᗒᗣᗕ)՞
View GitHub Profile

日本語能力試験にほんごのうりょくしけん


日本語(にほんご) 能力(のうりょく) 試験(しけん)
@sheeeng
sheeeng / handy-one-liners-for-sed.txt
Created January 27, 2025 08:10
Handy one-liners for SED
Handy one-liners for SED
HANDY ONE-LINERS FOR SED (Unix stream editor) Mar. 23, 2001
compiled by Eric Pement <[email protected]> version 5.1
Latest version of this file is usually at:
http://www.student.northpark.edu/pemente/sed/sed1line.txt
http://www.cornerstonemag.com/sed/sed1line.txt
This file is also available in Portuguese at:
http://www.lrv.ufsc.br/wmaker/sed_ptBR.html
FILE SPACING:
@sheeeng
sheeeng / Mac Keyboard Symbols.md
Created November 25, 2024 09:24 — forked from jlyonsmith/Mac Keyboard Symbols.md
List of Mac/Apple keyboard symbols

Common symbols

Modifiers

When a key combination is displayed, the modifiers are written in the order presented here. For example, Control + Option + Shift + Command + Q would be written as ⌃⌥⇧⌘Q.

Sym Key Alt
Control
Option
@sheeeng
sheeeng / git-eol.md
Created November 21, 2024 19:47 — forked from LunarLambda/git-eol.md
Guide to line ending handling in Git

Guide to line ending handling in Git

Clickbait title: Improve your Git experience with this one weird trick StackOverflow hates

If you're reading this guide, it's because you're either wondering about, or have actively run into a problem with, Git's handling of line endings. Maybe you're a Windows user, or someone working on the same repository as you is, or you do development across operating systems, or you're working with tools that break operating system convention, or...

@sheeeng
sheeeng / nix-home-manager-neovim-setup.md
Created November 12, 2024 13:39 — forked from nat-418/nix-home-manager-neovim-setup.md
Manage Neovim plugins (and more!) with Nix and Home Manager

Manage Neovim plugins (and more!) with Nix and Home Manager

Highly extensible software like Emacs, Vim, and Neovim tend to grow their own package managers. A software developer, for example, might want to install editor plugins that hook into a particular programming language's linter or language server. The programmer's text editor is therefore extended to support managing additional software to extend the text editor. If this loop continues for too long, the programmer's editor becomes more delicate and complex. The remedy for this problem is to manage software using dedicated tools apart

@sheeeng
sheeeng / from-init.lua-to-default.nix.md
Created November 12, 2024 13:39 — forked from nat-418/from-init.lua-to-default.nix.md
Advanced Neovim configuration with Nix and Home Manager

From init.lua to default.nix

In a previous post I explained how to manage Neovim plugins with Nix and Home Manager. In this post I want to go further and show how to migrate Neovim configuration from ~/.config/nvim to ~/.config/home-manager entirely. The end result will be to split our Neovim setup into multiple modules that colocate plugin sourcing and configuration.

If you haven't read the post linked above, do so now. We will assume the

@sheeeng
sheeeng / README
Created November 3, 2024 15:40 — forked from jmatsushita/README
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@sheeeng
sheeeng / mpd.md
Created October 30, 2024 19:05 — forked from lirenlin/mpd.md
simple mpd and ncmpcpp setup
@sheeeng
sheeeng / .screenrc-main-example
Created October 23, 2024 08:21 — forked from ChrisWills/.screenrc-main-example
A nice default screenrc
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - [email protected]
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Gotten from the RedHat GPG migration manual

Backup the public and secret keyrings and trust database

## Export all public keys

gpg -a --export >mypubkeys.asc