Skip to content

Instantly share code, notes, and snippets.

View aucker's full-sized avatar
🎯
Focusing

Aucker aucker

🎯
Focusing
View GitHub Profile
@aucker
aucker / latency.markdown
Created May 30, 2022 01:04 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 Β΅s
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 Β΅s
SSD random read ........................ 150,000 ns  = 150 Β΅s

Read 1 MB sequentially from memory ..... 250,000 ns = 250 Β΅s

@aucker
aucker / proxy.md
Last active March 27, 2023 06:46

Use proxy in WSL2:rocket:

TL;DR

Every time windows reboots, the IPv4 address will change, FXXK!!!:sweat_smile:

In .zshrc or .bashrc file, write the following commands:

export HTTP_PROXY=http://xxx.xxx.xxx.xxx:port

I found a better way:

@aucker
aucker / WSL.md
Last active July 17, 2022 13:13
Configure WSL(ubuntu20.04)

Use Ubuntu WSL instead of XFCE Manjaro:baby:

I have some labs to do so I need a Linux enviroment. However, the XFCE Manjaro has some bugs:

  • The bustub make file can not run on manjaro/arch linux
  • The XFCE crashes sometimes
  • The window manager is so poor

So I choose the Ubuntu 20.04 WSL on Windows10.

Without expectation, there are some things I need to configure.

add a user[optional]

@aucker
aucker / gist:457a9f1ab622f677b31765254c725bf0
Created June 1, 2022 12:22 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@aucker
aucker / install-alacritty-ubuntu.sh
Created July 18, 2022 06:45 — forked from Aaronmacaron/install-alacritty-ubuntu.sh
Install Alacritty on Ubuntu
#!/bin/bash
# This installs alacritty terminal on ubuntu (https://github.com/jwilm/alacritty)
# You have to have rust/cargo installed for this to work
# Install required tools
sudo apt-get install -y cmake libfreetype6-dev libfontconfig1-dev xclip
# Download, compile and install Alacritty
git clone https://github.com/jwilm/alacritty
@aucker
aucker / curl & wget.md
Created August 26, 2022 01:34
The curl and wget tools

Curl & Wget(●'β—‘'●)

Curl

Usually, I can curl through the link to get some info.

➜  ~ curl www.google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
@aucker
aucker / Compile-benchmark.md
Last active March 3, 2025 12:11
use different cpu to build the Firefox and Chromium

Compiling firefox using the different cpu, perhaps I will add the m1 pro and m1 max benchmark.

AMD Ryzen 7 6800H

ThinkBook 14 G4+ ARA

envs: Windows 11 pro, WSL2, Ubuntu20.04

24:35.31 (suppressed 9 warnings in gfx/cairo)
24:35.31 (suppressed 1 warnings in gfx/graphite2)
24:35.31 (suppressed 23 warnings in gfx/skia)
24:35.31 (suppressed 4 warnings in intl/icu)
@aucker
aucker / README.md
Created August 30, 2022 05:45 — forked from djfdyuruiry/README.md
WSL 2 - Enabling systemd

Enable systemd in WSL 2

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

    cd /tmp
@aucker
aucker / unhex.md
Created September 3, 2022 06:30
impl the `unhex` function in OpenMLDB

I want to add the new built-in function in OpenMLDB, called unhex. The unhex has the following action just like Spark SQL and MySQL.

Spark SQL:

spark-sql> select unhex(hex('Spark SQL'));
Spark SQL
Time taken: 2.163 seconds, Fetched 1 row(s)
spark-sql> select unhex(hex(14));

Time taken: 0.065 seconds, Fetched 1 row(s)

I have a tex template, so I need to install latex on wsl ubuntu.

  1. install the texlive-latex-extra and texlive
sudo apt install texlive-latex-extra texlive
  1. ctexbook.cls not found, install texlive-lang-chinese
sudo apt install texlive-lang-chinese