Skip to content

Instantly share code, notes, and snippets.

View philipz's full-sized avatar

philipz philipz

View GitHub Profile
@philipz
philipz / readme.md
Created January 18, 2024 01:50
Kind config for ingress and volume
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
  extraMounts:
  - hostPath: /Users/YOURNAME/lab/kind
    containerPath: /home/kind
  extraPortMappings:
 ## expose port 31080 of the node to port 80 on the host
@philipz
philipz / gist:631863e64c1b028a6b80ae4facfde850
Created October 22, 2023 09:26
Render Helm Chart Templates
helm template <CHART_NAME> <REPO_NAME>/<PATH_TO_CHART>
- example -
helm template nginx-ingress nginx/nginx-ingress
helm template validator-1 ./charts/goquorum-node --namespace quorum --values ./values/validator.yml --debug > test.yaml
@philipz
philipz / readme.md
Created October 17, 2023 10:22
kubectl cp command terminates with exit code 126?

copy a file from local filesystem into a container:

cat [local file path] | kubectl exec -i -n [namespace] [pod] -c [container] "--" sh -c "cat > [remote file path]"

ex:

cat keycloak-benchmark-dataset-0.10-SNAPSHOT.jar | k exec -i pods/keycloak-65f866dc7b-2kpn5 "--" sh -c "cat > /opt/keycloak/providers/keycloak-benchmark-dataset-0.10-SNAPSHOT.jar"
@philipz
philipz / gist:04a9a165f8ce561f7ddd
Created March 9, 2015 03:17
Debian ARM64 (Aarch64) image for QEMU
QEMU version: 2.2.0
HDD init: qemu-img create -f qcow debian8-arm64.img 10G

Netinstall initrd: http://ftp.ru.debian.org/debian/dists/jessie/main/installer-arm64/20150107/images/netboot/debian-installer/arm64/initrd.gz
Netinstall kernel: wget http://ftp.ru.debian.org/debian/dists/jessie/main/installer-arm64/20150107/images/netboot/debian-installer/arm64/linux

Netinstall start:
 qemu-system-aarch64 -machine virt -cpu cortex-a57 -nographic -smp 1 -m 512 -kernel linux -initrd initrd.gz -append "root=/dev/ram console=ttyAMA0" -global virtio-blk-device.scsi=off -device virtio-scsi-device,id=scsi -drive file=debian8-arm64.img,id=rootimg,cache=unsafe,if=none -device scsi-hd,drive=rootimg -netdev user,id=unet -device virtio-net-device,netdev=unet -net user
@philipz
philipz / readme.md
Last active June 26, 2023 19:58
Install Docker on ARMv6 Raspberry Pi
@philipz
philipz / gist:1a5f7cd50bfcb938619a
Last active May 18, 2023 09:18
Docker image save/load by SSH

#Docker image save/load by SSH From Easily transfer docker images between two machines over the network

docker save busybox:latest | ssh -i ~/philipz/key.pem XXXX@192.168.2.18 'docker load'

#Docker-machine First, use $(docker-machine env XXXXX) to get control env parameter. Then you can use docker access remote cloud machine.

docker save busybox:latest | ssh -i ~/.docker/machine/machines/azdocker2/id_rsa ubuntu@azdocker2.cloudapp.net sudo docker load

@philipz
philipz / Exec.md
Created September 11, 2015 09:24
Java Runtime.getRuntime().exec() Example
package api;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

public class Exec {
@philipz
philipz / readme.md
Created June 5, 2021 13:11
Deploy to Kubernetes in Google Cloud: Challenge Lab

Task 1: Create a Docker image and store the Dockerfile

source <(gsutil cat gs://cloud-training/gsp318/marking/setup_marking.sh)
gcloud source repos clone valkyrie-app
cd valkyrie-app

cat > Dockerfile <<EOF
FROM golang:1.10
WORKDIR /go/src/app
COPY source .
@philipz
philipz / README.md
Last active June 7, 2022 14:00
擴充LVM磁碟空間步驟
  1. VM increasing the size of Disk.
  2. sudo fdisk -l 確認是否已經DISK空間是否擴增。
  3. sudo fdisk /dev/sda

[root@localhost ~]# fdisk /dev/sda Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them. Be careful before using the write command.