Skip to content

Instantly share code, notes, and snippets.

Mustafa Turan mustafaturan

Block or report user

Report or block mustafaturan

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
mustafaturan / Dockerfile
Last active Sep 4, 2019
Go - Dockerfile - 9.22MB
View Dockerfile
FROM golang:1.13 as build
COPY go.mod go.sum ./
RUN GO111MODULE=on go mod download
COPY . .
RUN CGO_ENABLED=0 go build -v
mustafaturan / stack.go
Last active Jul 7, 2019
Stack Implementation With Go
View stack.go
package stack
type Stack struct {
type node struct {
value string
next *node
mustafaturan /
Created May 17, 2019
List open ports with programs/pids

List open ports

Long version

netstat --tcp --listening --programs --numeric

Short version

netstat -tlpn
mustafaturan /
Created May 17, 2019
Login via private ssh key on Raspberry Pi
mkdir ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/authorized_keys
sh -c 'echo "ssh-rsa ..." >> ~/.ssh/authorized_keys'
chmod 600 ~/.ssh/authorized_keys
mustafaturan /
Last active May 17, 2019
Install docker and run without sudo on Raspberry Pi
# Install docker
curl -sSL | sh
# Create docker user group
sudo groupadd docker
# Add current user to the docker group
sudo gpasswd -a $USER docker

Keybase proof

I hereby claim:

  • I am mustafaturan on github.
  • I am mustafaturan ( on keybase.
  • I have a public key ASDalIfoD1SIl81d7uiK4_TQjNTeQ1BUFwDp91zi7M_gXgo

To claim this, I am signing this object:

mustafaturan / chunk.go
Created Feb 5, 2019
Go / Chunk Slice
View chunk.go
func chunkBy(items []string, chunkSize int) (chunks [][]string) {
for chunkSize < len(items) {
items, chunks = items[chunkSize:], append(chunks, items[0:chunkSize:chunkSize])
return append(chunks, items)
tar -zxvf protobuf-3.7.0rc2.tar.gz
cd protobuf-3.7.0rc2
make install
mustafaturan / json.ex
Last active Aug 6, 2018
Wrapper for the fastest Elixir JSON encode/decode library
View json.ex
defmodule JSON do
@moduledoc false
@encode_opts [:use_nil]
@decode_opts [:return_maps, :use_nil]
alias :jiffy, as: Jiffy
@doc """
Encode and return tuple
You can’t perform that action at this time.