Monday, February 14, 2011
Question #1882 : Questions : “openoffice.org” package : Ubuntu
To use Arial font in OpenOffice You need to enable the 'multiverse' repository in Synaptic and then install the msttcorefonts package. That has all the Arial (and variants) and Times New Roman fonts."
Thursday, February 3, 2011
Remove ^M
Sometimes window's guru edited oracle tnsnames.ora file and left there some brilliant artefacts:
(DESCRIPTION =^M
(ADDRESS_LIST =^M
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.1)(PORT = 1521))^M
)^M
(CONNECT_DATA =^M
Remove ^M:
to remove ^M, give the command :
sed -e 's/^M//g' file
first press control-V then control-M
or the same in vi: :%s/control-Vcontrol-M//
this will show correct control-M in sed's command line.
Have a nice day Unix user:)
(DESCRIPTION =^M
(ADDRESS_LIST =^M
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.1)(PORT = 1521))^M
)^M
(CONNECT_DATA =^M
Remove ^M:
to remove ^M, give the command :
sed -e 's/^M//g' file
first press control-V then control-M
or the same in vi: :%s/control-Vcontrol-M//
this will show correct control-M in sed's command line.
Have a nice day Unix user:)
Thursday, January 6, 2011
Simple request to check web server response.
Sometimes I need to get response not only from web client. For example, now I am in Australia and I suppose that avito.ru blocked all networks outside of Russia to avoid indexing by servers abroad. So I need to get return code. The best way, as I think, is to call telnet:
Here is a simple bash script(GET.sh):
#!/bin/bash
echo 'GET / HTTP/1.1';echo 'Host: '$1;echo;echo; sleep 2 ) | telnet $1 $2
How to call it:
#./GET.sh www.avito.ru 80
Trying 81.177.35.167...
Connected to www.avito.ru.
Escape character is '^]'.
HTTP/1.1 403 Forbidden
Server: nginx
Date: Thu, 06 Jan 2011 12:15:03 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx</center>
</body>
</html>
Connection closed by foreign host.
Trying 81.177.35.167...
Connected to www.avito.ru.
Escape character is '^]'.
HTTP/1.1 403 Forbidden
Server: nginx
Date: Thu, 06 Jan 2011 12:15:03 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx</center>
</body>
</html>
Connection closed by foreign host.
Subscribe to:
Posts (Atom)