Skip to content

Instantly share code, notes, and snippets.

View tairov's full-sized avatar

Aydyn Tairov tairov

  • London, UK
View GitHub Profile
USE mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH 'auth_socket';
UPDATE user SET password_expired='N', account_locked='N' WHERE user='root';
FLUSH PRIVILEGES;
SHUTDOWN
function doWork() {console.log('work')}
module.exports = {
init: function(data){},
test: doWork
}
@tairov
tairov / table_generation.sql
Created April 19, 2016 11:02
mysql, table generation
CREATE TABLE filler (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT
) ENGINE=Memory;
CREATE TABLE t_left (
id INT NOT NULL PRIMARY KEY,
value INT NOT NULL,
stuffing VARCHAR(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
@tairov
tairov / update-eap.sh
Created March 6, 2016 18:08 — forked from maximal/update-eap.sh
Обновление тестовых версий (EAP) сред разработки компании JetBrains для Linux
#!/bin/bash
##
# Обновление тестовых версий (EAP) сред разработки компании JetBrains для Linux.
# В данном случае скачивается PhpStorm, но скрипт подойдёт для любой среды разработки,
# выкладываемой компанией JetBrains в EAP.
#
#
# @author MaximAL
# @since 2015-08-27 Поменял паттерн `fileRegex` под текущие реалии.
# @since 2015-04-10 Первая версия
@tairov
tairov / gist:97634b6395676854acc9
Created March 4, 2016 14:38
mysql / counter in update
set @pos := 0;
update coins set list_order = (select @pos := @pos + 1 as pos)
@tairov
tairov / phpstorm
Created March 3, 2016 11:12
phpstorm jdk location in common .WebIdeXXX path
~/.WebIde110/phpstorm64.vmoptions
-javaagent:/home/USER/javalinuxfix/LinuxJavaFixes-1.0.0-SNAPSHOT.jar
~/.WebIde110/config/phpstorm.jdk:
/home/USER/oracle-jre-1.8.0_51/
@tairov
tairov / perlgrep
Last active August 29, 2015 14:26
perl pe
echo '00.00.00.00 - - [06/Aug/2015:08:31:21 +0300] "POST /0.6.5/api/soap/service_client?ping HTTP/1.1" 200 542 "host.com/url" "-" 0.084 0.051 rid30068286'
| perl -pe 's|((\d+\.?){4,4}).*?POST\s+\/(.+?)\/.+?\s"(.+?)\/.*$|$1\t$3\t$4|g'
@tairov
tairov / run_all.sh
Last active August 29, 2015 14:22
shell, run daemons, run all, start all daemons
#!/bin/sh
# need set actual path
ROOT_PATH=shell/daemons
# Don't edit
$ROOT_PATH/run.sh "service.php" 1 production 2>&1 >> /var/log/php5/task.log
$ROOT_PATH/run.sh "service.php" 10 production 2>&1 >> /var/log/php5/task.log
$ROOT_PATH/run.sh "service.php" 1 production 2>&1 >> /var/log/php5/prod_rmq_task.log
xwininfo -name "Guake!" -int -tree
xwininfo: Window id: 60817461 "Guake!"
Root window id: 143 (the root window) (has no name)
Parent window id: 143 (the root window) (has no name)
1 child:
60817462 (has no name): () 1x1+-1+-1 +64+23
2) Use xdotool to reparent the Guake window
#!/usr/bin/python3
import os
import requests
import sys
import itertools
import time
# Edit these four variables according to your needs:
x_user = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"