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:)

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.

Friday, December 31, 2010

% in crontab

if you would like to use construction like this `date '+%a'` in crontab, you need to backslash the % sign.

1 1 * * * touch /tmp/`date '+\%a'`.touch

It works in Linux but in Solaris does not. It creates file names where is a slash before a week name.

In Solaris the ' sign should not be used.

1 1 * * * touch /tmp/`date +\%a`.touch

W: GPG error: http://ppa.launchpad.net maverick Release: The following signatures couldn't be verified because the public key is not available:

After some paranoiac permission setting in my home folder I wanted to update repository and received error:
root@zzz:~# aptitude update

Hit http://ru.archive.ubuntu.com maverick-updates/multiverse amd64 Packages
Fetched 2,952B in 17s (167B/s)
W: GPG error: http://ppa.launchpad.net maverick Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0EE1BF5F3C8E2A7F

Monday, December 27, 2010

kvm, failed to start network default in virsh

xxx@yyy:~$ virsh net-start default
error: Failed to start network default
error: internal error '/sbin/iptables --table filter --delete INPUT --in-interface virbr0 --protocol udp --destination-port 69 --jump ACCEPT' exited with non-zero status 1 and signal 0: iptables: Bad rule (does a matching rule exist in that chain?).

in messages:
Dec 27 23:15:39 yyy libvirtd: 23:15:39.512: warning : networkAddIptablesRules:850 : Could not add rule to fixup DHCP response checksums on network 'default'.
Dec 27 23:15:39 yyy libvirtd: 23:15:39.512: warning : networkAddIptablesRules:851 : May need to update iptables package & kernel to support CHECKSUM rule.

and there is no virbr0 interface.

Tuesday, December 21, 2010

Virtualization, KVM hypervisor

I started to explore KVM as full virtualization solution for Linux. The mail idea to sturdy different Oracle option on different platforms and emulate failure events to work out backup and recovery. Configuration and tuning is important part as well. So, I chosed KVM under KUbuntu 10.10. and started different installations. As I expected later there is a problem to communicate two virtual machines to each other. I asked google but didn't get definite answer. Accidentally I've found a solution lies in the plane of IP filters.

Sunday, November 14, 2010

Wireless device for HP NoteBooks users who owns ProBook5420s, config

I have HP NoteBooks ProBook5420s. There is a little problem with driver in KUbuntu.

lspci|grep "Network controller:"
44:00.0 Network controller: RaLink RT3090 Wireless 802.11n 1T/1R PCIe

In spite of that the controller is RT3090 it works with rt3390sta driver.
lsmod |grep rt
rt3390sta 1153989 1

My attemts to enable wireless networking with rt3090sta driver were unsaccessfull.

Ram diska creation

Ram diska creation. It is very usefull if you like wardriving:)

# mkdir /tmp/ramdisk; chmod 777 /tmp/ramdisk

# mount -t tmpfs -o size=256M tmpfs /tmp/ramdisk/
or
# mount -t tmpfs tmpfs /tmp/ramdisk -o size=1G,nr_inodes=200k,mode=01777

Friday, October 1, 2010

ZFS Replication. Useful links

ZFS Replication
link
Understanding ZFS: Replication, Archive and Backup
link

Friday, September 24, 2010

bash config to use arrows to scroll history

Insert into .bashrc to turn on using arrows up/down to search in bash history.
 
bind '"\e[A"':history-search-backward
bind '"\e[B"':history-search-forward
shopt -s cdspell
shopt -s cmdhist
shopt -s histappend
export HISTCONTROL="ignoredups" 
 
very useful ;-) 

Wednesday, November 18, 2009

Network backup with NC and TAR

Backup to another host through NetCat command. It can be useful if there is no space for local backup or just for file transfer between hosts.

nc -l -p 8081 >/tmp/nc.dump #just listen on port 8081 and rewrite to stdout

then send something in raw to remote host:

tar c /opt/music | nc -w 2 HOST 8081
cat /tmp/mp3.file | nc -w 2 HOST 8081

-w 2 - wait silence for 2 seconds at stdin of NC and exit
.