Skip to content

Instantly share code, notes, and snippets.

View holms's full-sized avatar

Roman Gorodeckij holms

View GitHub Profile
@holms
holms / gist:8845190
Last active August 29, 2015 13:56
Scp alternative with Rsync
rsync -av --human-readable --progress --inplace --rsh='ssh' user@domain.com:/home/user .
# if you have whitespaces that's only variants which worked for me, with variables and protect-args param
rsync -av --human-readable --progress --inplace --protect-args "$localpath/" --rsh='ssh' home:"$remotepath/"
@holms
holms / nullify_logs
Created March 9, 2014 20:32
Nullify all files in current dir
for logs in *; do cat /dev/null > $logs; done
  • Move 720p files to 720p dir
  • Move 1080p files to 1080p dir

Check which track you need to select:

mkvmerge -i myfile.mkv | grep audio

You'll get something like this:

; ==================================
; celery worker supervisor example
; ==================================
[program:celery]
; Set full path to celery program if using virtualenv
environment =
CELERYD_OPTS="-Q:notifications_w notifications -Q:statistics_w statistics -Q:reports_w reports --concurrency=8",
CELERYD_NODES="notifications_w statistics_w reports_w",
DATABASE_URL="pgsql://xxx:xxx@db.xxx.com/xxx", SECRET_KEY="_uy0(ey)#9x1i)xxxx!dp8a3l+z!#2)#@1bzep&ne7r9+", DJANGO_SETTINGS="xxx.settings.prod", RABBITMQ_USER="api", RABBITMQ_PASSWORD="xxx"
1 [program:celery]
2 environment =
3 {% for envvar in celery_env_vars %}
4 {{ envvar['name'] }}="{{ envvar['value'] }}"{% if not loop.last %},{% endif %}
5 {% endfor %}
6
nginx:
rootdir: /data/installer
server-name: dev.domain.com
mysql:
# Manage databases
database:
- foo
- bar
schema:
foo:
load: True
source: salt://mysql/files/foo.schema
bar:
@holms
holms / gist:3216932
Created July 31, 2012 13:09
RVM and ruby 1.9 on debian wheezy
0) login as root (su or sudo -s)
1) After a Debian fresh install you should install those package:
apt-get install autoconf automake autotools-dev build-essential bison bzip2 curl git libreadline5 libsqlite3-0 sqlite3 libsqlite3-dev libxml2-dev libmysqlclient-dev libreadline5-dev libruby openssl libssl-dev zlib1g zlib1g-dev zlibc vim
2) Install rvm
bash < <(curl -BL https://rvm.beginrescueend.com/install/rvm)
3) Add to /etc/profile and /root/.bashrc this script
@holms
holms / nginx_cakephp
Created November 20, 2012 07:51
Nginx rules for cakephp
# If the file exists as a static file serve it
# directly without running all
# the other rewite tests on it
if (-f $request_filename) {
break;
}
if (!-f $request_filename) {
rewrite ^/(.+)$ /index.php?url=$1 last;
break;
@holms
holms / centos-vimrc
Created November 22, 2012 22:41
Centos vimrc
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set fileencodings=utf-8,latin1
endif
set nocompatible " Use Vim defaults (much better!)
set bs=indent,eol,start " allow backspacing over everything in insert mode
"set ai " always set autoindenting on
"set backup " keep a backup file
set viminfo='20,\"50 " read/write a .viminfo file, don't store more
" than 50 lines of registers