Skip to content

Instantly share code, notes, and snippets.

View inotnako's full-sized avatar

Anton Konovalov inotnako

View GitHub Profile
@inotnako
inotnako / check_fcm_ports.sh
Created October 4, 2023 12:56
check_fcm_ports.sh
#!/bin/bash
echo "Check port range 5228-5230..."
echo ""
for host5 in mtalk.google.com mtalk4.google.com mtalk-staging.google.com mtalk-dev.google.com alt1-mtalk.google.com alt2-mtalk.google.com alt3-mtalk.google.com alt4-mtalk.google.com alt5-mtalk.google.com alt6-mtalk.google.com alt7-mtalk.google.com alt8-mtalk.google.com fcm-xmpp.googleapis.com gcm-xmpp.googleapis.com
do
nc -w 2 -G 2 -v -z $host5 5228-5230
done
echo "Check port range 443..."
@inotnako
inotnako / backwards.go
Last active March 14, 2021 09:27
golang zipper
package main
import (
"io"
"io/ioutil"
"os"
"strings"
)
func main() {
@inotnako
inotnako / grpc_lb_exp.go
Created October 5, 2018 12:01
grpc_lb_exp
package grpc_lb_exp
import (
"context"
"net"
"testing"
"github.com/lygo/runner"
"google.golang.org/grpc"
@inotnako
inotnako / install_node_exporter.sh
Last active December 12, 2019 13:30
install node_export via systemd
#!/usr/bin/env bash
VER=0.18.1
PKG=node_exporter-$VER.linux-amd64
echo $PKG
echo https://github.com/prometheus/node_exporter/releases/download/v$VER/$PKG.tar.gz
useradd --no-create-home --shell /bin/false node_exporter || exit 1
@inotnako
inotnako / main.go
Last active December 15, 2017 05:42
auth_proxy.go
package main
import (
"flag"
"net/http"
"net/http/httputil"
"net/url"
"strings"
)
@inotnako
inotnako / main.go
Last active June 9, 2017 11:07
bench speed transfer by go channel
package main
import (
"context"
"fmt"
"runtime"
"time"
)
const radius int = 100
@inotnako
inotnako / queue.go
Created February 1, 2017 07:16
queue.go
package queue
type Command interface {
Process(ctx context, task string, arg interface{}) Command
/*
// like tree
proc := cmd.Pocess(ctx, `users.GerAll`,&users.Req{Filter: true})
proc.Pipe(`users.Reindex`)
proc.Pipe(`users.FlushData`)
@inotnako
inotnako / bench_test.go
Last active January 15, 2017 17:44
bench channels like pubsub
package bench_chennels
import (
"runtime"
"sync"
"testing"
)
type Data struct {
Topic string
@inotnako
inotnako / bench.go
Last active January 14, 2017 12:20
benchmark of channels go1.8rc1
package benchs
import (
"runtime"
"sync"
"testing"
)
func Benchmark_Channel_Parallel(b *testing.B) {
cpu := runtime.GOMAXPROCS(-1)
@inotnako
inotnako / server.go
Last active August 29, 2023 11:38
get meta from html page
package main
import (
"encoding/json"
"net/http"
"net/url"
"golang.org/x/net/html"
"io"
)