Skip to content

Instantly share code, notes, and snippets.

View arcosx's full-sized avatar
🌍
Remote

arcosx arcosx

🌍
Remote
View GitHub Profile
@arcosx
arcosx / download-vs-code-server.sh
Created October 8, 2022 08:18 — forked from b01/download-vs-code-server.sh
Linux script to download latest VS Code Server, good for Docker (tested in Alpine).
#!/bin/sh
set -e
# Auto-Get the latest commit sha via command line.
get_latest_release() {
tag=$(curl --silent "https://api.github.com/repos/${1}/releases/latest" | # Get latest release from GitHub API
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' ) # Pluck JSON value
sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.1.2/zsh-in-docker.sh)" -- \
-t robbyrussell \
-p https://github.com/zsh-users/zsh-autosuggestions \
-p https://github.com/zsh-users/zsh-completions \
-a 'HISTSIZE=500000' \
-a 'SAVEHIST=500000' \
-a 'setopt appendhistory' \
-a 'setopt INC_APPEND_HISTORY' \
-a 'setopt SHARE_HISTORY' \
-a 'ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=0"'
@arcosx
arcosx / init.sh
Last active June 19, 2022 11:03
Ubuntu Dev Init
# install docker
sudo apt-get remove -y docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get -y install \
ca-certificates \
curl \
gnupg \
lsb-release
@arcosx
arcosx / README.md
Created June 19, 2022 09:04
Buildkit Debug
arcosx@ubuntu:~/work/buildkit/bin$ rootlesskit  buildkitd 
[rootlesskit:parent] error: failed to setup UID/GID map: newuidmap 15088 [0 1000 1 1 100000 65536] failed: : exec: "newuidmap": executable file not found in $PATH

sudo apt install uidmap
@arcosx
arcosx / Dockerfile
Last active June 13, 2022 05:51
tailscale DERP docker
FROM golang:latest AS builder
WORKDIR /app
RUN go env -w GOPROXY=https://goproxy.cn,direct
ENV MODIFIED_DERPER_GIT=https://github.com/arcosx/tailscale.git
ENV BRANCH=derp_ip_mode
# build modified derper
RUN git clone -b $BRANCH $MODIFIED_DERPER_GIT tailscale --depth 1 && \
@arcosx
arcosx / Dockerfile
Last active June 12, 2022 15:23
Ubuntu 镜像 中国大陆地区加速
FROM ubuntu
ARG UBUNTU_MIRROR="http://mirrors.tuna.tsinghua.edu.cn/ubuntu"
RUN bash -c "if [[ -n ${UBUNTU_MIRROR} ]]; then \
sed -i 's#http://archive.ubuntu.com/ubuntu#'"${UBUNTU_MIRROR}"'#g' /etc/apt/sources.list && \
sed -i 's#http://security.ubuntu.com/ubuntu#'"${UBUNTU_MIRROR}"'#g' /etc/apt/sources.list ; \
fi"
# Configure time zone
ARG DEBIAN_FRONTEND=noninteractive
@arcosx
arcosx / tmux-cheatsheet.markdown
Created May 9, 2022 06:27 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@arcosx
arcosx / README.md
Created March 17, 2022 10:44
install llvmlite on Apple M1
arch -arm64 brew install llvm@11
LLVM_CONFIG="/opt/homebrew/opt/llvm@11/bin/llvm-config" arch -arm64 pip install llvmlite
@arcosx
arcosx / DockerDelete.md
Last active May 29, 2020 03:22
停止 删除所有的docker容器和镜像

列出所有的容器 ID

docker ps -aq

停止所有的容器

docker stop $(docker ps -aq)