HOWTO: removing spam referrer from your wordpress blog

I have recently discovered the plugin which helps me to remove completely all annoying referral sites in analytics.  Familiar pattern of best seo, social buttons, get free traffic and so on appears in your analytics?



The solution is simple - "Spam Referrer Block" Plugin. It's available from wordpress.org, All settings are clearly defined.



Enjoy!

Apache: _default_ virtualhost overlap on port 80

or Apache: _default_ virtualhost overlap on port 443

The size declaration place matters. Apache reads configuration settings from extras directory in alphabetic order. The error will appears if your virtual host was declared before httpd-vhost.conf 
The solution is quite simple. Just add to the httpd.conf before Listen 80 the line

NameVirtualHost *:80

If you use SSL virtual hosts add into httpd-ssl.conf file before Listen 443 the line

NameVirtualHost *:443


Enjoy!

C# IntelliSense plugin for Notepad++ (CSScriptNpp)

This plugin allows convenient editing and execution of the C# code (scripts). It also allows the usual C# IntelliSense and project management tasks to be performed in a way very similar to the MS Visual Studio.
In addition to this, it provides generic debugging functionality (with the integrated Managed Debugger) as well as the ability to prepare C# scripts for the deployment packages (script+engine or self-contained executable).
Typically user opens the C# file with Notepad++ and after presses 'Load' button on the CS-Script toolbar the all features can be accessed through two Notepad++ dockable panels Project and Output panel.



Source: csscriptnpp.codeplex.com

WinSCP failed to open saved session from command line

I would like to save site settings into INI file using portable version of WinSCP and reuse it from console or script file. By default WinSCP has saved session in format [Sessions\myuser@myhost.com], you can see on pic. 1. According to documentation I should open saved session with command
open myuser@myhost.com
But winSCP had trying to connect myhost.com and asked for password.
WinSCP failed to open saved session
pic. 1

Using try-and-fail method I have found that session name should not contain @ . / characters, I have renamed session into myhost_com (pic. 2) and successfully open my stored session with
open myhost_com
pic. 2

Enjoy!

OTRS transfer queue

you can't transfer complete queue to another location in meaning copy all tickets to new location :(
it's possible just move complete queue with all tickets using "Sub-queue of" dropdown, just select new mounting point.



HOWTO copy all tickets to new location.

PLEASE MAKE BACKUP BEFORE ANY CHANGE!

The solution - create  structure at another location and use generic job to move all (open and closed) tickets to new queue. This must be done for all subqueues also.


Enjoy!

nsclient++ and check IIS7 application pools

It exists well-known script for NSClient++ 3.x to check Internet Information Services (IIS) AppPool status. It uses Windows Management Instrumentation (WMI). I didn't find installation instruction for NSClient++ 4.2 and I would like to share my working config.
  • Just save Check_IISv7_AppPool_State.vbs file into scripts directory 
  • modify setting in nsclient.ini file as stays below 
  • restart nsclient service finally

; 
[/modules]
; NRPE server - A simple server that listens for incoming NRPE connection and handles them.
NRPEServer = 1


[/settings/NRPE/server]
allowed hosts = YOUR.NAGIOS.SERVER.ADDRESS
allow arguments = true
allow nasty characters = true
port = 5666
timeout = 60
use ssl = 1
performance data = 1

[/settings/external scripts]
allow arguments = 1
allow nasty characters = 1
timeout = 60

[/settings/external scripts/scripts]
check_iis_defaultapppool=cscript.exe //nologo //T:60 scripts/Check_IISv7_AppPool_State.vbs DefaultAppPool
check_iis_mypool=cscript.exe //nologo //T:60 scripts/Check_IISv7_AppPool_State.vbs "My New Pool"
check_iis_longrunning=cscript.exe //nologo //T:60 scripts/check_IISv7_long_running.vbs 1000 20000

NOTE: Application Pool name with spaces must be quoted as was described in the previous post!

To check settings from nagios server please execute on remotes host
# /usr/local/nagios/libexec/check_nrpe -H IIS.HOST.IP.ADDRESS -t 60 -p 5666 -c check_iis_mypool

If all settings are correct you should see result
OK! My New Pool: STARTED

Enjoy!

OTRS hide junk/spam queue from move list

Problem: OTRS user complains about wrong moved ticket into spam queue when tried to move into another queue.

IMHO 'spam' button is more secure way to mark as spam the ticket, so we need to remove junk/spam queue from dropdown without coding.
You can't just revoke move_into permission from junk/spam queue's group because you lose option 'mark as spam'. And here can help us simple ACL

#hide junk queue
$Self->{TicketAcl}->{'ACL-hide-junk-queue'} = {
 # match properties
 Properties => {
  # all tickets
  Ticket => {

  },
  
  #only on AgentTicketZoom page
  Frontend => {
 Action => [
  'AgentTicketZoom',
 ],
  },
 },
 PossibleNot => {
  # shouldn't be moved into
  Ticket => {
                Queue => ['Junk', 'SPAM'],
            },
  }, 
};

Enjoy!

Asterisk AST_SORCERY function

 AST_SORCERY gets a field from a sorcery object. Sorcery is always created for PJSIP aors, endpoints and identifies in asterisk. It allows y...