Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# http://blog.popstas.ru/blog/2015/11/16/show-all-terminal-windows-in-ubuntu/
# Activate all windows with process name of currently active window
# Получить текущее активное окно, его pid, имя процесса
current_pid=$(xdotool getwindowpid $(xdotool getactivewindow))
current_name=$(ps -p $current_pid -o comm=)
clean_name=${current_name%-}
name=${1:-$clean_name}
@popstas
popstas / heidisql.md
Last active December 20, 2015 22:00
HeidiSQL

Оф. сайт - http://www.heidisql.com/

#Добавление сервера Делается через ssh туннель По вкладкам:

Настройки:

  • Тип сети: MySQL (SSH tunnel)
  • Имя хоста: localhost
  • Пользователь: юзер_mysql
dirty-git ~/projects/
ansible/bak_ansible-server (master)
30 modified, 3 deleted, 35 untracked
ansible/ansible-server_2 (master)
10 modified, 9 untracked
ansible/backup_ansible-aws (master)
48 modified, 56 untracked
@popstas
popstas / drupal_digest.md
Last active February 21, 2016 22:29
Drupal Digest from Habrahabr, best for novices
@popstas
popstas / average.sh
Created February 28, 2016 22:53
Measure average script time execution
#!/bin/bash
set -eu
if [ "$#" != 1 ] && [ "$#" != 2 ]; then
echo "Usage:
# run 'command' with 5 cycles
average 'command'
# run 'command' with 3 cycles
'use strict';
var argv = require('yargs').argv;
var autoprefixer = require('autoprefixer');
var cleanCSS = require('gulp-clean-css');
var concat = require('gulp-concat');
var debug = require('gulp-debug');
var duration = require('gulp-duration');
var gulp = require('gulp');
var gulpif = require('gulp-if');
@popstas
popstas / phpstorm-eap-update.sh
Last active March 12, 2017 22:14
Updates PhpStorm EAP on Mac OS (don't work from PhpStorm 2016.1.1) - http://blog.popstas.ru/blog/2016/01/17/automacic-update-phpstorm-eap-on-mac-os/
#!/bin/bash
# blog post (rus) - http://blog.popstas.ru/blog/2016/01/17/automacic-update-phpstorm-eap-on-mac-os/
# usage: just run it!
set -euo pipefail
get_phpstorm_url() {
download_page="https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program"
url=$(curl -s "$download_page" | grep -oE "http:\/\/[a-zA-Z0-9\.\/-]+\.dmg")
echo "$url"
---
- hosts: localhost
remote_user: popstas
roles:
- { name: viasite-ansible.zsh, zsh_user: popstas }
popstas@popstas-home:~/projects/_temp% sysbench --test=fileio prepare && sysbench --test=fileio --file-test-mode=rndrw run && sysbench --test=fileio cleanup

WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
sysbench 1.0.7 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time