Skip to content

Instantly share code, notes, and snippets.

View abusizhishen's full-sized avatar
🏠
Working from home

Nanthen Hale abusizhishen

🏠
Working from home
  • 04:43 (UTC +08:00)
View GitHub Profile
@welshstew
welshstew / activemq-startup.log
Created May 8, 2019 19:47
Groovy to Get Jolokia Metrics over HTTP
2019-05-08 08:39:20,801 | INFO | Connector ws started | org.apache.activemq.broker.TransportConnector | main
2019-05-08 08:39:20,803 | INFO | Apache ActiveMQ 5.14.5 (localhost, ID:user-somehost-33725-1557301160364-0:1) started |
2019-05-08 08:39:21,288 | INFO | ActiveMQ WebConsole available at http://0.0.0.0:8161/ | org.apache.activemq.web.WebConsoleStarter | main
2019-05-08 08:39:21,289 | INFO | ActiveMQ Jolokia REST API available at http://0.0.0.0:8161/api/jolokia/ | org.apache.activemq.web.WebConsoleStarter | main
2019-05-08 08:39:21,335 | INFO | Initializing Spring FrameworkServlet 'dispatcher' | /admin | main
2019-05-08 08:39:21,525 | INFO | No Spring WebApplicationInitializer types detected on classpath | /api | main
2019-05-08 08:39:21,587 | INFO | jolokia-agent: Using policy access restrictor classpath:/jolokia-access.xml | /api | main
2019-05-08 08:53:46,777 | INFO | Connector vm://localhost started | org.apache.activemq.broker.TransportConnector | qtp593103894-60
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 24, 2024 08:30
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@miguelmota
miguelmota / interface_to_bytes.go
Last active February 24, 2024 00:07
Golang interface to bytes using gob encoder
package main
import (
"encoding/gob"
"bytes"
)
func GetBytes(key interface{}) ([]byte, error) {
var buf bytes.Buffer
enc := gob.NewEncoder(&buf)
@ankanch
ankanch / getlocalIP.go
Created October 25, 2017 13:13
[Golang] Get Public IP address via Public IP API
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.ipify.org?format=text" // we are using a pulib IP API, we're using ipify here, below are some others
// https://www.ipify.org
// http://myexternalip.com
@zupzup
zupzup / main.go
Created July 14, 2017 12:46
Example for Basic AST Traversal in Go
package main
import (
"fmt"
"go/ast"
"go/parser"
"go/printer"
"go/token"
"log"
"os"
@nilsmagnus
nilsmagnus / kafka_consumer.go
Created February 15, 2017 08:04
Example of go consuming from kafka, using the shopify/sarama library
package main
import (
"fmt"
"github.com/Shopify/sarama"
"os"
"os/signal"
"strings"
)
@ncdc
ncdc / ast.go
Created November 9, 2016 20:50
golang ast parsing to extract a variable's value
package main
import (
"fmt"
"go/ast"
"go/parser"
"go/token"
)
func main() {
@subfuzion
subfuzion / curl.md
Last active May 16, 2024 18:04
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@akinLiu
akinLiu / city.json
Created February 23, 2016 02:34
城市商圈,地铁
{
"request_id": "2220913894196",
"errno": 0,
"error": "",
"data": {
"info": [
{
"city_id": 110000,
"city_name": "北京",
"subway_line": [

Set rz and sz on Mac

There are a mess of troubles in sending and receiving files from my macbook to dev server, since I had no permission to excute command scp on dev server. Here is a lightweight, quick, and convenience tools which related with ssh, called lrzsz. lrzsz is a unix communication package providing the XMODEM, YMODEM, ZMODEM file transefer protocol which usually has been already installed in most of servers.

Prerequisites

  • iTerm2 is necessary. [Here][] is the official website.