Skip to content

Instantly share code, notes, and snippets.

@gengwg
gengwg / if-vs-etf.md
Created April 18, 2025 03:25
differences between index funds and ETFs

Here’s a clear breakdown of the differences between index funds and ETFs (even when tracking the same stocks), along with guidance on choosing the best option for your goals:


Key Differences

Feature Index Fund (Mutual Fund) ETF (Exchange-Traded Fund)
Trading Priced once daily (after market close). Traded like stocks (intraday pricing).
Minimum Investment Often requires $1k–$3k initial buy-in. Buy any number of shares (no minimum).
Expense Ratios Slightly higher (e.g., 0.04–0.15%). Often lower (e.g., 0.03–0.10%).
@gengwg
gengwg / portfolio-45.md
Created April 17, 2025 18:26
Balanced Portfolio Allocation for Investors Aged 40–50: Optimizing Growth and Stability with SCHO, BND, VTI, and FZILX

For a 40–50-year-old investor with a moderate risk tolerance and a focus on balanced growth and capital preservation, here’s a recommended portfolio allocation using your selected funds:


Suggested Allocation

Asset Class Fund(s) Percentage Rationale
Domestic Stocks VTI 40% Core U.S. equity exposure for growth and diversification.
International Stocks FZILX 20% Diversifies globally, capturing growth in developed/emerging markets.
Broad Bonds BND 30% Stabilizes the portfolio with investment-grade U.S. bonds (mix of durations).

To add another person as an editor to your YouTube channel, follow these steps:

Via YouTube Studio (Standard Channel):

  1. Sign in to YouTube Studio:

  2. Navigate to Settings:

    • Click the Settings icon (⚙) in the left sidebar.
  3. Open Permissions:

Our Culture

Always Day 1

• Always maintain an entrepreneurial mindset. Keep pioneering and innovating instead of relying on resources or past achievements.

• Stay agile and pursue efficiency and simplicity. Reduce unnecessary procedures.

• Reject complacency. Stay open and humble.

@gengwg
gengwg / linux-antivirus.md
Created March 18, 2025 16:52
Open-source Linux antivirus and security tools

1. ClamAV

  • Description: ClamAV is a powerful open-source antivirus engine that scans for malware, including Windows viruses. It’s lightweight and widely used.
  • Installation:
    sudo dnf install clamav clamav-update
  • Update Virus Definitions:
@gengwg
gengwg / asm.md
Created March 14, 2025 17:30
"Writing and Running a Simple 'Hello, World!' Program in x86-64 Assembly on Fedora Linux"

Below is a simple "Hello, World!" program written in x86-64 assembly language for Linux. I'll also provide instructions on how to assemble, link, and run it on Fedora Linux.

Hello World Assembly Code (x86-64)

Save the following code in a file named hello.asm:

section .data
    hello db 'Hello, World!', 0x0A  ; 'Hello, World!' followed by a newline (0x0A)

section .text
@gengwg
gengwg / pytorch2024.md
Last active September 23, 2024 00:59
PyTorch Conference 2024 Notes - San Francisco

PyTorch Conference 2024

Key Takeaways

  • Exciting times ahead for Generative AI (GenAI) on edge devices.
  • Growing compute and rapid pace of model innovation for the edge.
  • The PyTorch ecosystem provides key tools to support development, including:
    • AI Edge Generative API: AI Edge Torch
    • Visualize and Debug: Model Explorer
    • Tune / Experiment with new models (not covered today but worth noting):
  • Torchchat
@gengwg
gengwg / gist:4368bd926009984f8a32beac2b0b3358
Created February 26, 2024 05:01
dpkg: dependency problems prevent configuration of linux-headers-amd64:
```
$ sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
linux-headers-6.1.0-18-amd64 linux-headers-6.1.0-18-common
The following packages have been kept back:
ca-certificates-java
@gengwg
gengwg / Llama-2-13B-chat-M1.md
Last active October 12, 2023 12:22
Run Llama-2-13B-chat locally on M1 Macbook with GPU inference

Clone

gengwg@gengwg-mbp:~$ git clone https://github.com/ggerganov/llama.cpp.git
Cloning into 'llama.cpp'...
remote: Enumerating objects: 5267, done.
remote: Counting objects: 100% (2065/2065), done.
remote: Compressing objects: 100% (320/320), done.
remote: Total 5267 (delta 1878), reused 1870 (delta 1745), pack-reused 3202
Receiving objects: 100% (5267/5267), 4.24 MiB | 13.48 MiB/s, done.
gengwg@gengwg-mbp:~$ curl -L https://iterm2.com/shell_integration/install_shell_integration_and_utilities.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5255 100 5255 0 0 27971 0 --:--:-- --:--:-- --:--:-- 28715
Downloading script from https://iterm2.com/shell_integration/zsh and saving it to /Users/gengwg/.iterm2_shell_integration.zsh...
Checking if /Users/gengwg/.zshrc contains iterm2_shell_integration...
Appending source command to /Users/gengwg/.zshrc...
Downloading imgcat...
Downloading imgls...
Downloading it2api...