Skip to content

Instantly share code, notes, and snippets.

@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"
View goversion.txt
tlstun (master) ¶ goversion -m $(which tlstun)
/Users/artyom/go/bin/tlstun go1.10
path github.com/artyom/tlstun
mod github.com/artyom/tlstun (devel)
dep github.com/armon/go-socks5 v0.0.0-20171215124554-5ab49e6379c2
=> github.com/artyom/go-socks5 v0.0.0-20171215124554-5ab49e6379c2
dep github.com/artyom/autoflags v1.1.0
dep github.com/artyom/logger v0.0.0-20170228124418-866fc605019a
dep github.com/artyom/ping v0.0.0-20180120203215-e7d66403f7ac
dep github.com/pkg/errors v0.8.0
View gist:94ed2680ccb5d8b245c7879487ccb494
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
- -------------------------------------------------------------------------
Debian Security Advisory DSA-3999-1 security@debian.org
https://www.debian.org/security/ Yves-Alexis Perez
October 16, 2017 https://www.debian.org/security/faq
- -------------------------------------------------------------------------
Package : wpa
@artyom
artyom / listen.go
Last active Aug 28, 2017
Listener with SO_REUSEPORT for linux
View listen.go
// +build !linux
package socket
import "net"
func Listen(network, address string) (net.Listener, error) { return net.Listen(network, address) }
View compiled-vs-noncompiled.txt
recheck ¶ cat naive.py
import re
for i in xrange(0,1000000):
re.match("^[\w-]+:\s", "foo: bar")
recheck ¶ time python naive.py
real 0m1.479s
user 0m1.443s
sys 0m0.020s
You can’t perform that action at this time.