<?xml version="1.0" encoding="UTF-8"?><!-- generator="WordPress/2.8.4" -->
<rss version="0.92">
<channel>
	<title>dan.thoughts</title>
	<link>http://blog.sosedoff.com</link>
	<description></description>
	<lastBuildDate>Thu, 14 Jan 2010 13:30:26 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	
	<item>
		<title>Back to business</title>
		<description>Im back to my blog, which i havent updated since last october. Need to throw some more articles.  </description>
		<link>http://blog.sosedoff.com/2010/01/14/back-to-business/</link>
			</item>
	<item>
		<title>How to identify your clients` browser type</title>
		<description>Some time ago i wrote a simple regex patterns to determine whether my client crawler bot, mobile client or just regular one. Easy to expand and to use.


function is_mobile($agent) {
    $pattern = '/(blackberry&#124;motorokr&#124;motorola&#124;sony&#124;windows ce&#124;240x320&#124;176x220&#124;palm&#124;mobile&#124;iphone&#124;ipod&#124;symbian&#124;nokia&#124;samsung&#124;midp)/i';
    return (bool)preg_match($pattern, $agent);
}
	
function is_crawler($agent) {
    pattern = ...</description>
		<link>http://blog.sosedoff.com/2009/10/02/how-to-identify-your-clients-browser-type/</link>
			</item>
	<item>
		<title>Rails-like PHP url router</title>
		<description>My previous version of php url router was not good enough, so i`ve done some core modification to the class. Its more flexible now. The whole idea is very similar to Rails` and Merb`s url router (merb is a rails-fork). In fact, previous version doesn`t even support GET variables in ...</description>
		<link>http://blog.sosedoff.com/2009/09/20/rails-like-php-url-router/</link>
			</item>
	<item>
		<title>Date separated MySQL backups</title>
		<description>Here is the bash shell script that makes archived dumps of your database server. All databases are separated from each other and stored into date based folders. 


#!/bin/bash

MyUSER="root"
MyPASS=""
MyHOST="localhost"
NOW="$(date +"%d-%m-%Y")"
STOREDIR="/home/storage/backup/database/by_dates/$NOW"
DBLIST="$(mysql -u $MyUSER -h $MyHOST -Bse 'show databases')"

[ ! -d $STOREDIR ] && mkdir -p $STOREDIR &#124;&#124; :


for db in $DBLIST 
do
	FILE="$STOREDIR/$db.gz"
	mysqldump ...</description>
		<link>http://blog.sosedoff.com/2009/09/18/date-separated-mysql-backups/</link>
			</item>
	<item>
		<title>Blog is back!</title>
		<description>Recovered blog. Will start write some other stuff soon. </description>
		<link>http://blog.sosedoff.com/2009/09/17/blog-is-back/</link>
			</item>
	<item>
		<title>How to deploy Sinatra / Merb applications with nginx</title>
		<description>Developing with Merb or Sinatra ? Like web server nginx ? Ok, lets go.

Basically, Merb/Sinatra uses thin (based on eventmachine) server module, so it is working as stand-alone application. So, there is a way to connect nginx with these applications. Very simple - all you need to proxy requests to ...</description>
		<link>http://blog.sosedoff.com/2009/07/04/how-to-deploy-sinatra-merb-applications-with-nginx/</link>
			</item>
	<item>
		<title>Simple php url routing controller</title>
		<description>!!! CONSIDER THIS AS AN UPDATE:Rails-like PHP Url Router

Here is simple url parser, that produces output parameters lile: controller, action, parameters. Also, it support simple virtual key rules, "rails" style. 

For example, url like "http://foo.bar/book/view/12" will produce parameters: controller = book, action = view, id = 12. 

Here is php ...</description>
		<link>http://blog.sosedoff.com/2009/07/04/simpe-php-url-routing-controller/</link>
			</item>
	<item>
		<title>Install Git on CentOS 5.2</title>
		<description>First, we need to install all dependencies:
# yum install gettext-devel expat-devel curl-devel zlib-devel openssl-devel

Next, get the git 1.6.x sources:
# wget http://kernel.org/pub/software/scm/git/git-1.6.3.3.tar.gz

Then, unpack and cd into git sources folder and install it:
# make && make install & make clean

That`s it, now you`ll have git system ready to go. </description>
		<link>http://blog.sosedoff.com/2009/06/28/install-git-on-centos-52/</link>
			</item>
	<item>
		<title>Jabber bot with Ruby</title>
		<description>Ruby has very powerful tools to create random jabber bots with XMPP protocol. In this article i`ll show just a small sample with a few commands available. 

I got xmpp4r-simple library from Google Code page - http://code.google.com/p/xmpp4r-simple/. Its kinda old, not updated since 2006, but the sources are really easy ...</description>
		<link>http://blog.sosedoff.com/2009/05/20/jabber-bot-with-ruby/</link>
			</item>
	<item>
		<title>WebDAV client in ruby</title>
		<description>Here is a simple example how to make native WebDAV client with Ruby sockets. No additional gems or extensions needed - just all basic classes. 


class WebDAV
	attr_reader :host, :port, :protocol, :chunk_size
	@socket = nil
			
	def initialize(host,port=80,protocol='HTTP/1.1',chunk=8096)
		@host = host.to_s
		@port = port.to_i
		@protocol = protocol
		@chunk_size = chunk.to_i
	end
	
	def build_header(method, path, content_length=nil)
		header = "#{method} #{path} #{@protocol} \r\n"
		header ...</description>
		<link>http://blog.sosedoff.com/2009/05/02/webdav-client-in-ruby/</link>
			</item>
</channel>
</rss>
