Skip to content

Instantly share code, notes, and snippets.

View bsormagec's full-sized avatar
:shipit:
Hello World!

Burak Sormageç bsormagec

:shipit:
Hello World!
  • Laravel, Blockchain, Web3, Solidity, NodeJs
  • Toronto,Canada
  • X @bsormagec
View GitHub Profile
@bsormagec
bsormagec / 0. nginx_setup.sh
Created January 18, 2016 11:01 — forked from mikhailov/0. nginx_setup.sh
Nginx + secure pseudo-streaming
# Nginx can serve FLV/MP4 files by pseudo-streaming way without any specific media-server software.
# To do the custom build we use 2 modules: --with-http_secure_link_module --with-http_flv_module
# This module "secure-link" helps you to protect links from stealing away.
#
# NOTE: see more details at coderwall: http://coderwall.com/p/3hksyg
cd /usr/src
wget http://nginx.org/download/nginx-1.5.13.tar.gz
tar xzvf ./nginx-1.5.13.tar.gz && rm -f ./nginx-1.5.13.tar.gz
@bsormagec
bsormagec / ffmpegScript
Created January 20, 2016 09:19 — forked from josecostamartins/ffmpegScript
# This script converts any format to xvid avi currently xvid avi is the only format my DVD player accepts and the newest versions of movies are being launched in x264 mp4
#!/bin/bash
# This script converts any format to xvid avi
# currently xvid avi is the only format my DVD player accepts
# and the newest versions of movies are being launched in x264 mp4
USAGE="$(basename $0) Input [output]"
#filename=$(basename $pathandfile)
#extension=${filename##*.}
@bsormagec
bsormagec / transcode.php
Created January 20, 2016 09:19 — forked from feuvan/transcode.php
Grab (implicitly assume recent as x264/aac) iask share video and convert it to mp4.
<?php
define('FFMPEG', '/usr/bin/ffmpeg');
define('WGET', '/usr/bin/wget');
set_time_limit(3600); /* we are working with small chunks of files */
ignore_user_abort(true); /* do not terminate script execution if disconnect */
@ini_set("output_buffering", 0);
@ini_set('implicit_flush', 1);
header("Connection: close");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
@bsormagec
bsormagec / mkv_to_264.sh
Created January 20, 2016 09:19 — forked from damsonn/mkv_to_264.sh
convert all the MKVs in the current directory to standard x264
#!/bin/bash
# convert all the .mkv in the current directory to standard x264
for ff in *.mkv;
do
filename=$(basename $ff)
extension=${filename##*.}
filename=${filename%.*}
ffmpeg -i "${ff}" -c:v libx264 -crf 23 -preset medium -map 0 -c:a copy "${filename}.h264.mkv"
done
@bsormagec
bsormagec / tunnel.sh
Created February 28, 2016 13:33 — forked from terrywang/tunnel.sh
SSH Tunnel
#!/bin/bash
# --------------------------------------
#
# Title: SSH Tunnel / Socks5 Proxy Script
# Author: Terry Wang
# Email: i (at) terry (dot) im
# Homepage: http://terry.im
# File: tunnel.sh
# Created: 1 Oct, 2012
#
@bsormagec
bsormagec / ssh-tunnel.sh
Created February 28, 2016 13:33 — forked from rahulsom/ssh-tunnel.sh
SSH Tunneling
#!/bin/bash
#
# SSH Tunnel Manager
#
# SSH Flags:
# f - Force to background.
# N - Execute no commands. Don't open shell.
# q - Run quietly.
# T - Don't allocate pseudo TTY.
# R - Reverse Proxy.
@bsormagec
bsormagec / sshProxy
Created February 28, 2016 13:33 — forked from mmoscosa/sshProxy
Script to open a SSH proxy Tunneling using Socks
#!/bin/bash
if [[ -n $(ps -fe | grep 'ssh -f -D 2001 {username}@{username}.com -p 7822 -N' | grep -v grep | awk '{print $2}') ]]; then
kill $(ps -fe | grep 'ssh -f -D 2001 {username}@{username}.com -p 7822 -N' | grep -v grep | awk '{print $2}')
ssh -f -D 2001 {username}@{username}.com -p 7822 -N
else
ssh -f -D 2001 {username}@{domain}.com -p 7822 -N
fi
@bsormagec
bsormagec / Proxy-README.md
Created February 28, 2016 13:33 — forked from redmoses/Proxy-README.md
SSH tunnelling using dynamic proxy

SSH Proxy Script by Red Moses

http://redmoses.me

This script connects to a SSH server to create a dynamic tunnel proxy. I'm assuming you use a private key for authenticating to the server.

Script configuration

To use this script you must first configure it according to your details. I have supplied some dummy values for the configuration fields to start with.

# SSH user
<?php
define ("SERIAL_DEVICE_NOTSET", 0);
define ("SERIAL_DEVICE_SET", 1);
define ("SERIAL_DEVICE_OPENED", 2);
/**
* Serial port control class
*
* THIS PROGRAM COMES WITH ABSOLUTELY NO WARANTIES !
* USE IT AT YOUR OWN RISKS !
@bsormagec
bsormagec / cleanUrl.php
Created April 9, 2016 14:38 — forked from gravataLonga/cleanUrl.php
Clean URL
<?php
function cleanForShortURL($toClean) {
$charactersToRemove = array(
'Š'=>'S', 'š'=>'s', 'Ð'=>'Dj','Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A',
'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I',
'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U',
'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss','à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a',
'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i',