Skip to content

Instantly share code, notes, and snippets.

View craftslab's full-sized avatar
:octocat:
Focusing

Jia craftslab

:octocat:
Focusing
View GitHub Profile
@craftslab
craftslab / README.md
Last active March 19, 2024 10:56
gerrit ssh

Run

# Query operators may quote values using matched curly braces (e.g. reviewerin:{Developer Group}) to sidestep issues
# with 2 levels of shell quoting (caller shell invoking SSH, and the SSH command line parser in the server).

# Query topic with whitespaces
ssh -p 29418 127.0.0.1 'gerrit query --format=JSON --current-patch-set --files topic:\"two\ \ whitespaces\"'
@craftslab
craftslab / healthcheck.sh
Last active May 28, 2024 09:15
health check
#!/bin/bash
# Set defaults
FIX_ME="true"
PLAIN_MODE="false"
SILENT_MODE="false"
VERSION_INFO="1.6.0"
# Print pass message
print_pass() {
@craftslab
craftslab / README.md
Last active February 8, 2024 13:03
github actions

GitHub Actions

Actions

---
name: Release
@craftslab
craftslab / README.md
Last active February 3, 2024 08:07
gatus deploy

Gatus Deploy

Run

docker pull twinproduction/gatus
docker run -p 8080:8080 -v "$(pwd)"/config:/config -v "$(pwd)"/data:/data --name gatus twinproduction/gatus
@craftslab
craftslab / README.md
Last active January 29, 2024 10:39
go simd

Go SIMD

Instruction Support Detection: CPUID Instruction

package main

import (
@craftslab
craftslab / Dockerfile.server
Last active April 1, 2024 07:47
bazel build
FROM openjdk:17-jdk-alpine
RUN mkdir /bazel-buildfarm
COPY *.jar /bazel-buildfarm/
COPY *.yml /bazel-buildfarm/
ENTRYPOINT ["java", "-jar", "/bazel-buildfarm/buildfarm-server.jar", "/bazel-buildfarm/buildfarm-config.yml"]
@craftslab
craftslab / README.md
Last active December 31, 2023 02:19
smtp deploy

Deploy

# port 25: SMTP
# port 8025: Web UI
docker run --rm --name=mailpit -p 25:1025 -p 8025:8025 axllent/mailpit:latest
@craftslab
craftslab / Dockerfile
Last active January 2, 2024 15:30
redoc deploy
FROM nginx:latest
RUN mkdir -p /usr/share/nginx/html/redoc
COPY redoc-static.html /usr/share/nginx/html/redoc/index.html
COPY nginx.conf /etc/nginx/conf.d/default.conf
CMD ["nginx", "-g", "daemon off;"]
@craftslab
craftslab / README.md
Last active December 30, 2023 01:44
wsl config

WSL Config

  • Open or create the WSL configuration file (located at %USERPROFILE%\.wslconfig), and enter the following content:
[experimental]
autoMemoryReclaim=gradual  # gradual  | dropcache | disabled
networkingMode=mirrored
dnsTunneling=true
firewall=true
@craftslab
craftslab / README.md
Last active April 18, 2023 02:51
fs explorer

Fs Explorer

Build

dd if=/dev/zero of=ext4.img bs=4k count=2048
mkfs.ext4 ext4.img
tune2fs -c0 -i0 ext4.img
mkdir ext4
sudo mount ext4.img ext4