Skip to content

Instantly share code, notes, and snippets.

@kopwei
kopwei / ventura-local-dns.md
Created October 31, 2022 21:10
MacOS Ventura Local DNS Resolving

DNS issues resolving after upgrade to Ventura

After upgrade to Ventura I found that I can no longer use the local host name (e.g. pi, pi4main) to access the equipent in LAN.

Symptom

The following command works:

nslookup 

Keybase proof

I hereby claim:

  • I am kopwei on github.
  • I am kopkop (https://keybase.io/kopkop) on keybase.
  • I have a public key whose fingerprint is 80BF 5466 AC41 70A6 CB15 083C 7B97 B899 5BDE DA95

To claim this, I am signing this object:

@kopwei
kopwei / k3s-cluster.md
Last active April 15, 2024 15:57
K3s and Rancher on Raspberry Pi 4 Cluster

Deploy K3s and Rancher on Raspberry Pi 4 cluster

Today I tried to setup a small Kubernetes cluster on top of 3 Raspberry Pi 4 (4GB Memory). Here is the steps to install the cluster.

IMG_3817

Preparation

I have 3 Raspberry Pi 4 stacked with PoE headers and connected to a PoE switch at home. The are connected to Internet through a home router. All Pis are equipped with a 64GB Samsung SDXC card flushed with Ubuntu 20.04 image.

@kopwei
kopwei / rancher_monitoring_arm64.md
Last active March 9, 2020 18:35
Enabling rancher monitoring on arm64 platform

This trying to explain how to enable monitoring on k3s/arm64

Deployments

prometheus-operator-monitoring-operator

  • coreos-configmap-reload
  • coreos-prometheus-operator

grafana-cluster-monitoring

  • nginx
@kopwei
kopwei / space_vim_file_icon.md
Created March 27, 2019 08:06
SpaceVim file-type icon issue on Ubuntu

This is a note for installing SpaceVIM on Ubuntu

I installed SpaceVIM on Ubuntu Bionic today but the file-type icons are shown in strange Chinese characters rather than the correct icons.

Check 1: Terminal Encoding

Set terminal profile encoding to UTF-8

Check 2: VIM Encoding

Set VIM encoding to UTF-8. Check the encoding via following command in VIM

@kopwei
kopwei / net_config.md
Last active December 29, 2023 07:05
Ubuntu Bionic netplan config for Openvswitch bridged interface

Preparation

  • System ubuntu18.04.2 desktop
  • Internet interface name eth0 with dhcp.

Steps

  1. Disable network-manager:
@kopwei
kopwei / share_internet.sh
Last active November 27, 2018 14:32
Ubuntu 16 share internet connection
#!/bin/bash
set -e
INTERNET_INF=$1
SUB_INF=$2
if [ -z "$INTERNET_INF" ] || [ -z "$SUB_INF" ]; then
echo "Please enter 2 interfaces' names"
exit 1
fi
Gateway set up
The following example will focus on the most common gateway setup: an Ubuntu computer with two wired network adapters (eth0 and eth1) hosting ICS to a static internal network configured for the 192.168.0.x subnet.
For this example, eth0 is used to represent the network card connected to the Internet, and eth1 represents the network card connected to a client PC. You can replace eth0 and eth1 as needed for your situation. Also, any private IP subnet can be used for the internal network IP addresses.
In summary:
eth0 = the network adapter with internet (external or WAN).
eth1 = the network adapter to which a second computer is attached (internal or LAN).
@kopwei
kopwei / gist:9c2fc33f9e3583239e3e
Created April 22, 2015 06:36
Install Latest Git on Ubuntu
# Install Latest Git on Ubuntu:
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
@kopwei
kopwei / gist:9832139
Created March 28, 2014 13:00
Execute script as another user
su -c "Your command right here" -s /bin/sh otheruser