Skip to content

Commit 4322795

Browse files
committed
note upda
- toolset setup cleanup - software engineering - os
1 parent 03ad80e commit 4322795

File tree

8 files changed

+184
-92
lines changed

8 files changed

+184
-92
lines changed

content/MacOs Setup.md

Lines changed: 22 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Author Profile:
55
- https://linkedin.com/in/xinyang-yu
66
tags:
77
Creation Date: 2023-11-30T16:47:00
8-
Last Date: 2024-03-06T16:41:07+08:00
8+
Last Date: 2024-03-10T18:25:21+08:00
99
References:
1010
title:  My Macos Setup
1111
---
@@ -20,55 +20,25 @@ title:  My Macos Setup
2020
- [Tutanota - Email Client](https://tutanota.com/#download)
2121
- [List of Wonderful Apps Waiting to Be Explored!](https://sindresorhus.com/apps)
2222

23-
**Optional:**
24-
- [Brave](https://brave.com/download/)
25-
- [SurfShark VPN](https://surfshark.com/download/macos)
26-
27-
28-
## Basic Terminal - Must Have
23+
## Pre-requisites
2924
---
30-
- [Brew - Package Manager](https://brew.sh/)
31-
- [Install ZSH](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH#how-to-install-zsh-on-many-platforms)
32-
</br>
25+
### Package Manager
26+
- [ ] [[Package Manager#Brew]]
27+
- [ ] [[Package Manager#NPM]]
28+
- [ ] [[Package Manager#Pipx]]
3329

34-
- [Install FiraCode Nerd Font](https://github.com/ryanoasis/nerd-fonts)
35-
- [Termius - Terminal GUI](https://www.termius.com/download/macos)
30+
## Terminal & Shell Setup
31+
---
32+
- [ ] [Install FiraCode Nerd Font](https://github.com/ryanoasis/nerd-fonts)
33+
- [ ] [[Terminal#ZSH]] - [[Terminal#Shell]]
34+
- [ ] [[Terminal#ohmyzsh]] - [[Terminal#Shell Enhancement]]
35+
- [ ] [Termius - Terminal GUI](https://www.termius.com/download/macos)
3636
- [Modify Default Shell](https://support.termius.com/hc/en-us/articles/8414917685145-How-to-change-the-default-shell-in-local-terminal-)
3737
- Your Termius configuration page should look something like the following picture
3838
![[termius_config.png|700]]
39-
</br>
4039

4140

42-
- [Install ohmyzsh](https://ohmyz.sh/#install)
43-
- Install zsh plugins, all plugins are install under the path that is stored in `$ZSH_CUSTOM`
44-
```bash
45-
# Install zsh-autosuggestions plugin
46-
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
47-
# Install zsh-syntax-highlighting plugin
48-
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
49-
50-
51-
# Replace the .zshrc plugins config
52-
plugins = (
53-
git
54-
zsh-autosuggestions
55-
zsh-syntax-highlighting
56-
)
57-
```
58-
</br>
5941

60-
- [Powerlevel10k theme for ohmyzsh](https://github.com/romkatv/powerlevel10k)
61-
```shell
62-
brew install romkatv/powerlevel10k/powerlevel10k
63-
echo "source $(brew --prefix)/share/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc
64-
65-
zsh # Refresh shell to confiure powerlevel10k
66-
p10k configure # Run this to reconfigure
67-
```
68-
- `stow`
69-
```bash
70-
brew install stow
71-
```
7242
## Terminal Productivity Tools
7343
---
7444
>[!caution] Display of Icons
@@ -89,16 +59,13 @@ brew install fastfetch
8959
# Add the following to the start of .zshrc
9060
fastfetch --logo <ABSOLUTE_PATH_TO_LOGO_FILE> --logo-width 70 --logo-height 30 --logo-type iterm
9161
```
92-
93-
**Others**
94-
- `pipx`
95-
- `watch`
62+
- [ ] `stow`
9663
```bash
97-
#!/bin/bash
98-
brew install pipx && pipx ensurepath
99-
100-
brew install watch
64+
brew install stow
10165
```
66+
67+
**Others**
68+
- `brew install watch`
10269
- Custom bash commands (to be added to `.zshrc`)
10370
```bash
10471
# cht.sh shortcut
@@ -113,8 +80,8 @@ h() {
11380
- [ ] [[JS Toolset]]
11481
- [ ] [[Rust Toolset]]
11582
- [ ] [[Go]]
116-
- [ ] `typescript` - `npm i -g typescript` (make sure you have [[JS Toolset#Install NVM]] first)
117-
- [ ] elixir - `brew install elixir`
83+
- [ ] `npm i -g typescript`
84+
- [ ] `brew install elixir` - Install `elixir` with [[Package Manager#Brew]]
11885
- [ ] [Java JDK](https://www.oracle.com/java/technologies/downloads/)
11986

12087

@@ -152,14 +119,14 @@ gh auth login # Painless Github CLi Auth
152119
- [ ] [[Cloudflare CLI]]
153120
- [ ] [[Secure Tunneling#Cloudflare Tunnel|cloudflared]]
154121
- [ ] [[Secure Tunneling#Ngrok]]
155-
- [ ] [`brew install terraform`](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli)
156-
- [ ] [`brew install azure-cli`](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-macos)
122+
- [ ] `brew install terraform`
123+
- [ ] `brew install azure-cli`
157124
- [ ] `brew install infracost`
158125
- [ ] `brew install terraform-docs`
159126
- [ ] [[ECS Exec|Obtain a ssh shell into ECS on local machine]]
160127
- [ ] [[AWS Parameter Store#Update Programmatically|Update parameters in AWS Parameter Store in a semi automated way]]
161128
- [ ] [[AWS Nuke]]
162-
- [ ] [`aws`](https://formulae.brew.sh/formula/awscli)
129+
- [ ] `aws`
163130
```shell
164131
#!/bin/bash
165132
brew install awscli
@@ -170,10 +137,6 @@ echo "export AWS_REGION=ap-southeast-1" >> ~/.zshrc
170137
echo >> ~/.zshrc
171138
aws configure # Auth CLi
172139
```
173-
174-
175-
176-
### Install using pipx
177140
- [ ] `pipx install checkov`
178141
- [ ] `pipx install ddtrace`
179142

content/OS/Terminologies/User.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ tags:
77
- OS
88
- linux
99
Creation Date: 2023-08-10T00:30:35+08:00
10-
Last Date: 2024-03-10T00:09:11+08:00
10+
Last Date: 2024-03-10T22:26:13+08:00
1111
References:
1212
---
1313
## Abstract
1414
---
15-
- Person authorized to use the system
15+
- Person authorised to use the system
1616

1717

1818
## Linux User
1919
---
2020
- Based on [[Unix]] & [[POSIX]]
2121
</br>
2222

23-
- Obtain Current [[User]] Info
23+
- Obtain information of all [[User]] session in the [[OS]]
2424
```bash
2525
who
2626
```
@@ -35,7 +35,17 @@ id <USER_NAME>
3535
cut -d: -f1 /etc/passwd
3636
```
3737

38+
- Create user with **administrative privileges**
39+
```bash
40+
sudo useradd -m -G wheel <USERNAME>
41+
sudo passwd johndoe # Set the password for new user
3842

43+
sudo usermod -aG <GROUPNAME> <USERNAME> # Add new user to other groups
44+
```
45+
- Delete user
46+
```bash
47+
sudo userdel <USERNAME>
48+
```
3949

4050
## Terminologies
4151
---

content/Rust/Rust Toolset.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Author Profile:
66
tags:
77
- rust
88
Creation Date: 2024-01-13, 16:52
9-
Last Date: 2024-01-13T17:00:46+08:00
9+
Last Date: 2024-03-10T18:15:15+08:00
1010
References:
1111
draft:
1212
---
@@ -16,7 +16,7 @@ draft:
1616

1717
## Obtain Rust
1818
---
19-
- Script below includes the Rust [[Language Processors#Compiler]] `rustc`, `rustup` the Rust tool chain installer and `cargo` the Rust package manager similar to [[JS Toolset#NPM]]
19+
- Script below includes the Rust [[Language Processors#Compiler]] `rustc`, `rustup` the Rust tool chain installer and [[Package Manager#Cargo]]
2020
```bash
2121
# Starts the installation of the `rustup` tool - managing the version of Rust, which installs the latest stable version of Rust
2222
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
Author:
3+
- Xinyang YU
4+
Author Profile:
5+
- https://linkedin.com/in/xinyang-yu
6+
tags:
7+
- software_engineering
8+
- macos
9+
- python
10+
- js
11+
- rust
12+
Creation Date: 2024-03-10, 17:29
13+
Last Date: 2024-03-10T22:37:20+08:00
14+
References:
15+
draft:
16+
description:
17+
---
18+
## Abstract
19+
---
20+
- A tool that automates the entire process of **installing**, **updating**, **configuring**, and **removing** software on your computer. Also **handling dependencies** under the hood
21+
22+
>[!success] Effortless Management
23+
> Without a package manager, you'd have to hunt down software, figure out all its dependencies, install everything in the right order – a tedious and error-prone process. Some may even require you to compile from source which requires a compiling tool chain.
24+
25+
26+
## Brew
27+
---
28+
- The [[Package Manager]] for MacOS
29+
- Install with `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`
30+
- [Interesting analytics data](https://formulae.brew.sh/analytics/)
31+
32+
## Pipx
33+
---
34+
- [[Package Manager]] for Python Applications
35+
- Install with [[#Brew]] - `brew install pipx && pipx ensurepath`
36+
37+
## NPM
38+
---
39+
- [[Package Manager]] for [[Node.js]] Applications
40+
- Come with [[JS Toolset#NVM]]
41+
42+
>[!code]- Obtain the absolute path to global node modules
43+
> ```bash
44+
> npm root -g
45+
>
46+
> # We can take advantage of this to copy certain runtime dep to the production build
47+
> cp -R $(npm root -g)/dd-trace ./traced-deps/node_modules
48+
> ```
49+
50+
>[!code]- Manage `package.json`
51+
> With the use of [npm pkg](https://docs.npmjs.com/cli/v7/commands/npm-pkg)
52+
> ```shell
53+
> # Example, set a script called 'pre-commit'
54+
> npm pkg set scripts.pre-commit="npx prettier . --write && npx oxlint"
55+
> ```
56+
57+
## Cargo
58+
---
59+
- [[Package Manager]] for [[Rust]]
60+
61+
62+
## Pacman
63+
---
64+
- [[Package Manager]] for Arch distros
65+
66+
>[!tip] Pacman on Tren!
67+
> [Paru](https://github.com/Morganamilo/paru?tab=readme-ov-file#installation) is a wrapper around Pacman written in [[Rust]]. Very similar syntax, zero learning curve.
68+
69+
>[!tip] Basic Syntax
70+
> Install `pacman -S` , delete `pacman -R`, search `pacman -Ss`
71+
72+
>[!code]- Install package from `package-name.pkg.tar.xz`
73+
> ```bash
74+
> sudo pacman -U package-name.pkg.tar.xz
75+
> ```
76+
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
Author:
3+
- Xinyang YU
4+
Author Profile:
5+
- https://linkedin.com/in/xinyang-yu
6+
tags:
7+
- software_engineering
8+
- bash
9+
Creation Date: 2024-03-10, 17:36
10+
Last Date: 2024-03-10T17:55:21+08:00
11+
References:
12+
draft:
13+
description:
14+
---
15+
## Terminal
16+
---
17+
- A program that provides a **text-based window** where you use the [[#Shell]] to interact with [[OS]]
18+
19+
## Shell
20+
---
21+
- The program that lets you control your [[OS]] using text commands
22+
23+
### ZSH
24+
- A [[Unix]] [[#Shell]] that is very extensive and powerful
25+
- [Install ZSH](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH#how-to-install-zsh-on-many-platforms)
26+
27+
28+
## Shell Enhancement
29+
---
30+
- Supercharging [[#Shell]]!
31+
32+
### ohmyzsh
33+
- Community-driven framework for managing [[#ZSH]] configuration
34+
- [Install ohmyzsh](https://ohmyz.sh/#install)
35+
36+
>[!code]- Install Powerlevel10k theme
37+
> [Powerlevel10k](https://github.com/romkatv/powerlevel10k) is a very customisable theme for ohmyzsh
38+
> ```shell
39+
> brew install romkatv/powerlevel10k/powerlevel10k
40+
> echo "source $(brew --prefix)/share/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc
41+
>
42+
> zsh # Refresh shell to confiure powerlevel10k
43+
> p10k configure # Run this to reconfigure
44+
> ```
45+
46+
>[!code]- Install ZSH Plugins
47+
> All plugins are install under the path that is stored in `$ZSH_CUSTOM`
48+
> ```bash
49+
> # Install zsh-autosuggestions plugin
50+
> git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
51+
> # Install zsh-syntax-highlighting plugin
52+
> git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
53+
>
54+
>
55+
> # Replace the .zshrc plugins config
56+
> plugins = (
57+
> git
58+
> zsh-autosuggestions
59+
> zsh-syntax-highlighting
60+
> )
61+
> ```

content/Tools/Datadog/Datadog RUM.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Author Profile:
66
tags:
77
- Datadog
88
Creation Date: 2023-12-04T23:09:00
9-
Last Date: 2024-02-21T16:54:44+08:00
9+
Last Date: 2024-03-10T18:13:12+08:00
1010
References:
1111
---
1212
## Abstract
@@ -49,7 +49,7 @@ datadogRum.init({
4949
```
5050

5151
### Changes for Frontend Source Codes
52-
1. Install the [[JS Toolset#NPM]] package - `npm i @datadog/browser-rum`
52+
1. Install the datadog package with [[Package Manager#NPM]] - `npm i @datadog/browser-rum`
5353
2. Append the codes we obtained from [[#Datadog Dashboard]] inside the root `.tsc` file, usually it is named as `App.tsx`, so the Datadog can monitor every page of the frontend
5454

5555
### Integration with Datadog APM

content/Tools/Git/Git Hook.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Author Profile:
66
tags:
77
- git
88
Creation Date: 2024-01-08, 22:10
9-
Last Date: 2024-01-09T21:54:15+08:00
9+
Last Date: 2024-03-10T18:13:31+08:00
1010
References:
1111
draft:
1212
---
@@ -24,6 +24,6 @@ draft:
2424

2525
## Husky
2626
---
27-
- A tool that makes working with [[Git Hook]] easier, requires the [[JS Toolset#NPM]]
27+
- A tool that makes working with [[Git Hook]] easier, requires the [[Package Manager#NPM]]
2828
- `npx husky-init && npm install` to have husky that is managing a script that runs `npm test` before every commit. Detailed can be found [here](https://typicode.github.io/husky/getting-started.html#automatic-recommended)
2929
- More configurations can be found [here](https://typicode.github.io/husky/guide.html)

0 commit comments

Comments
 (0)