<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: configuration code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 24 Jul 2008 18:43:13 GMT</pubDate>
    <description>DZone Snippets: configuration code</description>
    <item>
      <title>INI - Desktop Entry File</title>
      <link>http://snippets.dzone.com/posts/show/5691</link>
      <description>&lt;code&gt;&lt;br /&gt;#!/usr/bin/env tt&lt;br /&gt;# Author::    Daniel Brumbaugh Keeney (http://rubyforge.org/users/db-keen)&lt;br /&gt;# Copyright:: 2008 Daniel Brumbaugh Keeney&lt;br /&gt;# License::   Public Domain&lt;br /&gt;#&lt;br /&gt;# This program is distributed in the hope that it will be useful,&lt;br /&gt;# but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&lt;br /&gt;&lt;br /&gt;class DesktopEntry&lt;br /&gt;&lt;br /&gt;# strictly http://standards.freedesktop.org/desktop-entry-spec/latest&lt;br /&gt;# must be UTF-8&lt;br /&gt;# Multiple keys in the same group may not have the same name. Keys in different groups may have the same name.&lt;br /&gt;# escape sequences \s, \n, \t, \r, and \\ are supported for values of type string and localestring&lt;br /&gt;grammar DesktopEntryFile&lt;br /&gt;&lt;br /&gt;  # must start with line beginning&lt;br /&gt;  rule comment&lt;br /&gt;    '#' contents:( (!"\n")* ) "\n"&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  rule group_header&lt;br /&gt;    '[' groupname:( ( !('[' / ']') )+ ) "]\n"&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  rule single_value_entry&lt;br /&gt;    key:key space? '=' space? value:value "\n"&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  rule multiple_value_entry&lt;br /&gt;    key:key ';' space? '=' space?&lt;br /&gt;    first_value:value&lt;br /&gt;    additional_values( ';' value:value )* "\n"&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  rule key&lt;br /&gt;    [A-Za-z0-9]+ ( '[' lang ( '_' country)? ( '.' encoding)? ( '@' modifier )? ']' )?&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  rule file&lt;br /&gt;    comment*&lt;br /&gt;    "[Desktop Entry]\n"&lt;br /&gt;    ( entry / group_header )*&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  rule string&lt;br /&gt;    [\u0020-\u007E]+&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  rule localestring&lt;br /&gt;    .+&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  rule boolean&lt;br /&gt;    'true' / 'false'&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  # must be a valid floating point number as recognized by the %f specifier for scanf in the C locale&lt;br /&gt;  rule numeric&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 26 Jun 2008 04:50:44 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5691</guid>
      <author>db-keen (db)</author>
    </item>
    <item>
      <title>Using an  Apache proxy RewriteRule</title>
      <link>http://snippets.dzone.com/posts/show/5548</link>
      <description>This Apache Rewrite instruction uses the url http://mywebsite.com/cards as a proxy to access another web server within the LAN.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;        RewriteEngine on&lt;br /&gt;        RewriteRule ^cards$ http://192.168.1.15/ [P]&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Tue, 27 May 2008 20:54:43 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5548</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Configuring Asterisk as a Jabber client</title>
      <link>http://snippets.dzone.com/posts/show/5515</link>
      <description>Here's my working instructions to connect my Asterisk box as a client to my Jabber server. When a call comes in on extension 10 a message is sent to me.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;file: jabber.conf&lt;br /&gt;&lt;code&gt;&lt;br /&gt;[general]&lt;br /&gt;debug=yes                               ;;Turn on debugging by default.&lt;br /&gt;autoprune=no                            ;;Auto remove users from buddy list.&lt;br /&gt;autoregister=yes                        ;;Auto register users from buddy list. &lt;br /&gt;&lt;br /&gt;[asterisk]                              ;;label&lt;br /&gt;type=client                             ;;Client or Component connection&lt;br /&gt;serverhost=jamesrobertson.eu&lt;br /&gt;                                        ;;      talk.google.com&lt;br /&gt;username=asterisk@jamesrobertson.eu/Home        ;;Username with optional roster.&lt;br /&gt;&lt;br /&gt;secret=XXXXXXXX                         ;;Password&lt;br /&gt;port=5222                               ;;Port to use defaults to 5222&lt;br /&gt;usetls=no                               ;;Use tls or not&lt;br /&gt;;usesasl=yes                            ;;Use sasl or not&lt;br /&gt;buddy=james@jamesrobertson.eu&lt;br /&gt;statusmessage="I am available"          ;;Have custom status message for&lt;br /&gt;                                        ;;Asterisk.&lt;br /&gt;timeout=100                             ;;Timeout on the message stack.&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;file: extensions.conf&lt;br /&gt;&lt;code&gt;&lt;br /&gt;exten =&gt; 10,1,JABBERSend(asterisk,james@jamesrobertson.eu, Call from ${CALLERID(name)} at number &lt;${CALLERID(num)}&gt; on ${STRFTIME(,GMT-1,%A %B %d %G at %l:%M:%S %p)} )&lt;br /&gt;exten =&gt; 10,n,Macro(stdexten,100,100)&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;output (observed in my chat window from user Asterisk)&lt;br /&gt;Call from Line 1 - Home at number &lt;6200&gt; on Sunday May 18 2008 at 8:53:24 PM </description>
      <pubDate>Sun, 18 May 2008 21:37:06 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5515</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>nginx gzip config</title>
      <link>http://snippets.dzone.com/posts/show/5385</link>
      <description>&lt;code&gt;&lt;br /&gt;  # output compression saves bandwidth &lt;br /&gt;  gzip              on;&lt;br /&gt;  gzip_proxied      any;&lt;br /&gt;  gzip_http_version 1.1;&lt;br /&gt;  #gzip_min_length   1100;&lt;br /&gt;  gzip_comp_level   5;&lt;br /&gt;  #gzip_buffers      4 8k;&lt;br /&gt;  gzip_types        text/plain text/html text/xml text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript application/atom+xml;&lt;br /&gt;  #gzip_vary        on;&lt;br /&gt;  #gzip_disable     "MSIE [1-6]\.";&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 18 Apr 2008 14:09:29 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5385</guid>
      <author>indiehead (John)</author>
    </item>
    <item>
      <title>Very basic lighttpd configuration</title>
      <link>http://snippets.dzone.com/posts/show/2850</link>
      <description>The configuration of lighttpd is vast and complex. Here is a close to minimal configuration which allows for Perl and Ruby CGI.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;server.document-root = "/opt/lighttpd/htdocs"&lt;br /&gt;&lt;br /&gt;server.port = 3000&lt;br /&gt;&lt;br /&gt;mimetype.assign = (&lt;br /&gt;  ".html" =&gt; "text/html",&lt;br /&gt;  ".txt" =&gt; "text/plain",&lt;br /&gt;  ".jpg" =&gt; "image/jpeg",&lt;br /&gt;  ".png" =&gt; "image/png"&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;static-file.exclude-extensions = ( ".rb", ".pl", ".fcgi", ".php", ".rb", "~", ".inc" )&lt;br /&gt;index-file.names = ( "index.html" )&lt;br /&gt;server.modules += ( "mod_cgi" )&lt;br /&gt;&lt;br /&gt;cgi.assign = (  ".rb" =&gt; "/opt/ruby/bin/ruby",&lt;br /&gt;                ".pl" =&gt; "/usr/bin/perl")&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 17 Oct 2006 18:44:34 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2850</guid>
      <author>mikewilsonuk (Mike Wilson)</author>
    </item>
    <item>
      <title>bash aliases</title>
      <link>http://snippets.dzone.com/posts/show/1991</link>
      <description>For old duffers like me who were used to earlier shells when bash came along.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# These save typing, I use them a lot&lt;br /&gt;&lt;br /&gt;alias sd='cd -' &gt; /dev/null&lt;br /&gt;alias cx='chmod +x'&lt;br /&gt;alias which="type -path"&lt;br /&gt;&lt;br /&gt;# This goes back to Unix v7, some time around 1985 I think.&lt;br /&gt;&lt;br /&gt;alias lf='ls -CF'&lt;br /&gt;&lt;br /&gt;# From my 'C' shell days. Those were almost 20 years ago as well. Sigh.&lt;br /&gt;&lt;br /&gt;alias h='fc -l -20'&lt;br /&gt;alias r='fc -s'&lt;br /&gt;&lt;br /&gt;# Because real men use 'vi' and why use character mode if you have X?&lt;br /&gt;&lt;br /&gt;alias vi='gvim'&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 06 May 2006 02:31:38 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1991</guid>
      <author>mikewilsonuk (Mike Wilson)</author>
    </item>
    <item>
      <title>.inputrc to make bash command-line editing like ksh</title>
      <link>http://snippets.dzone.com/posts/show/1990</link>
      <description>I was used to ksh and vi when bash came along, so I wanted the behaviour to remain the same. Some may think this odd.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;set editing-mode vi&lt;br /&gt;set keymap vi&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 06 May 2006 02:26:24 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1990</guid>
      <author>mikewilsonuk (Mike Wilson)</author>
    </item>
    <item>
      <title>vim configuration - graphics mode</title>
      <link>http://snippets.dzone.com/posts/show/1987</link>
      <description>This is my .gvim rc, the configuration file for gvim, vim's graphics mode. vim is "vi improved", a vi clone and so much more.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;set guifont=Monospace\ 11&lt;br /&gt;&lt;br /&gt;" Overrides settings in vim's configuration. I prefer minimal colour.&lt;br /&gt;&lt;br /&gt;hi Normal			guifg=Black		guibg=White&lt;br /&gt;hi NonText			guifg=Black		guibg=White&lt;br /&gt;hi Comment	gui=none	guifg=DarkGray&lt;br /&gt;hi Constant	gui=none	guifg=Magenta&lt;br /&gt;hi Identifier	gui=none	guifg=DarkGreen&lt;br /&gt;hi Statement	gui=none	guifg=Blue&lt;br /&gt;hi PreProc	gui=none	guifg=Blue&lt;br /&gt;hi Type		gui=none	guifg=Blue&lt;br /&gt;hi Special	gui=none	guifg=DarkGreen&lt;br /&gt;hi Ignore	gui=none	guifg=DarkGreen&lt;br /&gt;hi Error	gui=none	guifg=DarkGreen&lt;br /&gt;hi Todo		gui=none	guifg=DarkGreen&lt;br /&gt;hi Cursor	gui=none	guifg=White		guibg=Black&lt;br /&gt;&lt;br /&gt;autocmd GUIEnter * winpos 66 28&lt;br /&gt;autocmd GUIEnter * winsize 80 45&lt;br /&gt;&lt;br /&gt;" What is this menu for? No documentation, something to do with 'C'&lt;br /&gt;" or C++ perhaps? Dunno, but I don't want it.&lt;br /&gt;&lt;br /&gt;aunmenu Bicycle\ Repair\ Man&lt;br /&gt;&lt;br /&gt;" If I have Python, create a dummy project menu and exececute the&lt;br /&gt;" vimproject script.&lt;br /&gt;&lt;br /&gt;if has ("python")&lt;br /&gt;    if filereadable ("/home/mrw/bin/vimproject.py")&lt;br /&gt;	amenu Project.Dummy dummy&lt;br /&gt;	pyfile /home/mrw/bin/vimproject.py&lt;br /&gt;    endif&lt;br /&gt;endif&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 06 May 2006 02:13:27 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1987</guid>
      <author>mikewilsonuk (Mike Wilson)</author>
    </item>
    <item>
      <title>vim configuration</title>
      <link>http://snippets.dzone.com/posts/show/1986</link>
      <description>This is my .vimrc file -- configuration options for vim, the "vi improved" text editor for grown ups.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;:autocmd!&lt;br /&gt;&lt;br /&gt;set nohlsearch&lt;br /&gt;&lt;br /&gt;" Press F2 to word-wrap a block of text. It's almost like using Word&lt;br /&gt;" Star all over again.&lt;br /&gt;&lt;br /&gt;map #2 !}fmt -65&lt;br /&gt;&lt;br /&gt;" Personally, I wouldn't use a C++ keyword as a Java identifier, but&lt;br /&gt;" if someone else does, I don't want an ugly display, so turn off&lt;br /&gt;" flagging of this as an error:&lt;br /&gt;&lt;br /&gt;let java_allow_cpp_keywords=1&lt;br /&gt;&lt;br /&gt;set autoindent&lt;br /&gt;set cmdheight=2&lt;br /&gt;&lt;br /&gt;" Strewth, what a mess. Copied from the vim docs, if memory serves.&lt;br /&gt;&lt;br /&gt;set comments=s:/*,mb:**,ex:*/,://,b:#,b:##,:%,:XCOMM,n:&gt;,fb:-&lt;br /&gt;&lt;br /&gt;set formatoptions=orc&lt;br /&gt;set history=20&lt;br /&gt;set incsearch&lt;br /&gt;set ignorecase&lt;br /&gt;set keywordprg=&lt;br /&gt;set mouse=a&lt;br /&gt;set mousehide&lt;br /&gt;set mousemodel=popup_setpos&lt;br /&gt;set nowrapscan&lt;br /&gt;set path=.,/usr/include,/usr/local/include&lt;br /&gt;set smartcase&lt;br /&gt;set nosmartindent&lt;br /&gt;set smarttab&lt;br /&gt;set showmode&lt;br /&gt;set textwidth=70&lt;br /&gt;set viminfo='50,\"10000,n~/.viminfo&lt;br /&gt;set wildchar=9&lt;br /&gt;set wildignore+=*.class,*.pyc&lt;br /&gt;set wildmenu&lt;br /&gt;&lt;br /&gt;syntax on&lt;br /&gt;&lt;br /&gt;:autocmd FileType *		set shiftwidth=4&lt;br /&gt;:autocmd FileType xml,html	set shiftwidth=2&lt;br /&gt;:autocmd FileType java,c,cc,cpp	set nocindent&lt;br /&gt;&lt;br /&gt;set makeprg=ant&lt;br /&gt;&lt;br /&gt;" Bleurgh! This makes sense of ant/jikes error messages so the ":make"&lt;br /&gt;" command works. But, I ask you, how the f**k can anyone make sense of&lt;br /&gt;" that mess?&lt;br /&gt;&lt;br /&gt;set efm=\ %#[javac]\ %#%f:%l:%c:%*\\d:%*\\d:\ %t%[%^:]%#:%m,\%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%#&lt;br /&gt;&lt;br /&gt;" For the style of comments I like in 'C', C++ and Java.&lt;br /&gt;&lt;br /&gt;autocmd BufNewFile,BufRead *.java set comments=s:/*,mb:**,ex:*/&lt;br /&gt;autocmd BufNewFile,BufRead *.c set comments=s:/*,mb:**,ex:*/&lt;br /&gt;autocmd BufNewFile,BufRead *.cc set comments=s:/*,mb:**,ex:*/&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 06 May 2006 02:10:06 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1986</guid>
      <author>mikewilsonuk (Mike Wilson)</author>
    </item>
    <item>
      <title>www.example.com =&gt; example.com in apache configuration</title>
      <link>http://snippets.dzone.com/posts/show/969</link>
      <description>// www.example.com =&gt; example.com&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]&lt;br /&gt;RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 12 Dec 2005 20:45:52 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/969</guid>
      <author>mornlee (mornlee)</author>
    </item>
  </channel>
</rss>
