Using thin with Vlad the Deployer
To get Vlad 1.2.0 to work with Thin I did the following.
First change the line where Vlad is included to this:
1 Vlad.load :scm => :git, :app => :thin
Now run vlad:setup:
1 $ rake vlad:setup 2 (in /Users/christian/Documents/Projects/nyhetsanka.fi) 3 Unable to load Vlad no such file to load -- vlad/thin 4 rake aborted! 5 Please specify the server domain via the :domain variable 6 7 (See full trace by running task with --trace)
The fix for this error:
1 Unable to load Vlad no such file to load -- vlad/thin
Is to run the following command:
1 curl -o /usr/local/lib/ruby/gems/1.8/gems/vlad-1.2.0/lib/vlad/thin.rb http://github.com/dpiddy/vlad/raw/master/lib/vlad/thin.rb
Aktagon vim color scheme
1 " Vim color scheme 2 " 3 " Name: aktagon.vim 4 " Maintainer: Christian Hellsten 5 " Last Change: 17 December 2008 6 " License: public domain 7 " Version: 1.0 8 " 9 " Based on http://www.vim.org/scripts/script.php?script_id=1995 10 " 11 12 set background=dark 13 hi clear 14 if exists("syntax_on") 15 syntax reset 16 endif 17 18 let g:colors_name = "aktagon" 19 20 if has("gui_running") 21 hi link htmlTag xmlTag 22 hi link htmlTagName xmlTagName 23 hi link htmlEndTag xmlEndTag 24 25 highlight Normal guifg=#E6E1DC guibg=#2B2B2B 26 highlight Cursor guifg=#000000 guibg=#FFFFFF 27 "highlight CursorLine guibg=#323300 28 29 highlight Comment guifg=#BC9458 gui=italic 30 highlight Constant guifg=#6D9CBE 31 highlight Define guifg=#CC7833 32 highlight Error guifg=#FFFFFF guibg=#990000 33 highlight Function guifg=#FFC66D gui=NONE 34 highlight Identifier guifg=#6D9CBE gui=NONE 35 highlight Include guifg=#CC7833 gui=NONE 36 highlight Keyword guifg=#CC7833 37 hi LineNr guifg=#888888 ctermfg=lightMagenta 38 39 highlight Number guifg=#A5C261 40 highlight PreProc guifg=#E6E1DC 41 highlight Search guibg=#FFFF00 42 highlight Statement guifg=#CC7833 gui=NONE 43 highlight String guifg=#A5C261 44 highlight Title guifg=#FFFFFF 45 highlight Type guifg=#DA4939 gui=NONE 46 highlight Visual guibg=#5A647E 47 48 highlight DiffAdd guifg=#E6E1DC guibg=#144212 49 highlight DiffDelete guifg=#E6E1DC guibg=#660000 50 51 highlight rubyBlockParameter guifg=#FFFFFF 52 highlight rubyClass guifg=#FFFFFF 53 highlight rubyConstant guifg=#DA4939 54 highlight rubyInstanceVariable guifg=#D0D0FF 55 highlight rubyInterpolation guifg=#519F50 56 highlight rubyLocalVariableOrMethod guifg=#D0D0FF 57 highlight rubyPredefinedConstant guifg=#DA4939 58 highlight rubyPseudoVariable guifg=#FFC66D 59 highlight rubyStringDelimiter guifg=#A5C261 60 61 highlight xmlTag guifg=#E8BF6A 62 highlight xmlTagName guifg=#E8BF6A 63 highlight xmlEndTag guifg=#E8BF6A 64 endif 65 66 67 " Fuzzy Finder popup 68 hi Pmenu guibg=#FFFFFF guifg=#000000 69 hi PMenuSel guibg=#242424 guifg=#FFFFFF gui=bold 70 hi PmenuSbar guibg=#2e3330 guifg=#000000 71 hi PMenuThumb guibg=#a0afa0 guifg=#040404 72
GVim _vimrc file
1 set history=100 2 3 let mapleader = "," 4 set tabstop=2 5 set smarttab 6 set shiftwidth=2 7 set autoindent 8 set expandtab 9 set backspace=start,indent 10 11 12 autocmd FileType make set noexpandtab 13 autocmd FileType python set noexpandtab 14 15 16 set number 17 set hlsearch 18 syntax on 19 20 let g:fuzzy_trim_length = 3000 21 let g:fuzzy_ignore = "*.log" 22 let g:fuzzy_matching_limit = 70 23 24 map ,t :FuzzyFinderTextMate<CR> 25 map ,b :FuzzyFinderBuffer<CR> 26 27 map ,d :execute 'NERDTreeToggle ' . getcwd()<CR> 28 29 set guifont=Bitstream\ Vera\ Sans\ Mono:h9 30 31 au GUIEnter * simalt ~x 32 33 colorscheme railscasts 34 " set guifont=consolas:h8 35
How to optimize your MephistoBlog powered site's search engine ranking (SEO for MephistoBlog)
At Aktagon we use MephistoBlog as CMS , and I couldn’t find any information on how to SEO optimize MephistoBlog on Google, so I’m sharing my notes here.
This tip shows you how to make your pages more search engine friendly.
First, add the title tag, plus the meta description and keywords tags to your layout’s Liquid template , as shown here:
1 <meta name="description" content="{% if article %} {{ article.excerpt }} {% else %} YOUR DEFAULT SITE DESCRIPTION {% endif %}" /> 2 <meta name="keywords" content="{% if article %} {% for tag in article.tags %}{{ tag }}, {% endfor %} {% endif %} YOUR DEFAULT KEYWORDS" /> 3 <title>{% if article %} {{ article.title }} » {{ site.title }} {% else %} {{ site.title }} » {{ site.subtitle }} {% endif %}</title>
Remember to update the default description and keywords in the meta tags’ body.
Now, whenever you publish an article, simply add an excerpt and some tags to it. The excerpt is used as the meta description and the article’s tags as the meta keywords, both make Google a bit happier, but the description is by far the more important.
"updating paths is incompatible with switching branches/forcing" error when using git branches with Vlad
I ended up writing this snippet after I found out that deploying a git branch with vlad wasn’t as easy as it should’ve been…
I assumed the Vlad documentation was right, so I put the branch name in the revision variable (located in config/deploy.rb):
1 set :revision, 'branch_name'
But then I got this error when executing rake vlad:deploy:
1 git checkout: updating paths is incompatible with switching branches/forcing 2 Did you intend to checkout 'branch_name' which can not be resolved as commit?
I managed to solve the problem by using the SHA1 hash of the branch instead of the branch name, but that only worked for the current revision:
1 set :revision, 'd34360870be6536992e6d45bb0aa72eca31e14443'
So after some googling I found this post at scie.nti.st, which made my day because it has the following examples of how to deploy tags and branches with git and Vlad:
1 # Deploy the latest code, this the default 2 set :revision, "HEAD" 3 4 # Deploy branch "origin/branch_name" 5 set :revision, "origin/branch_name" 6 7 # Deploy tag "1.0" 8 set :revision, "1.0"
Note that you have to push the branch to the remote server before running rake vlad:deploy:
1 git push origin branch_name