Skip to content

Instantly share code, notes, and snippets.

View mustafaturan's full-sized avatar

Mustafa Turan mustafaturan

View GitHub Profile
; Start a new pool named 'www'.
[www]
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses on a
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
@mustafaturan
mustafaturan / ruby.2.6.3-setup.sh
Last active February 2, 2023 10:08
ruby 2.6.3 setup for centos 6.x
#!/usr/bin/env bash
# repository
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
# system update
yum -y update
yum -y groupinstall "Development Tools"
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick
@mustafaturan
mustafaturan / latest-ffmpeg-centos6.sh
Last active October 25, 2022 20:14
Installs latest ffmpeg on Centos 6
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
@mustafaturan
mustafaturan / ssh-key-login-on-pie.md
Created May 17, 2019 03:24
Login via private ssh key on Raspberry Pi
cd
mkdir ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/authorized_keys
sh -c 'echo "ssh-rsa ... sample@example.com" >> ~/.ssh/authorized_keys'
chmod 600 ~/.ssh/authorized_keys
@mustafaturan
mustafaturan / untar-remote-tgz-file.md
Created June 28, 2022 23:18
Untar remote file to local

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
mustafaturan / mount-ssd.md
Last active June 27, 2022 20:09
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
mustafaturan / update-limit.sh
Last active June 12, 2022 08:03
Set max open files limit on mac
sudo sysctl -w kern.maxfiles=75000
sudo sysctl -w kern.maxfilesperproc=75000
ulimit -S -n 75000
@mustafaturan
mustafaturan / linked_list_stack_impl.rb
Last active June 8, 2021 21:07
Ruby Stack Implementation With Linked List
# Mustafa Turan
# coded at 30.11.2015 with NO LICENSE
# Feel free to use/modify/distribute/reimplement
# node.rb
class Node
attr_accessor :node_ref
attr_reader :val
def initialize(node_ref, val)
@mustafaturan
mustafaturan / s3-nginx-log-rotate.sh
Created June 6, 2012 13:35
S3 Nginx Log rotation file
#!/bin/bash
BUCKETNAME="your_s3_bucket"
LOGDIR="/opt/nginx/logs"
LOGDATE=$(date +"%Y%m%d")
LOGFILES=( "access" "ssl-access" )
BOT_LOGFILES=( "bots-access" "bots-ssl-access" )
echo "Moving access logs to dated logs.."
@mustafaturan
mustafaturan / setup-protobuf-mac.sh
Created February 2, 2019 05:48
Install protobuf on Mac
#!/bin/bash
wget https://github.com/protocolbuffers/protobuf/archive/v3.7.0rc2.tar.gz
tar -zxvf protobuf-3.7.0rc2.tar.gz
cd protobuf-3.7.0rc2
./autogen.sh
./configure
make
make install