apache_conf Bulkloader Obeiros.cit

Bulkloader Obeiros.cit

configuration.bulkloader.sh
Configurar Bulkloader na obeiros.cit 

- Habilitando ssl; 
http://paltman.com/2007/11/15/getting-ssl-support-in-python-251/ 

- Baixado o sqlite3 e instalado; 

Download latest sqlite3 from sqlite website. sqlite-autoconf* 
Install that in 3 simple steps 
./configure 
make 
make install 
Rebuild the python make make install (baixar o python e descompatar e executar esse comando) 

- Colocado Oracle na variável de ambiente 
 nano /home/glassfish/.bash_profile 

############################# 
export ORACLE_BASE=/usr/local/oracle 
export ORACLE_HOME=$ORACLE_BASE/9.2.0 
export ORACLE_TERM=xterm 
export PATH=$HOME/bin:$ORACLE_HOME/bin:$PATH 
export NLS_LANG='AMERICAN_AMERICA.WE8ISO8859P1'; 
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib 
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib 
export PATH=$PATH:$ORACLE_HOME/bin:$JAVA_HOME/bin 
export LD_PRELOAD=~/lib/libcwait.so 

PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:$GLASSFISH_HOME/bin:$ORACLE_HOME/bin 
########################### 

- Baixado o: cx_Oracle-5.1.2.tar.gz 
Descompactado, acessado o diretório e rodado: 
python setup.py install

apache_conf 示例Sass Config.rb

示例Sass Config.rb

config.rb
preferred_syntax = :sass
http_path = '/'
css_dir = 'assets/stylesheets'
sass_dir = 'assets/sass'
images_dir = 'assets/images'
javascripts_dir = 'assets/javascripts'
relative_assets = true
line_comments = true
# output_style = :compressed

apache_conf MIME类型:debug pour IE8(rend les doc ouvrables)

MIME类型:debug pour IE8(rend les doc ouvrables)

.htaccess
AddType application/vnd.ms-word.document.macroEnabled.12 .docm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
AddType application/vnd.ms-powerpoint.template.macroEnabled.12 potm
AddType application/vnd.openxmlformats-officedocument.presentationml.template potx
AddType application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam
AddType application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
AddType application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
AddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
AddType application/vnd.ms-excel.addin.macroEnabled.12 xlam
AddType application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
AddType application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
AddType application/vnd.ms-excel.template.macroEnabled.12 xltm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx

apache_conf 崇高的文本配置

崇高的文本配置

config.json
{
	"font_face": "PragmataPro",
	"font_size": 14.0,
	"highlight_line": true,
	"ignored_packages":
	[
		"Vintage"
	],
	"theme": "Soda Dark 3.sublime-theme",
	"soda_folder_icons": true,
	"save_on_focus_lost": true,
	"word_wrap": true
}

apache_conf python ConfigParser

python ConfigParser

config.py
import ConfigParser
conf = ConfigParser.SafeConfigParser()
conf.read(CONFIG_FILE)
conf.get('namespace', 'key1') #value1

''' CONFIG_FILE
[namespace]
key1: value1
key2: value2
'''

apache_conf УзнатьдоступкбазеданныхчерезисходныйкодMODXRevolution CMS。 Файл/ core / config / config.inc.php。

УзнатьдоступкбазеданныхчерезисходныйкодMODXRevolution CMS。 Файл/ core / config / config.inc.php。

config.inc.php
$database_server = 'localhost';   // Сервер базы данных 
$database_user = 'mydbase';       // Пользователь базы
$database_password = 'password';  // Пароль
$dbase = 'mydbase';               // Имя базы

apache_conf .htaccess更好的Google页面速​​度结果规则 - 这是我添加到任何我希望显着增加的网站的一组默认规则

.htaccess更好的Google页面速​​度结果规则 - 这是我添加到任何我希望显着提高速度的网站的一组默认规则。这需要大量的除草和测试,但这似乎是最好的,并且(保证不包括)通过处理大量缓存建议来提高您的Google Page Speed分数。

.htaccess
# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0
 
# Set up caching on media files for 1 year (forever?)
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A29030400
Header append Cache-Control "public"
</FilesMatch>
 
# Set up caching on media files for 1 week
<FilesMatch "\.(gif|jpg|jpeg|png|swf)$">
ExpiresDefault A604800
Header append Cache-Control "public"
</FilesMatch>
 
# Set up 2 Hour caching on commonly updated files
<FilesMatch "\.(xml|txt|js|css)$">
ExpiresDefault A604800
Header append Cache-Control "proxy-revalidate"
</FilesMatch>
 
<FilesMatch "\.(js|css|xml|gz)$">
Header append Vary Accept-Encoding
</FilesMatch>
 
# Force no caching for dynamic files
<FilesMatch "\.(php|cgi|pl|htm)$">
ExpiresActive Off
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
</FilesMatch>
 
AddEncoding gzip .gz
<Files *.css.gz>
  ForceType text/css
</Files>
<Files *.js.gz>
  ForceType text/javascript
</Files>
<FilesMatch .*\.(js|css)>
  RewriteEngine On
  RewriteCond %{HTTP_USER_AGENT} !MSIE
  RewriteCond %{HTTP:Accept-encoding} gzip
  RewriteCond %{REQUEST_FILENAME}.gz -f
  RewriteRule ^(.*)$ $1.gz [L]
</FilesMatch>

apache_conf htaccess:利用浏览器缓存的指令

htaccess:利用浏览器缓存的指令

.htaccess
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##

## http://thomasgriffinmedia.com/blog/2010/11/how-to-leverage-browser-caching-in-wordpress-via-htaccess/

apache_conf Barebones Backbone路由器示例,用于具有本地URL的Apache站点,例如http:// local5 / backbone-router。

Barebones Backbone路由器示例,用于具有本地URL的Apache站点,例如http:// local5 / backbone-router。

index.html
<!DOCTYPE HTML> 
<html lang="en-gb">
<head>
<meta charset="UTF-8">
<!-- Need this to get around "Uncaught SyntaxError: Unexpected token <" errors when you request a multi-level url -->
<base href="http://local5/backbone-router/" />
<title></title>
<style>

  a {
    display: block;
  }

</style>
</head>
<body>

<a href="show">Show</a>

</body>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/json2/20121008/json2.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.1/underscore-min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min.js"></script>
<script src="app.js"></script>
</html>
app.js
/* http://www.codebeerstartups.com/2013/01/routers-in-backbone-js-learning-backbone-js/

http://www.josscrowcroft.com/2012/code/htaccess-for-html5-history-pushstate-url-routing/
For Apache to send requests to index.html, where your router JS can then handle them, you need to have something like this in your .htaccess

# html5 pushstate (history) support:
<ifModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !index
    RewriteRule (.*) index.html [L]
</ifModule>

1. Need rewrite rules in your .htaccess.
2. If you're not in root directory, may need base tag in your HTML file header.
3. Need to specify your app's base directory in your call to Backbone.history.start.

http://local5/backbone-router/ -- "Index route has been called.."
http://local5/backbone-router/show -- "Show route has been called.."
http://local5/backbone-router/help/news -- "Help route: page news"
http://local5/backbone-router/section/2/1 -- "Section route: section 2 part 1"

*/

(function(){

  window.App = {
    Models: {},
    Collections: {},
    Views: {},
    Router: {}
  };

  App.Router = Backbone.Router.extend({
    routes: {
      "": "index",
      "show(/)": "show",
      "help(/:page)(/)": "help",
      "section/:section(/)(:part)(/)": "section"
    },

    index: function(){
      $(document.body).append("Index route has been called..");
    },

    show: function(){
      $(document.body).append("Show route has been called..");
    },

    help: function(page){
      $(document.body).append("Help route has been called: page " + page);
    },

    section: function(section, part){
      $(document.body).append("Section route has been called: section " + section + " part " + part);
    }

  });

  App.Views.ListView = Backbone.View.extend({
    
    initialize: function(){
      this.initializeRouter();
    },

    initializeRouter: function () {
      this.router = new App.Router();
      Backbone.history.start({ pushState: true, root: "/backbone-router/" });
    }

  })

  var view = new App.Views.ListView();

})();
.htaccess
# html5 pushstate (history) support:
<ifModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !index
    RewriteRule (.*) index.html [L,QSA]
</ifModule>

apache_conf 整合LESSPHP

整合LESSPHP

less.php
<?php

/**
 * Automatically compile LESS files
 * 
 * Features:
 *  - Uses the system temp directory to ensure it is writable
 *  - Gzip compression
 *  - Compile only if not modified
 *  - Respect If-Modified-Since header
 *  - @todo Add caching for gzipped version
 *  - @todo Add caching header
 * 
 * Installation:
 * 1. Download lessphp and extract to $DOCUMENT_ROOT/lessphp
 * @link http://leafo.net/lessphp/
 * 
 * 2. Add this script in the lessphp directory
 * 
 * 3.1. Add RewriteRule in htaccess
 * RewriteCond %{REQUEST_FILENAME} !-f
 * RewriteCond %{REQUEST_FILENAME} ^(.*)\.css
 * RewriteCond %1.less -f
 * RewriteRule ^(.*)\.css lessphp/less.php?f=$1.less
 * 
 * 3.2. If htaccess is not possible, replace CSS links from
 * /css/style.less
 * to
 * /lessphp/less.php?f=css/style.less
 * 
 * 
 * @link https://gist.github.com/4127137
 */

if (empty($_GET['f']) || !preg_match('/\.less$/', $_GET['f'])) {
    header('HTTP/1.0 400 Bad Request');
    die();
}

$cache_dir   = sys_get_temp_dir() . '/lessphp/' . $_SERVER['SERVER_NAME']; // will store files in /tmp/lessphp/example.com/css/style.css
$doc_root    = dirname(dirname(__FILE__));
$less_file   = "$doc_root/{$_GET['f']}";
$css_file    = $cache_dir . '/' . preg_replace('/\.less/', '.css', $_GET['f']);
$enable_gzip = !empty($_SERVER['HTTP_ACCEPT_ENCODING']) && in_array('gzip', explode(',', $_SERVER['HTTP_ACCEPT_ENCODING']));

if (!is_file($less_file)) {
    header('HTTP/1.0 404 Not Found');
    die();
}

if (!is_dir(dirname($css_file))) {
    mkdir(dirname($css_file), 0755, true);
}

require 'lessc.inc.php';
$less = new lessc;
$less->setFormatter("compressed");

try {
    // Compiles only if $less_file mtime != $css_file mtime
    $less->checkedCompile($less_file, $css_file);
} catch (Exception $e) {
    header('HTTP/1.0 500 Internal Server Error');
    echo $e->getMessage();
    die();
}

$fp = fopen($css_file, 'r');
$stat = fstat($fp);

if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $stat['mtime']) {
    header('HTTP/1.0 304 Not Modified');
} else {
    header('Cache-Control: must-revalidate');
    header('Content-Type: text/css; charset=utf-8');
    header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $stat['mtime']) . ' GMT');

    if ($enable_gzip) {
        header('Content-Encoding: gzip');
        ob_start("ob_gzhandler");
    }
    fpassthru($fp);
}

fclose($fp);
.htaccess
# LESS compiler
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} ^(.*)\.css
RewriteCond %1.less -f
RewriteRule ^(.*)\.css lessphp/less.php?f=$1.less