Skip to content

Instantly share code, notes, and snippets.

Artyom Pervukhin artyom

Block or report user

Report or block artyom

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Dockerfile
FROM golang:alpine AS builder
WORKDIR /app
ENV GOPROXY=https://proxy.golang.org CGO_ENABLED=0
COPY . .
RUN go build -ldflags='-s -w' -o server
FROM scratch
EXPOSE 8080
VOLUME /web
COPY --from=builder /app/server .
@artyom
artyom / bug.md
Last active Aug 6, 2019
gomarkdown quoted fenced code block bug
View bug.md

Bug demo:

quoted block 1 start

fenced pre block 1

quoted block 1 end

@artyom
artyom / update_usage.go
Created Jun 20, 2019
Tool to generate go file with "usage" constang holding "main" package docs
View update_usage.go
//+build generate
package main
import (
"bytes"
"fmt"
"go/doc"
"go/parser"
"go/token"
View zshrc
# Correctly display UTF-8 with combining characters.
if [ "$TERM_PROGRAM" = "Apple_Terminal" ]; then
setopt combiningchars
fi
disable log
export CLICOLOR=1
export GREP_OPTIONS='--color=auto'
export LESS='-iFXc'
@artyom
artyom / meminfo.txt
Created Dec 26, 2018
memory leak on AWS ec2 a1.large
View meminfo.txt
MemTotal: 3889744 kB
MemFree: 82304 kB
MemAvailable: 18652 kB
Buffers: 32 kB
Cached: 4572 kB
SwapCached: 0 kB
Active: 514320 kB
Inactive: 2472 kB
Active(anon): 512444 kB
Inactive(anon): 224 kB
@artyom
artyom / upload-form.go
Created Oct 17, 2018
upload form to see how browser posts files to a form
View upload-form.go
// TODO describe program
package main
import (
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"strings"
@artyom
artyom / go.mod
Created Sep 3, 2018
upload-s3-random-data
View go.mod
module github.com/artyom/upload-s3-random-data
require (
github.com/aws/aws-sdk-go v1.15.6
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f // indirect
github.com/jtolds/gls v4.2.1+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/smartystreets/assertions v0.0.0-20180803164922-886ec427f6b9 // indirect
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a // indirect
@artyom
artyom / main.go
Created Jun 18, 2018
http server replying with random data of requested size
View main.go
// TODO describe program
package main
import (
"fmt"
"io"
"math/rand"
"net/http"
"os"
"strconv"
@artyom
artyom / bsdtar-ok.txt
Last active May 17, 2018
GNU tar bug — tar (GNU tar) 1.30 2017-12-17 06:43
View bsdtar-ok.txt
$ for i in {1..3} ; do echo sample $i ; mkdir unpack$i && tar tvf sample$i.tar && bsdtar xf sample$i.tar -C unpack$i && find unpack$i -ls ; done
sample 1
lrwxrwxrwx admin/admin 0 2018-05-17 15:27 foo -> bar
-rw-r--r-- admin/admin 6 2018-05-17 15:27 foo
263199 4 drwxr-xr-x 2 admin admin 4096 May 17 15:48 unpack1
266605 4 -rw-r--r-- 1 admin admin 6 May 17 15:27 unpack1/foo
sample 2
lrwxrwxrwx admin/admin 0 2018-05-17 15:25 foo -> /bar
-rw-r--r-- admin/admin 6 2018-05-17 15:25 foo
266606 4 drwxr-xr-x 2 admin admin 4096 May 17 15:48 unpack2
@artyom
artyom / Gopkg.lock
Last active Feb 23, 2018
Illustration that vgo does not (as of 2018-02-23) import "source" attribute from dep metadata
View Gopkg.lock
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "github.com/armon/go-socks5"
packages = ["."]
revision = "5ab49e6379c2e1ea5f402e29430ac01f39e60acc"
source = "github.com/artyom/go-socks5"
You can’t perform that action at this time.