Skip to content

Instantly share code, notes, and snippets.

View lupguo's full-sized avatar
🎯
Focusing

TERRY ROD lupguo

🎯
Focusing
View GitHub Profile
@lupguo
lupguo / archstat_publish.sh
Created June 20, 2023 13:28
hugo站点自动化部署脚本
#!/bin/bash
#
# hugo打包部署website 脚本
#
# Date: 2018-05-11
#
# 相关初始化
projectGitPath="/home/deployer/projects/archstat_docs"
projectGitBranch="main"
@lupguo
lupguo / README-Template.md
Created August 1, 2022 06:04 — 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

@lupguo
lupguo / Makefile
Created September 25, 2019 09:40
Go Makefile
GO_BIN ?= $(shell go env GOPATH)/bin
GO_BUILD = go build
PROG = $(GO_BIN)/$@
# export all variables
.EXPORT_ALL_VARIABLES:
GOPROXY = https://goproxy.io
VAR1=G1
VAR2=G2
@lupguo
lupguo / linux_command.md
Created June 13, 2019 10:24
Linux命令手札

网络

// TCP状态查询
netstat -n | awk '/^tcp/ {++state[$NF]} END {for(key in state) print key,"\t",state[key]}'
TIME_WAIT 	    1
ESTABLISHED 	  8
@lupguo
lupguo / os_signal_example.go
Created June 3, 2019 07:17
command listen for ctrl-C signal
package main
import (
"fmt"
"os"
"os/signal"
"time"
)
func main() {
@lupguo
lupguo / ticker_example.go
Created June 1, 2019 15:42
ticker example in go
package main
import (
"bufio"
"fmt"
"os"
"time"
)
func main() {
@lupguo
lupguo / timer_example.go
Created June 1, 2019 15:41
timer example in go
package main
import (
"fmt"
"time"
)
func main() {
timer := time.NewTimer(1 * time.Second)
@lupguo
lupguo / rpc_backoff_example.go
Created June 1, 2019 15:40
an rpc backoff example
package main
import (
"errors"
"fmt"
"github.com/cenkalti/backoff"
"math/rand"
"time"
)
@lupguo
lupguo / google.go
Created May 30, 2019 16:20
Google Search Api Using Context (Change your API Key).
// Package google provides a function to do Google searches using the Google Web
// Search API. See https://developers.google.com/web-search/docs/
//
// This package is an example to accompany https://blog.golang.org/context.
// It is not intended for use by others.
//
// Google has since disabled its search API,
// and so this package is no longer useful.
package google
@lupguo
lupguo / context_example.go
Last active May 30, 2019 16:20
go context example
package main
import (
"context"
"fmt"
"math/rand"
"sync"
"time"
)