start new:
tmux
start new with session name:
tmux new -s myname
# 1) Create your private key | |
$ cd ~/.ssh | |
$ openssl genrsa -des3 -passout pass:x -out lvh.me.pass.key 2048 | |
# 2) Generate RSA key | |
$ openssl rsa -passin pass:x -in lvh.me.pass.key -out lvh.me.key | |
# 3) Get rid of private key | |
$ rm lvh.me.pass.key |
### Nginx ### | |
check process nginx with pidfile /opt/nginx/logs/nginx.pid | |
start program = "/etc/init.d/nginx start" | |
stop program = "/etc/init.d/nginx stop" | |
if cpu > 60% for 2 cycles then alert | |
if cpu > 80% for 5 cycles then restart | |
if memory usage > 80% for 5 cycles then restart | |
if failed host 127.0.0.1 port 80 protocol http then restart | |
if 3 restarts within 5 cycles then timeout | |
Trix.config.lang = | |
bold: "Жирный" | |
bullets: "Маркерованный список" | |
byte: "Байт" | |
bytes: "Байты" | |
captionPlaceholder: "Введите описание здесь…" | |
captionPrompt: "Добавить описание…" | |
code: "Код" | |
heading1: "Заголовок" | |
indent: "Увеличить уровень" |
module BootstrapPaginationHelper | |
class LinkRenderer < WillPaginate::ActionView::LinkRenderer | |
protected | |
def page_number(page) | |
if page == current_page | |
link(page, "#", :class => 'active') | |
else | |
link(page, page, :rel => rel_value(page)) | |
end |
#!/usr/bin/env ruby | |
ADDED_OR_MODIFIED = /^\s*(A|AM|M)/.freeze | |
changed_files = `git status --porcelain`.split(/\n/) | |
unstaged_files = `git ls-files -m`.split(/\n/) | |
changed_files = changed_files.select { |f| f =~ ADDED_OR_MODIFIED } | |
changed_files = changed_files.map { |f| f.split(" ")[1] } |