Skip to content

Instantly share code, notes, and snippets.

@GeorgeYan
GeorgeYan / 0-go-os-arch.md
Created April 14, 2023 06:36 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@GeorgeYan
GeorgeYan / install-lrzsz.sh
Created July 7, 2022 09:21 — forked from zthxxx/install-lrzsz.sh
install-lrzsz on macOS
#!/usr/bin/env zsh
brew install lrzsz
recv='/usr/local/bin/iterm2-recv-zmodem.sh'
send='/usr/local/bin/iterm2-send-zmodem.sh'
curl -sSL https://github.com/RobberPhex/iTerm2-zmodem/raw/master/iterm2-recv-zmodem.sh -o "$recv"
curl -sSL https://github.com/RobberPhex/iTerm2-zmodem/raw/master/iterm2-send-zmodem.sh -o "$send"
chmod +x "$recv" "$send"
@GeorgeYan
GeorgeYan / git-commit-template.txt
Last active May 9, 2022 08:17
git-commit-template.txt
# type(<scope>): <subject>
# <body>
# <footer>
# type 字段包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
@GeorgeYan
GeorgeYan / staticproxy.go
Created November 9, 2021 02:54 — forked from leafney/staticproxy.go
golang下实现http代理请求
package main
/*
http代理测试
* [Mocking a HTTP access with http.Transport in Golang - oinume journal](http://oinume.hatenablog.com/entry/mocking-http-access-in-golang)
* [Go http访问使用代理](http://www.cnblogs.com/damir/archive/2012/05/06/2486663.html)
* [GO HTTP client客户端使用 - 海运的博客](https://www.haiyun.me/archives/1051.html)
* [Making Tor HTTP Requests with Go | DevDungeon](http://www.devdungeon.com/content/making-tor-http-requests-go)
@GeorgeYan
GeorgeYan / A Nuxt.js VPS production deployment.md
Created February 24, 2020 10:06 — forked from DreaMinder/A Nuxt.js VPS production deployment.md
Deployment manual for a real-world project built with nuxt.js + koa + nginx + pm2

Example of deployment process which I use in my Nuxt.js projects. I usually have 3 components running per project: admin-panel SPA, nuxt.js renderer and JSON API.

This manual is relevant for VPS such as DigitalOcean.com or Vultr.com. It's easier to use things like Now for deployment but for most cases VPS gives more flexebillity needed for projects bigger than a landing page.

UPD: This manual now compatible with [email protected]. For older versions deployment, see revision history.


Let's assume that you have entered fresh installation of Ubuntu instance via SSH. Let's rock:

@GeorgeYan
GeorgeYan / get-npm-package-version
Created September 16, 2019 09:30 — forked from DarrenN/get-npm-package-version
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@GeorgeYan
GeorgeYan / post_push
Created September 9, 2019 06:45 — forked from RobertoGraham/post_push
Docker Hub/Cloud Automated Build post_push hook to tag Maven project images with their version
#!/bin/sh
# Mounts PWD (pom.xml must be at root) on lightest Maven image and extracts the project version
VERSION=`docker run -v $(pwd):/usr/src/app \
-w /usr/src/app \
maven:3.6.0-jdk-8-alpine mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version \
-q \
-DforceStdout`
docker tag $IMAGE_NAME $DOCKER_REPO:$VERSION
docker push $DOCKER_REPO:$VERSION
@GeorgeYan
GeorgeYan / profiles.json
Last active July 12, 2019 09:02 — forked from mehulmpt/profiles.json
Sample profiles.json for new Windows Terminal
{
"globals" :
{
"alwaysShowTabs" : true,
"defaultProfile" : "{09dc5eef-6840-4050-ae69-21e55e6a2e62}",
"initialCols" : 120,
"initialRows" : 30,
"keybindings" :
[
{
@GeorgeYan
GeorgeYan / consumer.sh
Created July 2, 2018 08:41 — forked from dongjinleekr/consumer.sh
Kafka benchmark commands
## Consumer Throughput: Single consumer thread, no compression
## Consumer Throughput: 3 consumer thread, no compression
bin/kafka-consumer-perf-test.sh --topic benchmark-3-3-none \
--zookeeper kafka-zk-1:2181,kafka-zk-2:2181,kafka-zk-3:2181 \
--messages 15000000 \
--threads 1
@GeorgeYan
GeorgeYan / clean-up-boot-partition-ubuntu.md
Created May 10, 2018 01:28 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r