Skip to content

Instantly share code, notes, and snippets.

@esfand
esfand / lookupstate.adoc
Last active Jul 31, 2020
State Lookup SQL Table
View lookupstate.adoc
@esfand
esfand / asciidoc-artible.adoc
Created Mar 14, 2014
Asciidoc Article Template
View asciidoc-artible.adoc

AsciiDoc Syntax Quick Reference

@esfand
esfand / rsyslogque.md
Last active Dec 31, 2019
Rsyslog queues
View rsyslogque.md

Main Queue

This object is available since 7.5.3. It permits to specify parameters for the main message queue. Note that only queue-parameters are permitted for this config object. This permits to set the same options like in ruleset and action queues. A special statement is needed for the main queue, because it is a different object and cannot be configured via any other object.

Note that when the main_queue() object is configured, the legacy $MainMsgQ... statements are ignored.

A Simple Example

main_queue(    
    queue.size="100000"      # how many messages (messages, not bytes!) to hold in memory
    queue.type="LinkedList"  # allocate memory dynamically for the queue. Better for handling spikes
@esfand
esfand / nginx1subapp.md
Last active Dec 31, 2019
Nginx Location Ruels
View nginx1subapp.md

Serving multiple webapps from different folders

November 29, 2011 developmentNginx

Few days ago I had to add a wordpress installation within the same environment where a Codeigniter app was already running happily and undisturbed.

It took me a while to figure out how to keep separate folders on the filesystem, and serve the blog from a subfolder of the main domain:

@esfand
esfand / lookuptable.adoc
Last active Dec 21, 2019
SQL: Creating a lookup table
View lookuptable.adoc

SQL: Creating a Lookup SQL Table

Creating a Lookup SQL Table


@esfand
esfand / nginxvarcore.md
Last active Dec 3, 2019
Nginx Variables
View nginxvarcore.md

Embedded Variables

The ngx_http_core_module module supports embedded variables with names matching the Apache Server variables. First of all, these are variables representing client request header fields, such as $http_user_agent, $http_cookie, and so on. Also there are other variables:

  • $arg_name
    argument name in the request line
@esfand
esfand / tomcatmultihost.md
Last active Nov 26, 2019
Tomcat with Multiple Virtual Host
View tomcatmultihost.md

I configured my single tomcat to host 2 services at different connector port like this :-

<!-- WebApp 1-->
<Service name="webapps1">
    <Connector port="7001" 
               maxThreads="150" 
               minSpareThreads="25" 
               maxSpareThreads="75" 
               enableLookups="false" 
@esfand
esfand / part1.md
Last active Sep 3, 2019
Serving Static Content with Nginx
View part1.md

OFBiz or Bonsai ERP, and nginx

Submitted by anne on 10 Oct 2011

OFBiz can quite happily service all http and https requests on its own, and many people run it this way.

However there are many possible reasons why you might want to put OFBiz behind a traditional http server, such as Apache. Perhaps you want to more efficiently serve static resources, or manage virtual domains, or restrict access in complicated ways, or also serve php or cgi pages.

Typically OFBiz is placed behind Apache using a connector such as mod_proxy_ajp, as documented at How To Httpd .

@esfand
esfand / install.py
Created May 28, 2018 — forked from ajumell/install.py
Webfaction Magento Insatll script.
View install.py
-----BEGIN WEBFACTION INSTALL SCRIPT-----
#!/bin/env python2.4
"""
Magento 1.7.0.2
"autostart": not applicable
"extra info": Do you agree to Magento's license?
http://www.opensource.org/licenses/osl-3.0.php
@esfand
esfand / utf8.c
Created Aug 14, 2019 — forked from stanislaw/utf8.c
Some C functions to work with UTF-8 string : you can check if a string is valid UTF-8, get the length of a UTF-8 string and replace things in a UTF-8 string. All `char *` arguments must be regular, null-byte terminated, C strings. I've tried to optimize the best I could. I'd be grateful for any suggestions or improvements. Please note I have onl…
View utf8.c
//
// utf8.c
// training
//
// Created by Conrad Kleinespel on 5/27/13.
// Copyright (c) 2013 Conrad Kleinespel. All rights reserved.
//
#include <stdio.h>
#include <stdlib.h>
You can’t perform that action at this time.