Skip to content

Instantly share code, notes, and snippets.

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

Artem Teleshev ateleshev

🏠
Working from home
View GitHub Profile
@slok
slok / pprof.md
Last active November 4, 2024 01:07
Go pprof cheat sheet

Enable profiling

Default http server

import (
    _ "net/http/pprof"
    "net/http"
)
@grantseltzer
grantseltzer / disassembler.go
Created September 14, 2018 06:08
Full disassembler
package main
import (
"debug/elf"
"fmt"
"log"
"os"
"github.com/bnagy/gapstone"
)
@dghubble
dghubble / Dockerfile
Created June 6, 2017 01:43
coreos-kvm
FROM ubuntu:16.10
MAINTAINER Dalton Hubble <[email protected]>
ARG CL_CHANNEL
ARG CL_VERSION
COPY scripts /scripts
RUN /scripts/build
EXPOSE 2222
ENTRYPOINT ["/scripts/start"]
@dghubble
dghubble / kubeception.md
Last active November 10, 2024 06:07
Running QEMU/KVM and Nested Kubernetes on Bare-Metal Kubernetes
@MaksymTrykur
MaksymTrykur / json2yaml.go
Last active October 17, 2017 11:42
json2yaml
package main
import (
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"os"
@ravibhure
ravibhure / git_rebase.md
Last active November 9, 2024 05:19
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@danikin
danikin / tar_test.c
Last active August 29, 2024 00:14
Tarantool Quick Test
// Tarantool quick test
// Copyright, Dennis Anikin 2016
//
// Quick disclaimer:
//
// This test shows 500K-1000K transactions per second on one CPU core
// and 600K-1600K queries per second on one CPU core.
//
// Based on the $6.57 per-month-price for the AWS t2.micro instance we can afford the tremendous number of 630bln queries for just $1
//
@tevino
tevino / epoll.go
Last active January 20, 2024 22:50
An example of using epoll in Go
package main
import (
"fmt"
"net"
"os"
"syscall"
)
const (
@drewwells
drewwells / cache.go
Last active April 22, 2024 14:50
Go benchmark of md5, sha1, sha256
package bench
import (
"crypto/md5"
"crypto/rand"
"crypto/sha1"
"crypto/sha256"
"hash"
"testing"
)
@iamralch
iamralch / sshtunnel.go
Last active August 21, 2024 05:15
SSH tunnelling in Golang
package main
import (
"log"
"bufio"
"time"
"os"
"fmt"
"io"
"net"