Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
## Short introduction ##
# It is supposed that you have MySQL to backup. Done via mk-parallel-dump (maatkit).
# Files (including DB dumps) are keept versioned, so you can revert to any state during last 20 days. Done via rdiff-backup.
# Afterwards, files (with versions metainfo) are transfered to FTP server. Done via duplicity.
# Required software:
# 1. maatkit (mk-parallel-dump)
# 2. rdiff-backup
#!/bin/sh
#ROLE: server, upstream
ROLE="upstream"
CONFIG=/usr/local/etc/scribe/$ROLE.conf
. /etc/rc.subr
name="scribed"
rcvar=`set_rcvar`
public static function localize($user) {
global $_CONF;
//detect from browser
$language = http_negotiate_language(array_keys($_CONF['locales']));
//detect from cookie
if($_COOKIE['language'] && array_key_exists($_COOKIE['language'], $_CONF['locales'])) {
$language = $_COOKIE['language'];
}
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/Users/dm/Projects/pavelzmey"
ServerName pavelzmey.local
# ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log"
# CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log common"
<Directory /Users/dm/Projects/pavelzmey>
Options Indexes MultiViews
AllowOverride All
ServerRoot "/usr"
Listen 80
LoadModule authn_file_module libexec/apache2/mod_authn_file.so
LoadModule authn_dbm_module libexec/apache2/mod_authn_dbm.so
LoadModule authn_anon_module libexec/apache2/mod_authn_anon.so
LoadModule authn_dbd_module libexec/apache2/mod_authn_dbd.so
LoadModule authn_default_module libexec/apache2/mod_authn_default.so
LoadModule authz_host_module libexec/apache2/mod_authz_host.so
LoadModule authz_groupfile_module libexec/apache2/mod_authz_groupfile.so
LoadModule authz_user_module libexec/apache2/mod_authz_user.so
require 'highline/import'
namespace :db do
desc 'Populates DB in interactive mode with sample data'
task :populate => :environment do
puts
if agree("Do you want me to create admin user? ")
Factory :admin_user,
<FilesMatch "\.(engine|inc|info|install|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
Order allow,deny
</FilesMatch>
Options -Indexes +FollowSymLinks
ErrorDocument 404 /index.php
<Files favicon.ico>
ErrorDocument 404 "The requested file favicon.ico was not found."
#ifndef lint
char copyright[] =
"@(#) Copyright (c) 1987 Regents of the University of California.\n\
All rights reserved.\n";
#endif /* not lint */
#ifndef lint
static char rcsid[] = "$OpenBSD: guesswhat.c,v 1.5 2003/06/10 22:20:49 deraadt Exp $";
#endif /* not lint */
require File.dirname(__FILE__) + '/../spec_helper'
module PropertySpecHelper
def valid_property_attributes
{
:name => "a_property",
:presentation => "A Property"
}
end
end
<?php
$aLangInfo=array (
'Name' => 'ru',
'Flag' => 'ru',
'Title' => 'русский',
);
$aLangContent=array (
);
?>