Skip to content

Instantly share code, notes, and snippets.

holms / gist:8845190
Last active Aug 29, 2015
Scp alternative with Rsync
View gist:8845190
rsync -av --human-readable --progress --inplace --rsh='ssh' .
# 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 / nullify_logs
Created Mar 9, 2014
Nullify all files in current dir
View nullify_logs
for logs in *; do cat /dev/null > $logs; done
holms / wheezy2jessie
Last active Aug 29, 2015
Automated upgrade to debian jessy
View wheezy2jessie
echo " $(hostname)" >> /etc/hosts
echo "deb jessie main
deb-src jessie main
deb jessie/updates main
deb-src jessie/updates main
deb jessie-updates main
deb-src jessie-updates main" > /etc/apt/sources.list
View [720p][RUS(int)]-2-[1080p][RUS(int)].markdown
  • 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:

View shouldbe.conf
; ==================================
; celery worker supervisor example
; ==================================
; 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://", SECRET_KEY="_uy0(ey)#9x1i)xxxx!dp8a3l+z!#2)#@1bzep&ne7r9+", DJANGO_SETTINGS="", RABBITMQ_USER="api", RABBITMQ_PASSWORD="xxx"
View gist:5ef8768f167e639a21c4
1 [program:celery]
2 environment =
3 {% for envvar in celery_env_vars %}
4 {{ envvar['name'] }}="{{ envvar['value'] }}"{% if not loop.last %},{% endif %}
5 {% endfor %}
View pillar-apps-app1.sls
# Manage databases
- foo
- bar
load: True
source: salt://mysql/files/foo.schema
View pillar-nginx-dev.sls
rootdir: /data/installer
holms / gist:3216932
Created Jul 31, 2012
RVM and ruby 1.9 on debian wheezy
View gist:3216932
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
3) Add to /etc/profile and /root/.bashrc this script
holms / nginx_cakephp
Created Nov 20, 2012
Nginx rules for cakephp
View nginx_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) {
if (!-f $request_filename) {
rewrite ^/(.+)$ /index.php?url=$1 last;