Skip to content

Instantly share code, notes, and snippets.

View mche's full-sized avatar
🎄
Focusing

Михаил Че (Mikhail Che) mche

🎄
Focusing
  • есть
  • North Korea
  • 06:47 (UTC +05:00)
View GitHub Profile
@mche
mche / fancy_tail.pl
Created October 5, 2016 10:41 — forked from brianmed/fancy_tail.pl
Mojolicious::Lite app that can tail a file
use Mojolicious::Lite;
use Mojo::Util qw(secure_compare);
use Mojo::JSON qw(encode_json);
use Mojo::IOLoop::Tail;
# Authentication
under(sub {
my $c = shift;
@mche
mche / gentoo genymotion
Last active October 21, 2016 08:07
запускал эмулятор андроида genymotion
1. VirtualBox установил через emerge
2. текущая версия genimotion 2.8.0 не пошла, ругался
genymotion: symbol lookup error: /usr/lib64/libX11.so.6: undefined symbol: xcb_wait_for_reply64
3. стал ставить версию 2.6.0. Где-то удалость найти genymotion-2.6.0-linux_x64.bin
4. При запуске ругался на библиотеки. Оказалось нужна более ранняя версия:
emerge -v =media-libs/gstreamer-0.10.36-r2
@mche
mche / category-list-tree.js
Created November 20, 2016 18:15
angular component для дерева списки
.controller('parentControll', function () {
this.categoryData = {"selectedIdx": [], "finalCategory": {}};
})
/*----------------------------*/
.component('categoryList', {
template:
'<ons-list>'+
'<div ng-repeat="item in $ctrl.data | filter : $ctrl.filterSelected">'+
'<ons-list-header>Заголовок {{ item.title }}</ons-list-header>'+
'<ons-list-item tappable ng-click="$ctrl.toggleSelect(item)">{{ item.childs | json }} (уровень={{$ctrl.level}}) {{ $ctrl.selectedIdx | json }}</ons-list-item>'+
mkdir -p /etc/portage/patches/x11-drivers/nvidia-drivers-304.132 && cd $_
wget http://pastebin.calculate-linux.ru/ru/raw/13365 -O nv-linux.h.patch
emerge -av =x11-drivers/nvidia-drivers-304.132
use Mojolicious::Lite;
=pod
Usage:
perl script/redirect.pl daemon --listen http://*:80
Or uncomment listen option below and
package PubSub;
use Mojo::Base 'Mojo::EventEmitter';
use JSON::PP;
my $jsoner = JSON::PP->new->utf8(0);
has [qw(pubsub)];
has ws => sub { [] };
has chans => sub { {} };
@mche
mche / 1.txt
Last active June 13, 2017 05:24
Бакапы на гитхабе
cd ~/проектХ
# ветку бакапов
git branch backup
# crontab -e
NDAY=`date '+%u'`
WDAY=`date '+%A'`
57 3 * * * cd ~/проектХ; git checkout backup; pg_dump -U postgres --schema=public test | gpg -q --batch --yes -e -r my@email.ru --trust-model always -z 9 > public.$NDAY.pg.dump.gpg; git add public.$NDAY.pg.dump.gpg; git commit -m "$WDAY"; git checkout master; git push origin backup
@mche
mche / .SciTEUser.properties
Last active September 1, 2017 08:53
SciTE в меню Options > Open User Options File
# Global initialisation file for SciTE
# For Linux, place in $prefix/share/scite
# For Windows, place in same directory as SciTE.EXE (or Sc1.EXE)
# Documentation at http://www.scintilla.org/SciTEDoc.html
# Globals
# Window sizes and visibility
if PLAT_WIN
position.left=0
@mche
mche / uniost-postgresql.service
Last active October 30, 2017 06:16
Debian systemd init postgresql
# /etc/systemd/system/uniost-postgresql.service
[Unit]
Description=PostgreSQL uniost user
After=network.target
[Service]
Type=forking
PIDFile=/home/uniost/postgresql/data/postmaster.pid
WorkingDirectory=/home/uniost/postgresql/data
User=uniost
@mche
mche / mojo-hypnotoad.service
Last active November 13, 2017 12:01
systemd for hypnotoad perl Mojolicious
[Unit]
Description=Mojolicious hypnotoad
After=postgresql.service
[Service]
Type=forking
PIDFile=/home/guest/hypnotoad.pid
WorkingDirectory=/home/guest
#User=
#Group=