IDE Like a Pro
Action | Vim - Command | Vim - Keyboard Shortcut | VS Code - Command[^2]1 | VS Code - Keyboard Shortcut[^3]2 | GoLand - Action[^5][^5.1]3 | GoLand4 - Keyboard Shortcut |
---|---|---|---|---|---|---|
Undo | u | |||||
Redo | <C-r> | |||||
➡️ Fold All | Fold All | Ctrl + K, Ctrl + 0 | Collapse All | Ctrl + K, Ctrl + 0 | ||
🔙 Unfold All | Unfold All | Ctrl + K, Ctrl + J | Expand All | Ctrl + K, Ctrl + J | ||
Expand All to Level | (Unfold All) | 1. (Ctrl + K, Ctrl + J ) | 1.1. Expand All to … | 1. Ctrl + Shift + * | ||
Fold Level 1 (2, 3…) | 2. Ctrl + K, Ctrl + 1 (2, 3…) | 1.2. … Level | 2. 1 (2, 3…) | |||
2. Expand All to Level | Assigned to Ctrl + Shift + * | |||||
➡️ Shrink Selection | Visual mode: <S-v> | Shrink Selection5 | Alt + Shift + LeftArrow | Shrink Selection | Ctrl + Shift + W (default) | |
🔙 Expand Selection | Visual mode: v | Expand Selection | Alt + Shift + RightArrow | Extend Selection | Alt + Shift + Right | |
Assigned to Alt + Shift + LeftArrow | ||||||
➡️ Move Line Down | Move Line Down | Alt + DownArrow | Move Line Down | Alt + DownArrow | ||
🔙 Move Line Up | Move Line6 Up | Alt + UpArrow | Move Line Up | Alt + UpArrow | ||
➡️ Copy Line Down | yy p | Copy Line Down | Alt + Shift + DownArrow | Duplicate Line | Alt + Shift + DownArrow | |
🔙 Copy Line Up | yy P | Copy Line7 Up | Alt + Shift + UpArrow 8 | NA | ||
Delete Current Line | dd | |||||
➡️ Add Cursor Below | Add Cursor Below | Ctrl + Shift + DownArrow | 2. UpArrow / DownArrow | |||
🔙 Add Cursor Above | Add Cursor Above | Ctrl + Shift + UpArrow | Add multiple carets on double Ctrl with arrow keys | 1. Ctrl Ctrl (hold alter second press) | ||
Cursor Undo | Cursor Undo | Ctrl + U | ||||
➡️ Right with Selection | NA | Right with Selection | Shift + RightArrow | |||
🔙 Left with Selection | NA | Left with Selection | Shift + LeftArrow | |||
➡️ Down with Selection | NA | Down with Selection | Shift + DownArrow | |||
🔙 Up with Selection | NA | Up with Selection | Shift + UpArrow | |||
Column Selection | <C-v> | Toggle Column Selection Mode | Assigned to Alt + Shift + Insert | Column Selection Mode | Alt + Shift + Insert | |
Line Selection | V | Expand Line Selection | Ctrl + L | Extend Line Selection | Reassigned to Ctrl + L | |
Format Code | <Leader> fm | Format Document | Alt + Shift + F | Reformat Code | Alt + Shift + F | |
➡️ Close Tab | Buffer close | <Leader> x | Close Editor | Ctrl + W | Close Tab | Ctrl + W |
🔙 Reopen Closed Tab | Reopen Closed Editor | Ctrl + Shift + T | Reopen Closed Tab | Ctrl + Shift + T | ||
Toggle Terminal | <M-h> (Horizon)<M-i> (Float)<M-v> (Vertical) | Toggle Terminal | Ctrl + ` | Terminal | Ctrl + ` or Ctrl + Tab, T | |
➡️ Show Explorer | <C-N> (Focus) | Show Explorer | Ctrl + Shift + E | Project View | Ctrl + Shift + E or Ctrl + Tab, 1 | |
🔙 Hide Explorer | <Leader> + e (Toggle) | Toggle Primary Sidebar | Ctrl + B | Project View | Ctrl + Shift + E | |
Command Palette | Show All Commands | Ctrl + Shift + P | Find Actions | Ctrl + Shift + P | ||
Markdown: Open Preview | Markdown: Open Preview | Ctrl + Shift + V | Preview | Ctrl + Shift + V | ||
Markdown: Open Preview to the Side | Markdown: Open Preview to the Side | Ctrl K, Ctrl + V | Editor and Preview | Ctrl K, Ctrl + V | ||
Reveal in Explorer View | Reveal in Explorer View | Assigned to Ctrl + K, E | Select Opened File | Ctrl + K, E | ||
Structure (of current file) | Focus on Outline View | Assigned to Alt + 7 9 | Structure | Alt + 7 or Ctrl +Tab, 7 | ||
➡️ Switch to Next Tab | <Tab> | Ctrl + Tab | ||||
🔙 Switch to Previous Tab | <S-Tab> | Ctrl + Shift + Tab | ||||
Search Files | <Leader> ff | Go to Files… | Ctrl + P | Go to Files… | Ctrl + P | |
Toggle Line Comment | <Leader> / | Toggle Line Comment | Ctrl + / | |||
Open in Terminal | Open in Integrated Terminal | Assigned to Ctrl + K, Ctrl + ` | Open in Terminal | Assigned to Ctrl + K, Ctrl + ` | ||
Open Keyboard Shortcuts | Preferences: Open Keyboard Shortcuts | Ctrl + K, Ctrl + S | Keymap / Configure Keymap… | Assigned to Ctrl + K, Ctrl + S | ||
➡️ Go To Next Problem | Go To Next Problem | F8 | Next Highlighted Error | Assigned to F8 | ||
🔙 Go To Previous Problem | Go To Previous Problem | Shift + F8 | Previous Highlighted Error | Shift + F8 | ||
Back | Go Back | Assigned to Alt + LeftArrow | Back | Alt + LeftArrow | ||
Forward | Go Forward | Assigned to Alt + RightArrow | Forward | Alt + RightArrow | ||
Context Actions | ~ Source Actions | Ctrl + . | Context Actions | Ctrl + . | ||
Refactor | Refactor | Assigned to Ctrl + Alt + R (to match with other refactor actions) | ||||
Introduce Variable | Ctrl + Alt + V | |||||
Introduce Constant | Ctrl + Alt + C | |||||
Extract Method | Ctrl + Alt + M | |||||
Go To | Go To | Assigned to Ctrl + K, Ctrl + G | ||||
Go To Declaration | Go To Definition | Ctrl + Click + or F12 | Go To Declaration | Ctrl + Click or F12 | ||
Go To Type Declaration | Go To Type Definition | Go To Type Declaration | Ctrl + Shift + Click or Ctrl + F12 | |||
Implement Interface | Go: Generate Interface Stubs | Implement Interface | 0. Move the cursor to the type | |||
(Workaround with Quick Fixes)10 | e.g. var _ MyInterface = (*MyType)(nil) | 1. Ctrl + . (Source Actions) | ||||
Cursor Top (First line) | First Line | gg or <C-Home> | Cursor Top | Ctrl + Home | 2. Implement Interface... (Assigned to Ctrl + Alt + I ) | |
Cursor Bottom (Last line) | Last Line | G or <C-End> | Cursor Bottom | Ctrl + End | ||
Cursor Home (Beginning of line) | ^ or Home | Cursor Home | Home | |||
Cursor End (End of line) | $ or End | Cursor End | End | |||
Copy | Yank/Copy | y (The cursor will move to the start of selected area) | ||||
Paste | Paste after cursor | (Move the cursor to end of word/line…) - p | ||||
Switch Profile | Profiles: Switch Profile… | Change to Ctrl + Shift + M (to match with browsers) | ||||
Action | Most apps | Vim - Keyboard Shortcut |
---|---|---|
Move cursor backward (1 character) | <Left> | h |
Move cursor forward (1 character) | <Right> | l |
Move cursor down (1 line) | <Down> | j |
Move cursor up (1 line) | <Up> | k |
Move cursor down (1 page) | <PageDown> | <S-Down> or <C-f> |
Move cursor up (1 page) | <PageUp> | <S-Up> or <C-b> |
Move cursor to beginning of line | <Home> | |
Move cursor to end of line | <End> | |
Move cursor to first line | <C-Home> | |
Move cursor to last line | <C-End> | |
nvim
Vim modes
Vim provides a modal user interface, which means that the result of pressing any key on the keyboard may differ depending on which mode is active at the time.
Vim has 4 main modes:
- Normal mode
- Insert mode
- Visual modes
- Command-line mode
Vim commands and Vim notation
-
In Normal mode, a Vim command is composed by pressing one or more keystrokes in sequence.
Notation Meaning x
Press x
oncedw
Press d
, thenw
(in sequence)dap
Press d
,a
, thenp
(in sequence) -
A keystroke can be composed of:
-
one key on the keyboard, e.g.
c
,m
,s
-
Some key has special names:
Notation Meaning Note <Esc>
Press the Escape key <CR>
Press the carriage return key aka <Enter>
<Ctrl>
Press the Control key <Tab>
Press the Tab key <Shift>
Press the Shift key <Up>
Press the up arrow key <Down>
Press the down arrow key ␣
Press the space bar For the full list of keys and its notations, use
:help key-notation
-
-
multiple keys on the keyboard (by pressing all at the same time). e.g.
Ctrl
andn
[!NOTE] Vim uses
<>
notation to make clear of a keystroke.Vim Notation (for a keystroke) Meaning Keyboard Key Alternative Notation c
c
m
,a
m
,a
s
s
<C-…>
control-key Ctrl
^
<M-…>
,<A-…>
alt-key or meta-key Alt
^[
<S-…>
shift-key Shift
Use an uppercase letter, e.g. V
equivalent to<S-v>
<Leader>
vim uses <Leader>
key as a namespace for our own user-defined commandsSpace
(Typically) -
-
Combine both of facts that:
- a Vim command is composed of one or more keystrokes
- a keystroke can be a single or multiple key pressing
a notation can be a little complicated:
Notation (for multiple keystrokes) First Keystroke Second Keystroke <C-n>
Press <Ctrl>
andn
(at the same time)g<C-]>
Press g
Press <Ctrl>
and]
(at the same time)<C-r>0
Press <Ctrl>
andr
(at the same time)Press 0
<C-w><C-=>
Press <Ctrl>
andw
(at the same time)Press <Ctrl>
and=
(at the same time)
Switch between Vim modes:
Mode | Purpose | How to switch to? | Note |
---|---|---|---|
Normal mode | Vim’s default mode | From other modes: press Esc | This is where all the magic happens. |
Insert mode | ~ Text Editor | From normal mode, press i , a or o : | There are also <S-i> , <S-a> and <S-o> : |
- i : Insert (before cursor). | - <S-i> : Insert at the beginning of the line. | ||
- a : Append (after cursor). | - <S-a> : Append at the end of the line. | ||
- o : Add newline (after current line) then insert (on newline) | - <S-o> : Add newline (before current line), then insert (on newline). | ||
Visual modes | Text selection | From | |
- v : Character-wise Visual mode | |||
- <S-v> : Line-wise Visual mode | |||
- <C-v> : Block-wise Visual mode | |||
Command-line mode | Run any Vim command | From press : |
GoLand keymap has changed to a custom one based on VS Code
VS Code commands can be invoked with Command Palette (Ctrl + Shift + P
)
VS Code Keyboard Shortcut is aka keybinding
GoLand actions can be invoked in Search Everywhere / Actions
Actions tab of Search Everywhere can be accessed directly with Ctrl + Shift + P
The commands Copy Line Up/Down are unbound on Linux because the VS Code default keybindings would conflict with Ubuntu keybindings
Override VS Code workbench.action.openEditorAtIndex7
Awesome playgrounds 🛝
Name | What to play? | Notes |
---|---|---|
Python Tutor | Python, Java, C, C++, JavaScript | Visual Debugger, AI Tutor |
Loupe | JavaScript’s call stack, event loop, callback queue | Visualizing the javascript runtime at runtime |
JavaScript Visualizer 9000 | JavaScript’s call stack, event loop, task queue, micro-task queue | Inspired by Loupe |
float.exposed | Floating numbers | See Exposing Floating Point |
Play with Docker | Docker, Docker Swarm | There are labs, quizzes from beginner to advanced level 1 |
Killercoda | Kubernetes, … | May support a lot of tools with your help |
TypeScript Playground | TypeScript | |
tailwindPLAY | Tailwind CSS | |
codapi | Languages (Python, Go, C), databases, network (OpenAPI, curl , caddy ), tools (git , grep , ripgrep )… | Using interactive code snippets to document and explain things |
jqkungfu | jq | Built with WebAssembly |
sandbox.bio | Terminal, jq , awk , grep , sed | Also has tutorials for jq, awk… |
Shipmight’s Helm Playground | Helm | Support only 1 template |
Paul Vollmer’s Helm Playground | Helm | Support multiple templates |
TIO - Try it online 2 | 260 practical programming language and 420 recreational programming language (e.g. Braille) | |
iximiuz Lab | DevOps Playgrounds: Linux, Docker, Kubernetes… |
Playgrounds for Golang
Name | What to play? | Notes |
---|---|---|
Go Playground | Go | |
Tour of Go | An interactive introduction to Go | |
Go by Example | Hands-on introduction to Go using annotated example programs (link back to Go Playground) | |
Play with Go | A series of hands-on, interactive, browser-based guides that introduce the tools required to work with the Go programming language. | |
Ardan Lab’s Ultimate Go Tour | For anyone who wants a jump start in learning Go or who wants a more thorough understanding of the language and its internals. |
Wizard Zines/Julia Evans’s playgrounds
Name | What to play? | Notes |
---|---|---|
memory spy | Run programs and spy on their memory! | |
mess with dns | Experiment with setting up DNS records! | |
DNS lookups | Make DNS queries without using the command line! | |
nginx playground | Test nginx configurations instantly! | |
sql playground | Run SQL queries on a simple test dataset! |
Playgrounds for JavaScript Toolchain3
Name | What to play? | Notes |
---|---|---|
Prettier Playground | JavaScript formatter | Opinionated Code Formatter |
ESLint Playground | JavaScript linter | Find and fix problems in your JavaScript code |
Babel Playground | JavaScript compiler | Use next generation JavaScript, today. |
Biome Playground | Format, lint, and more | |
Oxc Playground | The JavaScript Oxidation Compiler (Oxc) is a collection of high-performance tools for the JavaScript language written in Rust. | |
Parcel Playground | Web bundler | The zero configuration build tool for the web |
HTML to JSX, SVG to JSX | JSX | |
SVGOMG | SVGO | |
postcss-preset-env Playground | PostCSS plugins | |
Lightning CSS Playground | CSS parser, transformer, bundler, minifier |
Playground for Frontend Frameworks
Name | What to play? | Notes |
---|---|---|
SvelteJS REPL | SvelteJS | Official |
SolidJS Playground | SolidJS | Official |
VueJS Playground | VueJS | Official |
React Playground | React |
DX Playgounds
Name | What to play? | Notes |
---|---|---|
CodingFont Playground | Choose your favorite font for coding | |
VS Code Themes | Choose your favorite VS Code theme | |
Theme Studio for VS Code | Create Your Own VS Code Themes | |
Amazon AI Ready
commitment
Amazon aims to provide free AI skills training to 2 million people by 2025 with its new ‘AI Ready’ commitment 1
Courses for business and nontechnical audiences
-
Introduction to Generative Artificial Intelligence provides an introduction to generative AI, its applications, and need-to-know concepts, like foundation models. Find it on AWS Educate.
- Course Duration: 0.75h
-
Generative AI Learning Plan for Decision Makers is a three-course series covering how to plan a generative AI project and build a generative AI–ready organization. Find it on AWS Skill Builder.
-
Introduction to Amazon CodeWhisperer teaches participants how to use Amazon’s AI code generator, which produces whole lines of code. Find it on AWS Educate.
- Course Duration: 0.75h
Foundations of Prompt Engineering
The Foundations of Prompt Engineering course is available at AWS Skill builder
Prerequisites
We recommend that attendees of this course have taken the following courses:
-
Introduction to Generative AI - Art of the Possible (1 hour) - Course link
-
Planning a Generative AI Project (1 hour) - Course link
-
Amazon Bedrock Getting Started (1 hour) - Course link
- AWS Technical Essentials (4 hours) - Course link
Browsers - Tips
Keyboard Shortcuts
Browsers | Edge | Chrome | Firefox Developer Edition |
---|---|---|---|
Search Tabs | Ctrl + Shift + A | Ctrl + Shift + Tab (Show All Tabs / Search Tabs) | |
Focus on Address Bar | Ctrl + L , Alt + D , F4 | Same as Edge, F6 | |
Refresh Page (Normal Refresh) | Ctrl + R | Same as Edge | |
Settings (Hamburger) | Alt + F | ||
Clear browsing data | Ctrl + Shift + Delete | Same as Edge | |
Browser task manager | Shift + Esc | Same as Edge | |
Screenshot | Ctrl + Shift + S | Same as Edge | |
Toggle favorites bar | Ctrl + Shift + B | Same as Edge | |
Open search in sidebar | Ctrl + Shift + E | NA | |
Reorders tabs within the browser | Ctrl + Shift + PgDn/PgUp | Same as Edge | |
Switch Profile | Ctrl + Shift + M | Ctrl + Shift + M | Firefox doesn’t support profile, instead it use Container Tab |
Open Developer Tools | Ctrl + Shift + I , F12 | Same as Edge | |
Refresh Page, ignore cache (Hard Refresh) | Ctrl + Shift + R | Same as Edge | |
Inspect Element | Ctrl + Shift + C | ||
Web Console | Ctrl + Shift + K | ||
Network Monitor | Ctrl + Shift + E | ||
Browser Task Manager | Shift + Esc | Same as Edge |
See:
- Microsoft Edge - Make the most of keyboard shortcuts
- Microsoft Edge - Keyboard shortcuts
- Firefox - Keyboard shortcuts - Perform common Firefox tasks quickly
- Firefox Dev Tools - All keyboard shortcuts¶
Hidden Settings
Browsers | Edge | Chrome | Firefox Developer Edition |
---|---|---|---|
about:about (Mother of about) | |||
Advance Preference | about:config | ||
Browser Task Manager | about:processes |
Managing dotfiles with chezmoi - TODO
What is chezmoi?
How to use chezmoi?
A collection of useful tools for CLI
Terminal
Alacritty
-
Config
Alacritty looks for configuration files in:
$XDG_CONFIG_HOME/alacritty/alacritty.toml $XDG_CONFIG_HOME/alacritty.toml $HOME/.config/alacritty/alacritty.toml # Recommended $HOME/.alacritty.toml
Warp
Kitty
-
Install (Linux/Mac)
curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin
kitty will be install to
/Applications/kitty.app
on Mac~/.local/kitty.app
on Linux
-
Add icon for kitty to taskbar on Linux
# Create symbolic links to add kitty and kitten to PATH (assuming ~/.local/bin is in your system-wide PATH) ln -sf ~/.local/kitty.app/bin/kitty ~/.local/kitty.app/bin/kitten ~/.local/bin/ # Place the kitty.desktop file somewhere it can be found by the OS cp ~/.local/kitty.app/share/applications/kitty.desktop ~/.local/share/applications/ # If you want to open text files and images in kitty via your file manager also add the kitty-open.desktop file cp ~/.local/kitty.app/share/applications/kitty-open.desktop ~/.local/share/applications/ # Update the paths to the kitty and its icon in the kitty desktop file(s) sed -i "s|Icon=kitty|Icon=/home/$USER/.local/kitty.app/share/icons/hicolor/256x256/apps/kitty.png|g" ~/.local/share/applications/kitty*.desktop sed -i "s|Exec=kitty|Exec=/home/$USER/.local/kitty.app/bin/kitty|g" ~/.local/share/applications/kitty*.desktop
-
Change default icon to kitty-icon dark
# Fedora curl https://raw.githubusercontent.com/DinkDonk/kitty-icon/main/kitty-dark.png -o ~/.local/kitty.app/share/icons/hicolor/256x256/apps/kitty.png gtk-update-icon-cache -f -t ~/.local/kitty.app/share/icons/hicolor
For more information, see Install kitty
-
Shortcuts
Action Keyboard Shortcut Create a new tab Ctrl + Shift + T
Create a new window Ctrl + Shift + Enter
Change layout Ctrl + Shift + L
Close window Ctrl + Shift + W
Next window ctrl + shift + ]
Previous window ctrl + shift + [
For more information, see:
Shell
bash
zsh
oh-my-zsh: Framework for Zsh, comes with plugins, themes, functions, helpers
Antidote: zsh plugin manager (successor of Antibody
- successor of Antigen
) - Cure to slow zsh loading time
Completion, suggestions & syntax highlight for zsh
-
Completions (for a command)
-
Suggestions (from history)
-
Syntax highlight
fish
Shell Plugins
argc-completions
Argc-completions: Completions for any shell. Supports 1000+ commands. Automatically generate completion definition from help text and man page.
fzf: A command-line fuzzy finder
- Key bindings for command-line1:
CTRL-T
- Get a list of files and directoriesCTRL-R
- Get a list of command historyALT-C
- Get a list of directories
- Fuzzy Complete for files/directories2:
**<TAB>
:COMMAND [DIRECTORY/][FUZZY_PATTERN]**<TAB>
Shell Prompt
Starship: Cross-shell Prompt
See Starship
CLI tools
File navigate
broot
3: A better way to navigate directories 🌟🌟🌟
broot can replace a lot of CLI tools (e.g. ls
, cd
, tree
, df
, find
…)
- Config
- The default configuration file location is
~/.config/broot/conf.toml
- How to config Broot?
- The default configuration file location is
Data process
sed
, awk
, grep
jq
4: The original JSON processor 🌟🌟
jq
clones:
yq
7: YAML (JSON, XML, CSV, TOML, …) processor 🌟🌟
xq
8: XML, HTML processor
fx
9: Interactive JSON/YAML viewer & processor 🌟🌟🌟
CLI - Tips & Tricks
PATH
Print all entries in $PATH line by line
# For bash, zsh
echo $PATH | sed 's/:/\n/g'
# For fish
echo $PATH | sed 's//\n/g'
# Output
/home/admin/.local/bin # The shell checks this directory first
/home/admin/bin
/usr/local/bin
/usr/local/sbin
/usr/bin
/usr/sbin
Command history
What is command history
(Almost) everything you type to the terminal is saved.
Where is the command history
The command history is stored at $HISTFILE
, which by default:
- For bash, it’s
~/.bash_history
, - For zsh, it’s
~/..zsh_history
, - For fish, its’s
~/.local/share/fish/fish_history
How to use command history
-
Access last command:
- Press
Arrow Up
- Press
Arrow Up
more for last of last command - …
- Press
-
Search for a command is the command history:
Ctrl + R
For a default bash, zsh prompt, it looks like this
(reverse-i-search)`’:
-
Use
atuin
1 for a magical 🪄 shell history, which:- records additional context for your commands
- synchronizes your history between machines/shells
Command completion
How to know how to use a command?
-
Use
--help
,-h
,help
flag/option/sub-command-
Some commands support
--help
uname --help
uname -h # Does't work
-
Some commands support
-h
dig -h
dig --help # Doesn't work
-
Some commands support both
--help
,-h
and even have a sub-command namedhelp
go help
go -h
go --help
-
Some commands don’t support
--help
or-h
, and don’t have ahelp
sub-command either, e.g.ssh
,ssh-keygen
$ ssh -h unknown option -- h
$ ssh --help unknown option -- -
$ ssh help ssh: Could not resolve hostname help: Name or service not known
-
-
Access the command’s manual pages
man uname
-
tldr uname
cheat uname
https://github.com/atuinsh/atuin
https://github.com/sigoden/argc-completions
https://www.warp.dev/
https://fishshell.com/
https://github.com/tldr-pages/tldr
https://github.com/cheat/cheat
Developing inside containers
distrobox
distrobox1: Use any linux distribution inside your terminal
toolbox
toolbox2 is a tool for Linux operating systems, which allows the use of containerized command line environments
This is usedful for OSTree based operating systems like Fedora CoreOS and Silverblue. The intention of these systems is to discourage installation of software on the host, and instead install software as (or in) containers
Toolbox solves these problem by providing a fully mutable container within which one can install their favorite development and debugging tools, editors and SDKs.
devcontainers
development container (dev container) : a dev container allows you to use a container as a full-featured development environment
devcontainers spec : An open specification for enriching containers with development specific content and settings.
Tools and services support the Development Container Specification
Editors
Tools
- Jetpack.io5
devbox
6: Instant, easy, and predictable development environments (Nix-based, no container while developing) - cachix
devenv
7: Fast, Declarative, Reproducible, and Composable Developer Environments using Nix
Services
-
GitHub Codespaces
-
CodeSandbox8
-
DevPod9: Codespaces but open-source, client-only and un-opinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.
Developer tools for Backend
CLI tools
httpie
HTTPie CLI1: modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more.
hey
[hey]2: HTTP load generator, ApacheBench (ab) replacement
oha
[oha]3: HTTP load generator, inspired by rakyll/hey with tui animation.
https://github.com/httpie/cli
https://github.com/rakyll/hey
https://github.com/hatoo/oha
Developer tools for Frontend
Browser extensions
- CSS Stacking Context inspector1
- React Developer Tools2
- React Context DevTool3
- Redux DevTools4
- VisBug5: Firebug for designers
Desktop Applications
- Polypane6: The browser for ambitious web developers.
- Responsively7: Open-source DevTool for all web developers.
DevOps tools
Web app
-
DNS
-
DNS playground
- mess with dns: Do weird DNS experiments (set your own DNS records) and see how it works
-
Public DNS resolvers
- Google DNS resolver -
8.8.8.8
: DNS query with Google DNS (supports DNSSEC) - CloudFlare DNS resolver -
1.1.1.1
- Google DNS resolver -
-
DNS query
- Google DNS - Web App
- Doggo DNS: DNS query
- NsLookup.io: Find all DNS records for a domain name
-
Test, benchmark your resolver
- dnscheck.tools (Part of addr.tools): Which DNS resolver you’re using?
- Check My DNS: What RFCs the clients DNS resolver infrastructure supports?
-
Test, benchmark pupular resolvers
- DNS Speed Test: Find the Fastest DNS Server from Your Location
- DNS Speed Benchmark: Test the performance of your DNS provider from all over the world1.
- DNSPerf (from DigiCert): Compare the speed and uptime of enterprise and commercial DNS services
- Authoritative DNS providers : GoDaddy, CloudFlare, AWS Route53
- Public DNS resolvers :
1.1.1.1
,8.8.8.8
,9.9.9.9
, NextDNS - DNS Root Servers
-
-
DNSSEC
- DNS Viz: Visualizing the status of a DNS zone, understanding and troubleshooting deployment of the DNS Security Extensions (DNSSEC)
- DNSSEC Debugger (From Verisign Labs Tools)
-
HTTP
- HTTP Observatory: How secure a site’s HTTP configuration is
-
SSL
- SSL Server Test: How secure a site’s TLS configuration is
-
Network
- addr.tools: Possibly useful tools for the Internet
-
Application / End Users
- Ad Block Test: Check if your adblock solution is blocking enough hosts
- Cover Your Track: See how trackers view your browser
- myip.addr.tools (Part of addr.tools): What is your IP Address?
- dnscheck.tools (Part of addr.tools): Information about your IP Address (and DNS resolver)
CLI
dnsperf is available as a CLI app2 that test the performance of a DNS server.
https://github.com/DNS-OARC/dnsperf
Docker FAQ
RUN
, CMD
, ENTRYPOINT
Instruction | RUN | CMD | ENTRYPOINT |
---|---|---|---|
Summary | Execute “build commands”. | Specify default commands. | Specify default executable. |
Description | RUN executes any commands to create a new layer on top of current image | CMD sets the command to be executed when running a container from image. | An ENTRYPOINT allows you to configure a container that will run as an executable. |
Example | RUN apt-get update && apt-get install -y neofetch | ||
Notes | - The main purpose of a CMD is to provide (default command) and its parameters for an executing container.1 | ||
- CMD can also be used to only provide default parameters for the ENTRYPOINT instruction. 2 | - Command line arguments to docker run <image> will be appended after all elements in an exec form ENTRYPOINT , and will override all elements specified using CMD . | ||
- You can override the ENTRYPOINT instruction using the docker run --entrypoint flag. | |||
Provide defaults (executable and/or parameters) for an executing container | The container’s main executable. |
Example:
-
A simple Dockerfile use
RUN
to install neofetch and add a layerFROM ubuntu:latest RUN apt-get update && apt-get install -y neofetch
-
FROM debian-slim:latest # ... ENTRYPOINT ["docker-entrypoint.sh"] # ... CMD ["mysqld"]
-
FROM debian:bookworm-slim # ... ENTRYPOINT ["/docker-entrypoint.sh"] # ... CMD ["nginx", "-g", "daemon off;"]
Exec form vs shell form
Exec form | Shell form | |
---|---|---|
Syntax | CMD [ "executable" , "param1" , "param2" ] | RUN executable param1 param2 |
Example | CMD [ "nginx" , "-g", "daemon off;" ] | RUN apt-get update && apt-get install -y neofetch |
Advantages | - Avoid shell string munging | More relaxed, and emphasizes ease of use, flexibility, and readability |
- Invoke commands using a specific command shell, or any other executable3 | - Long commands can be split up into multiple lines4 | |
Disadvantages | There is no automatically5 using of a command shell: | There is an automatically using of a command shell6 (the default shell7). |
- There is no shell processing, e.g. variable substitution8 | ||
- The backslashes need to be escaped9 | ||
How is it parsed? | As a JSON array10 | As a regular string4 |
For more information, see exec and shell form | Docker
CMD [ "executable" , "param1" , "param2" ]
(exec form)
CMD [ "param1" , "param2" ]
(exec form, as default parameters to ENTRYPOINT)
You must use double-quotes ("
) around words, not single-quotes ('
). e.g. ENTRYPOINT ["/bin/bash", "-c", "echo hello"]
RUN [ "echo", "$HOME" ]
won’t handle variable substitution for $HOME
, but
You can invoke the command with any shell you want, but you need to do it for every command in the exec form.
You can execute a shell directly with the exec form, for example: RUN [ "sh", "-c", "echo $HOME" ]
On a Windows machine: RUN ["c:\\windows\\system32\\tasklist.exe"]
For example, RUN source $HOME/.bashrc && echo $HOME
can be split into multiple lines
-
Using escape character
RUN apt-get update && \ apt-get install -y neofetch
-
Using heredocs
RUN <<EOF apt-get update apt-get install -y neofetch EOF
For more information about heredocs, see
You can override the default shell used for the shell form of command by using SHELL
instruction
For example:
# Change the default shell to bash
SHELL ["/bin/bash", "-c"]
The default shell used for the shell form of command:
- On Linux:
["/bin/sh", "-c"]
- On Windows:
["cmd", "/S", "/C"]
A guide to write documentations as code
The tools
VSCode
Why VS Code?
VSCode’s extensions
- markdownlint: A Node.js style checker and lint tool for Markdown
- vale: Brings code-like linting to prose.
- Markdown Footnote:
[^1]
footnote syntax support to VS Code’s Markdown editor and preview
VS Code snippets
-
Alert snippets:
Configuration
-
Open Command Palette : Cmd + Shift + P
-
Search for “snippets” and select Configure User Snippets
-
Choose in the list : markdown.json (Markdown)
-
Adds this to your configuration object :
"🟦 Useful information that users should know, even when skimming content." : { "prefix": "md:note", "body": [ "> [!NOTE]", "> $1" ], "description": "Useful information that users should know, even when skimming content." }, "🟩 Helpful advice for doing things better or more easily." : { "prefix": "md:tip", "body": [ "> [!TIP]", "> $1" ], "description": "Helpful advice for doing things better or more easily." }, "🟪 Key information users need to know to achieve their goal." : { "prefix": "md:important", "body": [ "> [!IMPORTANT]", "> $1" ], "description": "Key information users need to know to achieve their goal." }, "🟧 Urgent info that needs immediate user attention to avoid problems." : { "prefix": "md:warning", "body": [ "> [!WARNING]", "> $1", ], "description": "Urgent info that needs immediate user attention to avoid problems." }, "🟥 Advises about risks or negative outcomes of certain actions." : { "prefix": "md:caution", "body": [ "> [!CAUTION]", "> $1" ], "description": "Advises about risks or negative outcomes of certain actions." }
(Source)
-
-
-
Snippet:
"md:collapsed-section": { "prefix": "md:collapsed-section", "body": [ "<details>", "<summary>$1</summary>", "</details>", ], "description": "Creates a collapsed section with the <details> tag" }
-
Shortcut: add to
keybindings.json
:{ "key": "alt+c", "command": "editor.action.insertSnippet", "when": "editorLangId == 'markdown'", "args": { "snippet": "<details>\n<summary>$0</summary>\n\n$TM_SELECTED_TEXT\n</details>" } }
(Source)
-
Don’t read the docs (of an CLI tool) without trying
Tools
tldr
tldr-pages
1: Simplified and community-driven man
pages
tldr-pages
for a CLI tool can be available for many platforms, e.g. common
, linux
, osx
, windows
, …
tldr-pages
can be accessed in a lot of ways2:
- Via a PWA: tldr.inbrowser.app
- Via a Browser extension: piraces/tldr-extension-browser
- Via a CLI tool:
- tldr-c-client: The original client, written in C
- tldr-python-client: Python command-line client for tldr pages (This one is distributed for Linux distros)
- tlrc: A new official tldr client written in Rust
- As a PDF ebook in many languages3
tldr
(tl;dr
)
: short for too long; didn't read
(also occasionally don't read
)
: (internet slang) used to introduce a summary of an online post or news article4
cheat
cheat5: cheatsheats for *nix
commands that are used frequently, but not frequently enough to be remembered
xny
xny6: A way to use Learn X in Y Minutes on the command line.
Terminal/shell completion feature
Warp’s completion
zsh completion
zsh completion with fuzzy search
fish completion
The new terminal of JetBrain’s IDEs (e.g. GoLand)
For more information, see its Introduce Blog
Fedora - Caches
Desktop applications cache
update-desktop-database ~/.local/share/applications # User-level
update-desktop-database /usr/share/applications # OS-level
Icon cache
gtk-update-icon-cache
Font cache
fc-cache -f # Generate font cache files
fc-cache -r # Erase olf font cache files, then generate new font cache files
Fedora - Change default apps
When you open a file with a file manager, the file manager needs to
-
detect the
filetype
:- via the
filename
: by lookup the table - via the file signature: with map the file signature’s
Magic Bytes
1 to taMIME type
- via the
-
choose the right application for that file.
Open file from CLI
In the CLI, to open a file, you:
- decide the application before the file; then invoke that specific application with the file path as an argument.
- only needs to decide which file to open; then let another application open that file in your preferred application.
xdg-utils (Default in Linux: Fedora, Ubuntu) | handlr | |
---|---|---|
Open a file or URL in the user’s preferred application. | xdg-open | handlr open |
Query & manage MIME types | xdg-mimes | handlr list /set /unset … |
update-mime-database |
Magic Bytes is a a type of acceptable magic number
Open terminal from Fedora Files (nautilus
)
The default terminal is Fedora is gnome-terminal
, for now you can’t change it.
- Flatpak’s Files - Extension: “Terminal plugin for Files”
- nautilus-open-any-terminal
XDG - freedesktop
XDG
- Cross-Desktop Group
- the brand of specifications2 published by freedesktop.org for interoperability between desktops.
Some of the widely-used specifications:
- Desktop base directories (
basedir
): how desktops should locate files, such as config files or application data files. - Desktop entries (
.desktop
): files describing information about an application such as the name, icon, and description
For more information, see
https://www.freedesktop.org/wiki/Specifications/
Fedora - Setup Development Environment - WIP
#!/bin/bash
# Install git
sudo dnf install git -y
# Install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Setup brew
(echo; echo 'eval "$(which brew) shellenv"') >> $HOME/.zshrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
Hardware video acceleration on Fedora
Browsers
Firefox
Apps
mpv
Add
hwdec=auto
to ~/.config/mpv/mpv.conf
VLC
Use the VLC - Flatpak version from flathub, there’s a problem with vlc - rpm package - from Fedora main repositories1.
-
Install
flatpak remote-modify --enable flathub flatpak install flathub org.videolan.VLC
-
Config
Tools
/Preferences
/Input & Codecs
/Codecs
/Hardware-accelerated decoding
/VA-API video decoder
[!TIP] If
VA-API video decoder
doesn’t work, tryVA-API video decoder with DRM
.
Useful links
gitignore
A gitignore
file specifies intentionally untracked files that Git should ignore.
note
Files already tracked by Git aren’t affected.
To stop tracking a file that’s currently tracked, use git rm --cached
to remove the file from the index.
The way git decide which files to ignore
Each line in a gitignore
file specifies a pattern.
Git normally checks gitignore
patterns from multiple sources:
-
From the file specified by the configuration variable
core.excludesFile
in the user’s~/.gitconfig
.core.excludesFile
:- Default value is
$XDG_CONFIG_HOME/git/ignore
1. - If
$XDG_CONFIG_HOME
is either not set or empty,$HOME/.config/git/ignore
(aka~/.config/git/ignore
) is used instead.
- Default value is
-
From
$GIT_DIR/info/exclude
. -
From a
.gitignore
file:- in the top-level
- in any sub-directory
of the git working tree.
-
From the command line for those commands that support them.
important
The source list is in order of precedence from lowest to highest.
Within one level of precedence, the last matching pattern decides the outcome.
note
The $XDG_CONFIG_HOME
defines the base directory relative to which user-specific configuration files should be stored. If $XDG_CONFIG_HOME
is either not set or empty, a default equal to $HOME/.config
should be used.
For more information, see
note
The patterns (in the .gitignore
file in the working tree) match relative to the location of the .gitignore
file.
For other sources, the patterns match relative to the top-level of the working tree.
Navigate with keyboard - Tips & Tricks
Move the cursor one character
- Move backward 1 character:
Left
- Move forward 1 character:
Right
Move the cursor one word
- Move backward 1 word:
- Almost anywhere:
Ctrl + Left
- Almost anywhere:
- Move forward 1 word:
- Almost anywhere:
Ctrl + Right
- Almost anywhere:
Delete one character
- Delete one character before the cursor:
Backspace
- Delete one character after the cursor:
Delete
Delete one word
- Delete one word before the cursor:
- GUI:
Ctrl + Backspace
- CLI:
Ctrl + W
,Alt + Backspace
- GUI:
- Delete one word after the cursor:
- GUI: Highlight the word with
Ctrl + Shift + Right
-Backspace
- CLI:
Alt + D
- GUI: Highlight the word with
Undo
- GUI app:
Ctrl + Z
- CLI:
Ctrl + Shift + -
Keyboard Shortcuts
Gnome
https://help.gnome.org/users/gnome-help/stable/shell-keyboard-shortcuts.html.en https://help.gnome.org/users/gnome-help/stable/keyboard-nav.html.en
Action | Keyboard Shortcuts | Note |
---|---|---|
Move a window1 | Alt + F7 | 1. Use the arrow keys to move or resize, then press Enter to finish, or press Esc to return to the original position and size. |
Resize a window1 | Alt + F8 | 2. Hold down Shift while moving/resizing to snap the window to the edges of the screen and other windows. |
Evince
Evince2 is the default document viewer of Fedora (and any Linux distro that uses Gnome)
Action | Keyboard Shortcuts | Note |
---|---|---|
Toggle Sidebar | F9 | |
Toggle Primary Menu | F10 | |
Toggle full-screen | F11 | |
Automatic Zoom | A | |
Fit Page | F | |
Fit Width | W | |
Zoom 1:1 | Ctrl + 0 | |
Toggle Continuous Scrolling | C | |
Toggle Night Mode | Ctrl + L | |
Keyboard Shortcuts | Ctrl + Shift + ? | |
Kubernetes - Tools, Tips & Tricks
k9s
k9s: ../Kubernetes CLI To Manage Your Clusters In Style!
Usage
When first opened, k9s
show the list of pods.
From the Pods
view, you can:
-
Change the selected pod (
Up
,Down
),- then doing actions with that selected pod (by pressing the key bindings in blue color), e.g.
Describe
that pod, by pressingd
Logs
, show logs of all containers of that pod, by pressingl
- …
- View that selected pod, by pressing
Enter
- then doing actions with that selected pod (by pressing the key bindings in blue color), e.g.
-
Change the namespace (by pressing the key bindings in pink color)
- to
all
by pressing0
- to
default
by pressing1
(by default,k9s
usedefault
namespace)
- to
-
Change to another list (resource)
- List all the resources, by pressing
Ctrl +A
- Change to the view for that resource, by pressing
Enter
for example: change back to the default view -
Pods
Ctrl + A
Down
s to selectpods
(the 2nd one)Enter
- Press
:
to entercommand mode
- Type in the command for pod:
pod
(or any ofpo,pod,pods,v1/pods
- showed inCtrl + A
)
- Type in the command for pod:
- List all the resources, by pressing
Action | Key Binding | Command | Note |
---|---|---|---|
Change the selected resource | Up - Down | ||
View (the selected resource) | Enter | Available for any selected resource | |
Back | Esc | ||
Quit K9s | Ctrl + C | ||
Help | ? | Available at any view, change depend on which view is showing | |
Show all available resource alias | Ctrl + A | 1. Up /Down ; 2. Enter (to close the Aliases view: use Ese or press Ctrl + A again) |
Headlamp
Headlamp1 (a CNCF Sandbox project2): A Kubernetes web UI that is fully-featured, user-friendly and extensible
Tips & Tricks
Use the right version of kubectl
for each cluster/project with asdf
You must use a kubectl
version that is compatible with your cluster control plane (kube-apiserver
).
Why
kubectl
is supported within one minor version (older or newer) of kube-apiserver
.
e.g.
kube-apiserver
is at 1.30kubectl
is supported at 1.31, 1.30, and 1.29
For more information, see
How?
See the demo at asdf-demo repository
Make aliases for kubectl
-
Just a simple alias
k
forkubectl
-
For zsh
alias k="kubectl"
-
-
Use shell plugin that provides a lot of aliases, e.g.
-
oh-my-zsh’s plugin kubectl Some useful aliases the plugin adds:
k
,kaf
,kga
. For the full lists, see kubectl.plugin.zsh | ohmyzsh. -
If you want more, kubectl-aliases add 800 aliases, see the full lists and the syntax explanation
-
Show cluster information in shell prompt
-
oh-my-zsh plugin kubectx
-
Use starship prompt, with its command for Kubernetes
-
Use fish shell, which show it by default
Add shell completions for kubectl
Configuration for completion
-
kubectl completion | kubectl Commands
-
for macOS: https://kubernetes.io/docs/tasks/tools/install-kubectl-macos/#enable-shell-autocompletion
-
for linux: https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#enable-shell-autocompletion
-
for windows: https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/#enable-shell-autocompletion
-
Add color to kubectl
output with kubecolor
kubecolor colorizes your kubectl
command output and does nothing else.
You can use kubecolor
as a complete alternative of kubect
Configuration
-
zsh
# .zshrc alias k="kubectl" if [ "$(command -v kubecolor)" ]; then alias kubectl="kubecolor" compdef kubecolor=kubectl fi
-
fish
# ~/.config/fish/config.fish if status is-interactive abbr --add k kubectl # https://fishshell.com/docs/current/cmds/abbr.html if command -v kubecolor &>/dev/null alias kubectl=kubecolor # https://fishshell.com/docs/current/cmds/alias.html # make kubecolor inherit completions from kubectl # https://fishshell.com/docs/current/cmds/complete.html complete -c kubecolor -w kubectl end end
Switch between contexts (cluster) with kubectx
kubectx: ../a tool to switch between contexts (clusters) on kubectl
faster.
Switch between namespaces with kubens
kubens: ../a tool to switch between Kubernetes namespaces (and configure them for kubectl
) easily.
Switch between contexts/namspace with kubeswitch
kubeswitch: ../kubectx for operators, treat clusters as cattle, not pets.
Linux commands and their modern versions
Read file
Read binary file
-
Example file:
ABCDabcd1234
Command | Usage | Example | Note |
---|---|---|---|
od | Display file contents in octal, decimal or hexadecimal format. | od --format=x1 --address-radix=x path/to/file | 000000 41 42 43 44 61 62 63 64 31 32 33 34 |
Optionally display the byte offsets and/or printable representation for each line. | |||
xxd | Create a hexadecimal representation (hexdump) from a binary file, | xxd path/to/file | 00000000: 4142 4344 6162 6364 3132 3334 ABCDabcd1234 |
or vice-versa. | |||
hexyl | A simple hex viewer for the terminal. | hexyl path/to/file | │00000000│ 41 42 43 44 61 62 63 64 ┊ 31 32 33 34 │ABCDabcd┊1234 │ |
Uses colored output to distinguish different categories of bytes. |
note
Copy & paste examples
echo ABCDabcd1234 | od --format=x1 --address-radix=x
echo ABCDabcd1234 | xxd
echo ABCDabcd1234 | hexyl
tip
The extra value of 0a
(at the end) is the ASCII code for LF (LineFeed)
, which is the newline on many systems1.
How to quickly explore a Github repository - WIP
What? | Why? | How? | Note | |
---|---|---|---|---|
Use Github web | - | |||
Open the repo in vscode.dev | ||||
Use a 3rd-party online editor | github1s 1 | Also works with gitlab repo, npm package | ||
Temporary clone and peek at it | git-peek 2 | |||
Clone and have your own copy |
https://github.com/conwnet/github1s
https://github.com/Jarred-Sumner/git-peek
Starship: Cross-shell Prompts
Starship: The minimal, blazing-fast, and infinitely customizable prompt for any shell!
Config
Config file
~/.config/starship.toml
Custom commands
[custom.typescript]
description = "TypeScript"
symbol = " "
style = "#3178C5 bold"
when = "jq --exit-status '.devDependencies.typescript' package.json"
command = "jq --raw-output '.devDependencies.typescript' package.json | tr --delete '^'"
[custom.react]
description = "React"
symbol = " "
style = "#149ECA bold"
when = "jq --exit-status '.dependencies.react' package.json"
command = "jq --raw-output '.dependencies.react' package.json | tr --delete '^'"
[custom.nextjs]
description = "Next.js"
symbol = "Next.js "
style = "#F0F0F0 bold"
when = "jq --exit-status '.dependencies.next' package.json"
command = "jq --raw-output '.dependencies.next' package.json | tr --delete '^'"
[custom.tailwind]
description = "Tailwind CSS"
symbol = " "
style = "#38BDF8 bold"
when = "jq --exit-status '.devDependencies.tailwindcss' package.json"
command = "jq --raw-output '.devDependencies.tailwindcss' package.json | tr --delete '^'"
Tmux
Getting Started
What is tmux?
tmux is a program which runs in a terminal and allows multiple other terminal programs to be run inside it
Why tmux?
- Work with multiple programs and shells together in one terminal, a bit like a window manager.
Concepts & terms
The tmux server and clients
-
tmux server: tmux keeps all its state in a single main process, called the tmux
server
. -
tmux client:
- Users attach to the tmux
server
by starting aclient
- Attaches a tmux
session
from an outsideterminal
such as xterm(1)
- Users attach to the tmux
Sessions, windows and panes
- Session: Groups 1+
windows
together - Window: Groups 1+
panes
together, linked to 1+sessions
- Pane: Contains a
terminal
and running program, appears in onewindow
Quick start
Help
C-b ?
tip
What does C-b ?
mean?
It means:
- Press
Ctrl
andb
- Then press
?
(It’sShift
+/
)
tip
How to exit the help menu of Tmux?
Press q
Start a new session
tmux
Detach from the current session (inside a tmux session)
C-b d
Start a new named session
tmux new -s SESSIONNAME
List existing sessions
tmux ls
Attach to the most recently used session
tmux attach
Create a new window (inside a tmux session)
C-B c
Switch between sessions and windows (inside a tmux session)
C-B w
Kill a session by name
tmux kill-session -t SESSIONNAME
Tips & Tricks
Copy and Paste
Hold Shift
/ Select text (with mouse) / Ctrl + Shift + C
/ Ctrl + Shift + V
VS Code - Tip & Tricks
Start VS Code in a specific profile
VS Code doesn’t have a setting for a default profile.
The only way to start VS Code in a specific profile is via CLI.
Via CLI
-
Manually open VS Code with the profile you want
code --profile MyProfile
-
Tell the shell to automatically pass the argument for you
# .zshrc VSCODE_PROFILE=Fedora function code { /usr/bin/code "$@" --reuse-window --profile $VSCODE_PROFILE }
[!TIP] I also pass in
--reuse-window
argument.code ~/.zshrc
[!WARNING] By doing this, our
code
will always start with extra--profile
argument.It may break default behavior of
code
:- We can no longer use code subcommands, e.g.
code tunnel
,code serve-web
- We can no longer use code subcommands, e.g.
Via GUI
Linux - Fedora - Gnome
In GNOME and other freedesktop.org-compliant desktop environments, such as KDE and Unity, applications are added to the desktop’s menus or desktop shell via desktop entries, defined in text files with the
.desktop
extension (referred to as desktop files). The desktop environments construct menus for a user from the combined information extracted from available desktop entries.Desktop files may be created in either of two places:
/usr/share/applications/
for desktop entries available to every user in the system~/.local/share/applications/
for desktop entries available to a single userHow can I add an application to the GNOME application menu? | StackExchange
The desktop entry of VS Code is stored at /usr/share/applications/code.desktop
.
Add the argument to Exec
field.
Exec=/usr/share/code/code --profile Fedora --unity-launch %F
warning
You will need sudo
permission to edit this file. Remember to backup it before editing.
Working with files - Tips & Tricks
Show hidden files
Tools | Linux - GNOME (Files , aka Nautilus ) | CLI - broot | Windows (File Explorer ) | MacOS (Finder ) |
---|---|---|---|---|
Action | Show/hide hidden files | :toggle_hidden [^hidden-gitignored-files]1 | Windows 11: View / Show / Hidden items | |
Keyboard Shortcut | Ctrl + H | Alt + H | Cmd + Shift + . (Period) |
YAML
.yaml
or .yml
- According to the Original YAML Website’s FAQ1, please use
.yaml
when possible. - According to Official YAML Website’s FAQ2, the
.yaml
extension is preferred but.yml
is common and acceptable.
Zsh
ohmyzsh
What is ohmyzsh?
Why use ohmyzsh?
-
Aliases:
~
,..
,/
d
: alias fordirs
: lists last visited directoriescd +n
:-
: alias forcd 0
1
: alias forcd 1
2
,…,9
: alias forcd 2
, …,cd 9
-
Plugins:
ohmyzsh is bundled with a lot of plugins, which allow you to take advantage of functionality of many sorts to your shell just by enabling them.
e.g.
git
,sudo
,last-working-dir
,globalias
,kubectl
[!TIP] For more information, see
How to use ohmyzsh?
-
Reload zsh config:
-
Restart terminal
-
Restart zsh session with:
-
omz reload
# Restart the current Zsh session and Oh My Zsh: omz reload
[!TIP] What does
omz reload
do? It simply runexec zsh
1 -
exec
exec zsh
-
-
caution
To reload your zsh config, don’t run source ~/.zshrc
Packages manager
Antidote
antidote is my current package manager for zsh
antidote allows deferred loading for plugins that support it.
Config
Fish Shell - Tips & Tricks
Configuration
Show the web-based configuration interface
Use fish_config
command to start the web-based configuration interface
fish_config
Web config started at file:///tmp/web_configd369_8st.html
If that doesn't work, try opening http://localhost:8003/2d4d16ce88565f217f8d6345721cd63a/
Hit ENTER to stop.
Reload config
Use source
command to reload the configuration file
# Reload default configuration file
source ~/.config/fish/config.fish
For more information, see Configuration | Fish Language
Plugin manager
fisher: A plugin manager for Fish
Plugins
- fzf.fish: Augment your Fish command line with mnemonic key bindings to efficiently find what you need using fzf.
- hydro: Ultra-pure, lag-free prompt with async Git status. Designed for Fish.
- jethrokuan/z: a port of z for the fish shell (fast & fish-friendly, with tab-completions and lazy-loading)
Config
VS Code - markdownlint - Config
Config for markdownlint, an extension for VS Code, powered by markdownlink library for Node.js (which inspired by markdownlink for Ruby).
Auto fix on save1
// settings.json
{
"editor.codeActionsOnSave": {
"source.fixAll.markdownlint": "true",
},
}
My brief understand of things in a VUCA world
github-actions.md
Github Actions : an end-to-end GitHub-centric SDLC process. : provides an automation platform and framework that has been missing from GitHub previously and has had to be added on with other solutions such as Jenkins or Travis CI.
ostree
ostree : “git for operating system binaries”1 : Used in Fedora atomic desktop OSes2, RHEL CoreOS
https://ostreedev.github.io/ostree/introduction/#:~:text=%E2%80%9Cgit%20for%20operating%20system%20binaries%E2%80%9D
https://fedoraproject.org/atomic-desktops/
runtime
runtime : execution time : the amount of time that a program takes to perform a task
runtime : a computer program that enables other computer programs to run inside it
XY problem
XY problem : (Wikipedia) a communication problem encountered in situations where:
- the question is about an end user’s attempted solution X
- (rather than the root problem Y)
Image: Sketchplanations