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 / transfer_mysql.sh
Created September 11, 2017 12:37
transfer mysql
#!/usr/bin/env bash
# transfer mysql database to different server with a new name
# such as production database to test database
read -p "source host:" SRC_HOST
read -p "user for host $SRC_HOST:" SRC_USER
read -p "password for $SRC_USER@$SRC_HOST:" -s SRC_PW; echo
read -p "source database name:" SRC_DB
read -p "target host:" TGT_HOST
@bsormagec
bsormagec / usbreset.c
Created August 23, 2017 07:54 — forked from x2q/usbreset.c
/* usbreset -- send a USB port reset to a USB device
*
* Compile using: gcc -o usbreset usbreset.c
*
*
* */
@bsormagec
bsormagec / mysql-docker.sh
Created July 1, 2017 06:10
Mysql Docker Backup and Restore
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@bsormagec
bsormagec / wp-permissions-script
Created June 16, 2017 12:26 — forked from macbleser/wp-permissions-script
WordPress Permissions Configuration Script
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro
#
WP_OWNER=changeme # <-- wordpress owner
WP_GROUP=changeme # <-- wordpress group
WP_ROOT=/home/changeme # <-- wordpress root directory
@bsormagec
bsormagec / guide.md
Created June 6, 2017 13:13 — forked from jayktaylor/guide.md
Instructions for installing Python 3.5 using pyenv on Debian Jessie

Installing Python 3.5 on Debian Jessie with pyenv

Debian Jessie does not come with the correct Python version out of the box, and instead comes with Python 2. To be able to install Python 3(.5), we have a few options. We could build and install from source, but as per Debian's website, we shouldn't do this. Instead, we will use pyenv, a tool that allows users to switch Python versions easily without breaking their system.

Installing pyenv

To install pyenv, we will use the official installer.

curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
@bsormagec
bsormagec / mysqlgzip.md
Created April 17, 2017 16:42
Mysql gzip backup and restore

mysqldump gzip

dump

mysqldump -u user -p password dbname | gzip > dbname.dump.gz 

load

@bsormagec
bsormagec / gist:3b6118fa4960f3edd719579abde17308
Created March 26, 2017 17:55 — forked from saltun/gist:439794ab032b7a894d91
PHP TC Kimlik Numarası Doğrulama
<meta charset="utf-8">
<?php
function tcno_dogrula($bilgiler){
$gonder = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<TCKimlikNoDogrula xmlns="http://tckimlik.nvi.gov.tr/WS">
<TCKimlikNo>'.$bilgiler["tcno"].'</TCKimlikNo>
<Ad>'.$bilgiler["isim"].'</Ad>
@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
@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 / 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"