Skip to content

Instantly share code, notes, and snippets.

View arcusfelis's full-sized avatar

Michael Uvarov arcusfelis

View GitHub Profile
@arcusfelis
arcusfelis / gist:2281120
Created April 2, 2012 06:00
Полезняшки
<habracut />
Перекодировка всех файлов *.srt в папке из cp1251 в utf-8
<code>find *.srt | while read i; do iconv -c -f cp1251 -t utf-8 "$i" > "/tmp/$i"; mv "/tmp/$i" .; done</code>
В папке в названиях всех файлов заменить пробелы на знак подчеркивания
<code>for i in *; do
mv "$i" "`echo $i | sed 's//_/'`"
done </code>
Ужмёт до 400 точек по ширине и пропорционально уменьшит высоту. Можно использовать x400 для фиксированной высоты и расчётной ширины.
@arcusfelis
arcusfelis / gist:2420120
Created April 19, 2012 10:20
xapian git log
commit 7b8e6f413811c22a5291de74b478410f9d877706
Author: Uvarov Michael <freeakk@gmail.com>
Date: Fri Apr 13 10:27:01 2012 +0400
Fix warnings.
commit ca872e0c77d406fd63a6f516f2bf71d2a4491e7a
Author: Uvarov Michael <freeakk@gmail.com>
Date: Fri Apr 13 10:16:39 2012 +0400
@arcusfelis
arcusfelis / gist:2843486
Created May 31, 2012 13:39
Eunit runs twice
DEBUG: Rebar location: "/usr/local/bin/rebar"
DEBUG: Entering /home/user/erlang/eunit_twice
DEBUG: Available deps: []
DEBUG: Missing deps : []
DEBUG: Predirs: []
==> eunit_twice (eunit)
DEBUG: Matched required ERTS version: 5.9 -> .*
DEBUG: Matched required OTP release: R15B -> .*
INFO: sh info:
cwd: "/home/user/erlang/eunit_twice"
DEBUG: Rebar location: "/home/user/erlang/i18n/rebar"
DEBUG: Consult config file "/home/user/erlang/i18n/rebar.config"
DEBUG: is_app_available, looking for App triq with Path "/home/user/erlang/i18n/deps/triq"
DEBUG: vcs_vsn: Unknown VCS atom in vsn field: "0.1.0"
INFO: Looking for triq-.* ; found triq-0.1.0 at /home/user/erlang/i18n/deps/triq
DEBUG: is_app_available, looking for App rebar_i18n_plugin with Path "/home/user/erlang/i18n/deps/rebar_i18n_plugin"
DEBUG: vcs_vsn: Unknown VCS atom in vsn field: "1"
INFO: Looking for rebar_i18n_plugin-.* ; found rebar_i18n_plugin-1 at /home/user/erlang/i18n/deps/rebar_i18n_plugin
DEBUG: is_app_available, looking for App edown with Path "/home/user/erlang/i18n/deps/edown"
DEBUG: vcs_vsn: Primary vcs used for /home/user/erlang/i18n/deps/edown
@arcusfelis
arcusfelis / gist:2935785
Created June 15, 2012 10:36
rebar.config
%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
%% == Port compiler ==
{port_env, [
{"CFLAGS", "$ICU_CFLAGS $CFLAGS $ICU_INC_PATH"},
{"CXXFLAGS", "$ICU_CXXFLAGS $CXXFLAGS $ICU_INC_PATH"},
{"LDFLAGS", "$ICU_LDFLAGS $LDFLAGS"}
]}.
@arcusfelis
arcusfelis / rebar-i18n-old.log
Created June 15, 2012 18:05
rebar-i18n-old.log
[22:00:58] user@delta i18n :) ./rebar --version
rebar version: 2 date: 20110930_055606 vcs: git f51e3df
[22:01:02] user@delta i18n :) ./rebar clean skip_deps=true
==> i18n (clean)
[22:01:06] user@delta i18n :) cat rebar.config
%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
@arcusfelis
arcusfelis / rebar-i18n-ta-targetvar.log
Created June 15, 2012 18:31
rebar-i18n-ta-targetvar.log
DEBUG: Rebar location: "/home/user/erlang/i18n/rebar"
DEBUG: Consult config file "/home/user/erlang/i18n/rebar.config"
DEBUG: is_app_available, looking for App triq with Path "/home/user/erlang/i18n/deps/triq"
DEBUG: vcs_vsn: Unknown VCS atom in vsn field: "0.1.0"
INFO: Looking for triq-.* ; found triq-0.1.0 at /home/user/erlang/i18n/deps/triq
DEBUG: is_app_available, looking for App rebar_i18n_plugin with Path "/home/user/erlang/i18n/deps/rebar_i18n_plugin"
DEBUG: vcs_vsn: Unknown VCS atom in vsn field: "1"
INFO: Looking for rebar_i18n_plugin-.* ; found rebar_i18n_plugin-1 at /home/user/erlang/i18n/deps/rebar_i18n_plugin
DEBUG: is_app_available, looking for App edown with Path "/home/user/erlang/i18n/deps/edown"
DEBUG: vcs_vsn: Primary vcs used for /home/user/erlang/i18n/deps/edown
@arcusfelis
arcusfelis / gist:3096561
Created July 12, 2012 08:02
Erlang and wxwidgets deps on Debian
aptitude install libwxgtk2.8-dev libgl1-mesa-dev libglu1-mesa-dev libpng3
apt-get build-dep erlang
@arcusfelis
arcusfelis / bjoin.erl
Created July 12, 2012 08:58
bjoin.erl
bjoin([H|T], Delim) ->
BinT = << <<Delim/binary, X/binary>> || X <- T>>,
<<H/binary, BinT/binary>>.
bjoin([], _Delim) ->
<<>>.
@arcusfelis
arcusfelis / gist:3103416
Created July 13, 2012 07:38
Monitor messages of the gen_event on console
sys:trace(ccd3_event, true).