Skip to content

Instantly share code, notes, and snippets.


Mustafa Turan mustafaturan

View GitHub Profile

Untar remote file to local directory

Downloading a tar.gz file and extracting it after the download completes might consume a lot of disk space and time. It is possible to write tar.gz file directly as input to tar command and untar it to directory directly from remote url.

wget -qO- your_link_here | tar -xvz -C /target/directory
mustafaturan /
Last active Jun 27, 2022
Mount SSD with Fstab User Write Permissions
# Create the folder to mount drive 
sudo mkdir /mnt/storage

# Set user/group perms to write
chown -R pi:pi /mnt/storage

# find the driver properties
sudo blkid
mustafaturan /
Last active Jun 12, 2022
Set max open files limit on mac
sudo sysctl -w kern.maxfiles=75000
sudo sysctl -w kern.maxfilesperproc=75000
ulimit -S -n 75000
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 Feb 25, 2020
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: