Skip to content

Instantly share code, notes, and snippets.

View razhangwei's full-sized avatar

Wei Zhang razhangwei

  • Facebook
  • Bay Area
View GitHub Profile
@razhangwei
razhangwei / ip.sh
Last active July 4, 2024 07:39
ip tool #unix
arp = ip neigh
ifconfig = ip addr
route = ip route
netstat = ss
ip addr show name
# Create MacVLan
ip link add mac0 link ens18 type macvlan mode bridge
ip addr add 192.168.0.94/27 dev mac0 # it needs to be subnet of the original macvlan
@razhangwei
razhangwei / systemctl.sh
Created July 3, 2024 17:00
systemctl #unix
systemctl status nginx
systemctl stop nginx
@razhangwei
razhangwei / mac_xbox_controller.md
Last active July 2, 2024 04:37
Stop Mac controller Xbox/PS5 Home button opening Launchpad /
defaults write com.apple.GameController bluetoothPrefsMenuLongPressAction -integer 0 
# defaults write com.apple.GameController bluetoothPrefsShareLongPressSystemGestureMode -integer -1  # This doesn't seem needed. 

https://www.youtube.com/watch?v=twDp-WGART8

@razhangwei
razhangwei / activity_watch.md
Last active July 1, 2024 22:54
ActivityWatch
@razhangwei
razhangwei / adguardhome.md
Last active July 4, 2024 05:59
AdGuard Home OMV
  • MAC VLAN?

    • Why: To simplify port mapping.
    • How:
      • Method 1: defined in docker-compose.yaml (Preferred. See the attached snippet).
      • Method 2: created in OMV compose GUI. (Not recommended since it only support IPv6).
    • what the limiation?
      • the new ip from mac vlan can only be accessed from other local devices on the same LAN but not from the docker host. That means local request forwarding is possible by other services like Caddy.
  • How to support IPv6?

@razhangwei
razhangwei / df_html.py
Created June 14, 2024 21:50
pandas display html
from IPython.display import display, HTML
t.url = t.url.apply(lambda x: f'<a href="{x}">Link</a>')
display(HTML(t.to_html(escape=False)))
@razhangwei
razhangwei / automation_meta.md
Created June 14, 2024 17:48
Automate daily tasks at Meta

What tasks?

  • Check the latest posts
  • Check the latest tech notes shared in some FYI groups.
  • Check and track launches.
@razhangwei
razhangwei / google_app_scripts.md
Created June 14, 2024 05:28
Google App Scripts

foo

@razhangwei
razhangwei / metamate.md
Created June 12, 2024 23:21
Metamate #LLM
  • Add shortcut for chrome plugin, e.g., Shift + CMD + J