Skip to content

Instantly share code, notes, and snippets.

@vdv
vdv / mountain-lion-brew-setup.markdown
Created August 6, 2012 05:57 — forked from myobie/mountain-lion-brew-setup.markdown
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@vdv
vdv / mount yandex.disk
Created July 5, 2012 08:51
mount yandex.disk in linux
echo "https://webdav.yandex.ru /mnt/yandex.disk davfs rw,users,noauto 0 0" >> /etc/fstab
echo "https://webdav.yandex.ru:443 логин_в_яндексе пароль_в_яндексе" >> /etc/davfs2/secrets
http://blogger.omg-linux.ru/2012/04/davfs2-ubuntu.html
@vdv
vdv / .bashrc
Created June 21, 2012 12:51 — forked from henrik/.bashrc
Git branch and dirty state in Bash prompt.
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
git config --global user.name "name"
git config --global user.email "email"
#---------------------- aliases --------------------
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.di diff
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.lol log --pretty=oneline --abbrev-commit --graph --decorate
# Prompt to make really sure we want to deploy into prouction
puts "\n\e[0;31m ######################################################################"
puts " #\n # Are you REALLY sure you want to deploy to production?"
puts " #\n # Enter y/N + enter to continue\n #"
puts " ######################################################################\e[0m\n"
proceed = STDIN.gets[0..0] rescue nil
exit unless proceed == 'y' || proceed == 'Y'
@vdv
vdv / nginx_site.conf
Last active October 2, 2015 20:18
nginx config with unicorn
upstream rails_app_upstream {
server unix:/home/deployer/projects/rails_app/shared/tmp/sockets/unicorn.socket fail_timeout=0;
}
server {
#listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default ipv6only=on; ## listen for ipv6
server_name localhost my_server.ru;
root /home/deployer/projects/rails_app/current/public;
@vdv
vdv / rsyncd.conf
Created April 5, 2012 18:40
rsync server config
[name1]
comment = Backup for Name1.net
path = /backup/name1
use chroot = true
uid = backup
gid = backup
log file = /var/log/rsyncd/name1.log
read only = false
write only = false
hosts allow = 11.11.11.11
@vdv
vdv / backup.sh
Created April 5, 2012 18:38
backup db and files to rsync server
#!/bin/bash
DIR=/home/www/backup
HOSTNAME=localhost
DBNAME=db_name
DBPASS=pass
DBUSER=user
DATE=`date +%Y%m%d-%H%M%S`
@vdv
vdv / 0-readme.md
Created March 26, 2012 17:00 — forked from burke/0-readme.md
ruby-1.9.3-p125 cumulative performance patch.

Patched ruby 1.9.3-p125 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p125 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

@vdv
vdv / cap_notify.rb
Created March 26, 2012 08:26 — forked from johnthethird/cap_notify.rb
Capistrano deployment email notifier for Rails 3
=begin
Capistrano deployment email notifier for Rails 3
Do you need to send email notifications after application deployments?
Christopher Sexton developed a Simple Capistrano email notifier for rails. You can find details at http://www.codeography.com/2010/03/24/simple-capistrano-email-notifier-for-rails.html.
Here is Rails 3 port of the notifier.
The notifier sends an email after application deployment has been completed.