Skip to content

Instantly share code, notes, and snippets.

View dmitriynet's full-sized avatar

Dmitriy dmitriynet

  • Nadavi
  • Ukraine, Kiev
View GitHub Profile
lsof -i :9000
tcpdump -nn "port 9000"
watch -n1 'mysql -u "username" -pPASSW --exec="SHOW PROCESSLIST"' // REALTIME PROCESS LIST MYSQL
git merge -X theirs origin/develop
xdebug.profiler_append = 1
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.idekey="PHPSTORM"
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_connect_back=1
xdebug.remote_autostart=1
xdebug.remote_log="/usr/local/apache/logs/xdebug.log"
@dmitriynet
dmitriynet / php
Created November 20, 2015 10:05
mb_unserialize
function mb_unserialize($string)
{
$recovered = preg_replace_callback(
'!(?<=^|;)s:(\d+)(?=:"(.*?)";(?:}|a:|s:|b:|d:|i:|o:|N;))!s',
function($match) {
return 's:' . mb_strlen($match[2], '8bit');
},
$string
);
@dmitriynet
dmitriynet / Dump to database
Last active January 20, 2016 13:37
Dump to database
username=$1
password=$2
dbname=$3
for file in *.sql; do
echo "${file%.sql}.sql started\n";
mysql -u $username -p$username --default-character-set=utf8 $dbname < "${file%.sql}.sql";
echo "${file%.sql}.sql done\n";
done;
@dmitriynet
dmitriynet / dump.sh
Created February 10, 2016 12:20
Dump per tables SH
username=$1
password=$2
dbname=$3
for file in *.sql; do
echo "${file%.sql}.sql started\n";
mysql -u $username -p$password --default-character-set=utf8 $dbname < "${file%.sql}.sql";
echo "${file%.sql}.sql done\n";
done;
@dmitriynet
dmitriynet / grep.sh
Created February 24, 2016 11:43
Grep unique by regex
tail -n 100000 kj.log | grep -o -E "\w+$" | sort -u
// ==UserScript==
// @name BW
// @version 1
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @include http://brokenworlds.online*
// ==/UserScript==
window.addEventListener('load', function() {
$(function(){
@dmitriynet
dmitriynet / gist:1736dfc98bb660261ec6b9b8d6586beb
Last active April 22, 2024 14:34
Price compare E-Katalog/E-Catalog Polska/US/UK/Ukraine integration file structure