Come determinare il tipo di Web Server in esecuzione su Linux o Windows

[aggiornamento 2012]

In linux è presente il comando curl ( client for URL ) che permette di evidenziare il tipo di web server su cui è in esecuzione un sito web.

$ curl -I  webserver-domain  o ip-number
~$ curl -I www.microsoft.com
HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 0
Server: Microsoft-IIS/8.0
P3P: CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"
X-AspNet-Version: 2.0.50727
VTag: 791648643500000000
X-Powered-By: ASP.NET
X-Powered-By: ARR/2.5
X-Powered-By: ASP.NET
Date: Sat, 05 Jan 2013 23:01:28 GMT

oppure

~$ curl -I https://mauriziosiagri.wordpress.com/
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 05 Jan 2013 23:09:36 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
Vary: Cookie
X-hacker: If you're reading this, you should visit automattic.com/jobs and apply to join the fun, mention this header.
X-Pingback: https://mauriziosiagri.wordpress.com/xmlrpc.php
Link: <http://wp.me/1zOaP>; rel=shortlink

ancora

~$ curl -I http://www.bluehost.com/
HTTP/1.1 200 OK
Date: Sat, 05 Jan 2013 23:13:17 GMT
Server: Apache/2.2.23 (CentOS)
Set-Cookie: r=house%5ENOAFFILIATE%5E-; path=/; expires=Thu, 04-Jul-2013 23:13:17 GMT
Set-Cookie: custid=C840094986302; domain=.bluehost.com; path=/; HttpOnly
Content-length: 19496
Last-Modified: Wed, 02 Jan 2013 22:06:09 GMT
Vary: Accept-Encoding
Content-Type: text/html; charset=ISO-8859-1

.

curl è un client per ottenere  documenti/files da un web server o per mandare documenti ad un server utilizzando diversi protocolli (HTTP, HTTPS, FTP, GOPHER, DICT, TELNET, LDAP or FILE). Non è di tipo interattivo.

– oltre al tradferimento di files
– può comprendere cookies, certificati SSL, proxies
– …

 

 

How escape single quote ‘ in postgresql

To escape single quote in SQL Server and in PostgreSQL doubling them up ‘ as showed in examples below. It’s useful with SQL insert and update command:

Escape with the backslash \‘ is not prefereable  \’.

It’s possible to use dollar-quote string $ PostgreSQL: Documentation: 9.3: Lexical Structure:   ‘escape ” dollar-quote test ””’   ->  $$escape ‘ dollar-quote test ”$$  -> $token$escape ‘ dollar-quote test ”$token$

1) dubling up single quote ‘

INSERT INTO _aquery ( itemid, tcontent, title ) 
 VALUES ( 8503, SELECT * FROM information_schema.tables WHERE table_schema=''public'' and table_type=''BASE TABLE''', 'Show tables view sequences...' ) ;

Result:

itemid | tcontent	                                                                               | title
8502	 SELECT * FROM information_schema.tables WHERE table_schema='public' and table_type=BASE TABLE	 Show tables view sequences ...

1)

2)

INSERT INTO _aquery ( itemid, tcontent, title ) 
 VALUES (  8505, 
'SELECT n.nspname as "Schema",
       c.relname as "Name",
       CASE c.relkind WHEN ''r'' THEN ''table'' WHEN ''v'' THEN ''view'' WHEN ''i'' THEN ''index'' WHEN ''S'' THEN ''sequence'' WHEN ''s'' THEN ''special'' END as "Type",
      pg_catalog.pg_get_userbyid(c.relowner) as "Owner"
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
  WHERE c.relkind IN (''r'','''')
  AND n.nspname <> ''pg_catalog''
  AND n.nspname <> ''information_schema''
  AND n.nspname !~ ''^pg_toast''
  AND pg_catalog.pg_table_is_visible(c.oid)
ORDER BY 1,2;', 
'Show tables view sequences...' ) ;

Mysql use backslash \ to escape signle quote \

42 O\‘Connor Street

Risorse:

plpgsql