Skip to content

Instantly share code, notes, and snippets.

View karaaie's full-sized avatar

Kamil Hakim karaaie

  • Pleo Technologies AB
  • Sweden
View GitHub Profile
@karaaie
karaaie / nginx
Created August 22, 2014 07:35
GROK pattern for NGINX parsing
NGINXACCESS %{IPORHOST:hostname} %{IP:remote_addr} - %{USERNAME:remote_user} \[%{HTTPDATE:timestamp}\] %{QS:request} %{INT:status} %{INT:bytes_sent} %{QS:http_referer} %{QS:http_user_agent}
filter {
grok {
break_on_match => "false"
type => "syslog"
match => ["syslog_program","nginx-access","nginx-error"]
pattern => "%{NGINXACCESS}"
}
}
require 'albacore'
require 'albacore/ext/teamcity'
task :build_nuget do
Dir.chdir('src/chocolatey/MyChocolateyPackage')
#The following command requires that chocolatey is on the
# SYSTEM-Path for the Teamcity-BuildAgent
system 'cpack'
Albacore.publish :artifact, OpenStruct.new(:location => "src/MyChocolateyPackage/*.nupkg")
end
param (
#folder where all your websites are located
[string]$webSiteRootFolder = "c:\websites",
#name of site that you're setting up
[string]$siteName = "HelloWorldSite",
#the port your default binding is using
[string]$port = 8090,
#where the source files are
[string]$Sourcefiles = "source/*"
)
<?xml version="1.0"?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata>
<id>helloworldsite</id>
<title>HelloWorldSite</title>
<version>1.0.0</version>
<authors>Kamil Hakim</authors>
<owners>Kamil Hakim</owners>
try {
#Get current dir
$tools = split-path $MyInvocation.MyCommand.Path (1)
#Get parent dir
$parentDir = split-path -parent $tools (2)
#get HelloWorldSite source dir $source = join-path $parentDir "source/*" (3)
#get location of the installtion file
$installFile = join-path $parentDir "installSite.ps1" (4)
Invoke-Expression "$installFile -Sourcefiles $source" (5)
Write-ChocolateySuccess 'HelloWorldSite' (6)
param (
#folder where all your websites are located
[string]$webSiteRootFolder = "c:\\websites",
#name of site that you're setting up
[string]$siteName = "HelloWorld",
#the port your default binding is using
[string]$port = 8090
)
@karaaie
karaaie / create_iis_config.ps1
Created February 20, 2014 13:02
This powershell script will generate the necessary IIS config for nxlog.
Param([string]$nxlog_dir = "c:\nxlog")
Import-Module WebAdministration;
$input_template = "<Input {0}>
Module im_file
File '{1}\W3SVC{2}\\*.log'
ReadFromLast TRUE
Exec if ((`$raw_event =~ /^#/) or (`$raw_event =~ /^$/)) drop(); \
else w3c->parse_csv(); \