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 July 1, 2024 11:41
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 <dghubble@gmail.com>
ARG CL_CHANNEL
ARG CL_VERSION
COPY scripts /scripts
RUN /scripts/build
EXPOSE 2222
ENTRYPOINT ["/scripts/start"]
@dghubble
dghubble / kubeception.md
Last active July 13, 2024 07:01
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 June 25, 2024 13:44
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

@joetIO
joetIO / isChanClosed.go
Last active January 31, 2022 10:32
Checks if a Go channel is closed without touching/reading it (a very bad idea please do not use :) i was like 16 years old when i wrote this hacking go runtime, it's just a nice hack but def not memory safe lmao)
package main
import (
"fmt"
"unsafe"
"reflect"
)
func isChanClosed(ch interface{}) bool {
@danikin
danikin / tar_test.c
Last active December 18, 2020 07:28
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"
)