Skip to content

Instantly share code, notes, and snippets.

View tutumagi's full-sized avatar
🐢

tutu tutumagi

🐢
View GitHub Profile

Problem

The go command line tool needs to be able to fetch dependencies from your private GitLab, but authenticaiton is required.

This assumes your private GitLab is hosted at privategitlab.company.com.

Environment variables

The following environment variables are recommended:

export GO111MODULE=on
export GOPRIVATE=privategitlab.company.com
@tutumagi
tutumagi / golang-tls.md
Created December 3, 2021 22:57 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@tutumagi
tutumagi / uninstall-haskell-osx.sh
Created November 23, 2021 07:48 — forked from gatlin/uninstall-haskell-osx.sh
Uninstall Haskell from Mac OS X
#!/bin/bash
# source: http://www.haskell.org/pipermail/haskell-cafe/2011-March/090170.html
sudo rm -rf /Library/Frameworks/GHC.framework
sudo rm -rf /Library/Frameworks/HaskellPlatform.framework
sudo rm -rf /Library/Haskell
rm -rf ~/.cabal
rm -rf ~/.ghc
rm -rf ~/Library/Haskell
@tutumagi
tutumagi / gomock.md
Created October 25, 2021 02:34
gomock mockgen #go

mocks 用法

mockgen -source=./cluster/cluster.go -destination ./cluster/mocks/cluster.go -package mocks mock 某个文件 到目标文件,指定package

生成go interface的 mock 文件

@tutumagi
tutumagi / at_least_one_item.js
Created September 15, 2021 10:00
mongo shell #mongo
// 某个集合中的数组类型的字段至少有一个项目
db.getCollection('tbl_land').find({
"$someArray.0": {
"$exists": true,
}
})
@tutumagi
tutumagi / kill.sh
Created May 7, 2020 02:05
kill process with port #shell
pid=`lsof -i:9090 | awk '{print $2}'`
echo $pid
for i in $pid
do
kill -9 $i
done
@tutumagi
tutumagi / desc.md
Created October 21, 2019 09:34
modify terminal hostname

link

details

if you use

sudo scutil --set HostName name-you-want
@tutumagi
tutumagi / modify_commit_user.sh
Last active December 2, 2022 03:06
modify commit usr #git
#!/bin/sh
## 1. git clone --bare your_git_repo
## 2. modify the script below
## 3. git push --force --tags origin 'refs/heads/*'
## 4. remove your temp git_repo dir
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
@tutumagi
tutumagi / client.js
Created May 8, 2019 01:54 — forked from hagino3000/client.js
WebSocket with binary data
var socket = null;
function bootstrap() {
// 適当な図形を描画
var c = document.getElementById('mycanvas');
var ctx = c.getContext('2d');
ctx.globalalpha = 0.3;
for(var i=0; i<1000; i++) {
ctx.beginPath();
@tutumagi
tutumagi / README-Template.md
Created December 27, 2018 14:37 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites