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 / 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

@sheeeng
sheeeng / nerd_fonts.md
Created May 24, 2024 08:16 — forked from davidteren/nerd_fonts.md
Install Nerd Fonts via Homebrew [updated & fixed]
@sheeeng
sheeeng / README.md
Last active April 29, 2024 09:19 — forked from duboisf/README.md
Example GitHub graphql queries using the gh cli

List all the default branches of repositories in a specific organisation

gh api graphql --paginate \
    --jq '.data.organization.repositories.nodes[] | .defaultBranchRef.name + "\t" + .name' \
    -F org=SomeOrg \
    -f query='
query($org:String!, $endCursor:String) { 
  organization(login:$org) {
    repositories(first: 100, after: $endCursor, isFork:false, orderBy: {field:NAME, direction:ASC}) {

The following icon sets are bundled with Material for MkDocs:

  • :material-material-design: – [Material Design] ( :material-account-credit-card: :material-bank: :material-cash-register: :material-safe: :material-github: :material-kubernetes: :material-microsoft-azure: )

  • :fontawesome-brands-font-awesome: – [FontAwesome] ( :fontawesome-brands-slack: :fontawesome-brands-microsoft: :fontawesome-brands-windows: :fontawesome-brands-markdown: :fontawesome-brands-python: :fontawesome-brands-golang: :fontawesome-brands-rust: )

  • :octicons-mark-github-16: – [Octicons] ( :octicons-git-branch-24: :octicons-git-commit-24: :octicons-git-compare-24: :octicons-git-merge-24: :octicons-git-merge-queue-24: :octicons-git-pull-request-24: :octicons-git-pull-request-closed-24: :octicons-git-pull-request-draft-24: )

  • :simple-simpleicons: – [Simple Icons] ( :simple-kubernetes: :simple-github: :simple-githubpages: :simple-githubactions: )

    [Materia

@sheeeng
sheeeng / gist:94b1bf746d96b58a84ec9f8d6bfefcd6
Created December 18, 2023 12:28 — forked from andreibosco/gist:cb8506780d0942a712fc
Using GNU Stow to manage your dotfiles

Fonte: http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-manage-your-dotfiles.html?round=two

I accidentally stumbled upon something yesterday that I felt like sharing, which fell squarely into the "why the hell didn't I know about this before?" category. In this post, I'll describe how to manage the various configuration files in your GNU/Linux home directory (aka "dotfiles" like .bashrc) using GNU Stow.

The difficulty is that it would be helpful to manage one's configuration files with a version control system like Git, Mercurial or Bazaar, but many/most dotfiles reside at the top-level of your home directory, where it wouldn't be a good idea to initialize a VCS repository. Over time I've come across various programs which aim to manage this for you by keeping all the files in a subdirectory and then installing or linking them into their appropriate places. None of those programs ever really appealed to me. They would require a ton of dependencies (like Ruby and a ton of libraries for it) or t

@sheeeng
sheeeng / README.md
Last active January 27, 2024 19:33 — forked from GusAntoniassi/README.md
Configure autocompletion to kubectl with zsh

kubectl with ZSH (oh-my-zsh)

How to configure

Use the following commands to add the kubectl autocomplete to zsh:

mkdir -p ~/.oh-my-zsh/custom/plugins/kubectl-autocomplete/
kubectl completion zsh > ~/.oh-my-zsh/custom/plugins/kubectl-autocomplete/kubectl-autocomplete.plugin.zsh