Skip to content

Instantly share code, notes, and snippets.

View RammusXu's full-sized avatar

RammusXu RammusXu

View GitHub Profile
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, Rammus Xu!'
@RammusXu
RammusXu / bump-docker-buildx.sh
Last active September 2, 2020 03:42
Upgrade buildx version on Mac
docker buildx version
mkdir -p ~/.docker/cli-plugins
BUILDX_VERSION="v0.4.2"
wget https://github.com/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.darwin-amd64 -O ~/.docker/cli-plugins/docker-buildx
chmod a+x ~/.docker/cli-plugins/docker-buildx
docker buildx version
@RammusXu
RammusXu / github-api-update-file.sh
Last active November 28, 2024 20:44
Github REST API update file with commit
REPO=rammus/action-demo
FILE=README.md
INPUT_GITHUB_TOKEN=
# https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#get-repository-content
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $INPUT_GITHUB_TOKEN" \
"https://api.github.com/repos/${REPO}/contents/${FILE}"
@RammusXu
RammusXu / 2021-01-07
Created January 7, 2021 07:23
Github Action Machine resource
lscpu
shell: /bin/bash -e {0}
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0,1
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 1