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 / genPassword.php
Created April 9, 2016 14:38 — forked from gravataLonga/genPassword.php
Generate a random Password
<?php
function generatePassword ($length = 8) {
$password = "";
$possible = "2346789bcdfghjkmnpqrtvwxyzBCDFGHJKLMNPQRTVWXYZ";
$maxlength = strlen($possible);
// check for length overflow and truncate if necessary
if ($length > $maxlength) {
$length = $maxlength;
@bsormagec
bsormagec / apache.conf
Created April 11, 2016 00:07 — forked from jjulian/apache.conf
Apache rewrite rules to show a maintenance page
# Capistrano-style: if maintenance.html exists, it will be served for any request
# other than style and images. Use status code 503 to tell crawlers to come back later.
ErrorDocument 503 /system/maintenance.html
RewriteEngine On
RewriteCond %{REQUEST_URI} !\.(css|gif|jpg|png)$
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ - [redirect=503,last]
@bsormagec
bsormagec / LoggerApplication.php
Created June 14, 2016 10:51 — forked from nekudo/LoggerApplication.php
Monitoring PHP-CLI scripts with websockets
<?php
namespace WebSocket\Application;
/**
* Websocket-Server demo and test application.
*
* @author Simon Samtleben <web@lemmingzshadow.net>
*/
class LoggerApplication extends Application
@bsormagec
bsormagec / Taiga.io Ubuntu 15.10 DigitalOcean Install
Created October 25, 2016 13:23
Taiga.io Ubuntu 15.10 DigitalOcean Install
#good luck. This works until you get to circus/nginx, and then you get nothing.
#circus is horrible. running an application like this in virtualenv is horrible.
#the whole thing is horrible.
adduser taiga
nano /etc/sudoers
# add "taiga ALL=(ALL) NOPASSWD:ALL" without quotes then save the file.
cd /home/taiga
@bsormagec
bsormagec / 01_Laravel 5 Simple ACL manager_Readme.md
Created November 5, 2016 16:39 — forked from amochohan/01_Laravel 5 Simple ACL manager_Readme.md
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@bsormagec
bsormagec / reverse-string.php
Created November 5, 2016 16:40 — forked from amochohan/reverse-string.php
Recurrsive function to reverse a string
<?php
function reverseString($string){
//Is this method being recurrsively called, i.e. do we still have part of the string being passed to the function to be reversed?
if(strlen($string)>1){
/*
* Return the last letter of the string, and append via calling this method again recursively (passing the remainder of the un-reversed string)
* to continue reversing the remainder of the string
*/
@bsormagec
bsormagec / Dockerfile
Created November 11, 2016 10:16 — forked from ebuildy/Dockerfile
Install Php 7 with MongoDB driver on Docker from Ubuntu trusty base image.
FROM ubuntu:trusty
ENV HOME /root
ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
RUN add-apt-repository ppa:ondrej/php && \
apt-get update
@bsormagec
bsormagec / jetbrains_hub.sh
Last active November 23, 2016 09:20 — forked from artzub/make.sh
Install JetBrains Hub + YouTrack + UpSource + Nginx
#!/bin/bash
apt-get install mc htop git unzip wget curl -y
echo
echo "====================================================="
echo " WELCOME"
echo "====================================================="
echo
echo "Hub"
@bsormagec
bsormagec / gist:e85650a3ad86c0d569eee8a3876a8aed
Created January 9, 2017 16:45 — forked from stokic/gist:0105d38c46250ee16245
Envoyer deployment script for staging env
@servers(['staging' => 'user@server -p 22'])
@setup
$base_dir = '/your/path';
$branch = isset($branch) ? $branch : 'develop';
@endsetup
@task('init')
echo "entering deploy directory" {{ $base_dir }};
cd {{ $base_dir }};
@bsormagec
bsormagec / autossh-mysql-tunnel.service
Created March 23, 2017 08:22
autossh mysql tunnel
[Unit]
Description=AutoSSH tunnel service everythingcli MySQL on local port 33061
After=network.target
[Service]
Environment="AUTOSSH_GATETIME=0"
ExecStart=/usr/bin/autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -NL 33061:localhost:3306 user@host.com -p 2222
[Install]
WantedBy=multi-user.target