Skip to content

Instantly share code, notes, and snippets.

@holms
holms / gist:8845190
Last active Aug 29, 2015
Scp alternative with Rsync
View gist:8845190
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 Mar 9, 2014
Nullify all files in current dir
View nullify_logs
for logs in *; do cat /dev/null > $logs; done
@holms
holms / wheezy2jessie
Last active Aug 29, 2015
Automated upgrade to debian jessy
View wheezy2jessie
#!/bin/bash
echo "127.0.0.1 $(hostname)" >> /etc/hosts
echo "deb http://ftp.nl.debian.org/debian/ jessie main
deb-src http://ftp.nl.debian.org/debian/ jessie main
deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main
deb http://ftp.nl.debian.org/debian/ jessie-updates main
deb-src http://ftp.nl.debian.org/debian/ 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
; ==================================
[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"
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 %}
6
View pillar-apps-app1.sls
mysql:
# Manage databases
database:
- foo
- bar
schema:
foo:
load: True
source: salt://mysql/files/foo.schema
bar:
View pillar-nginx-dev.sls
nginx:
rootdir: /data/installer
server-name: dev.domain.com
@holms
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 https://rvm.beginrescueend.com/install/rvm)
3) Add to /etc/profile and /root/.bashrc this script
@holms
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) {
break;
}
if (!-f $request_filename) {
rewrite ^/(.+)$ /index.php?url=$1 last;
break;