Friday, May 3, 2013

Here I come - RDO, an OpenStack by Red Hat

I have lately been encouraged to try out RDO as an early adopter and today, I started to set up my sandbox environment. I found one HP Business Machine, lying around in my lab, which I used to hack Asterisk on CentOS.

The Machine

- Dell PowerEdge R410 (http://www.dell.com/downloads/emea/products/R410_spec_sheet.pdf)
- 32GiB RAM
- 500 GiB HDD (RPM 7.2K)
- 2 x Gigabit NIC (I will and I must add one more later, I don't have a spare Gigabit NIC handy)

The Storage

- Synology DS213 (iSCSI/NFS)

The OS

- CentOS 6.4 (64-bit)

The Objective

- Try to tune up the Hypervisor Footprint as small as possible. Smaller than an ESXi? :|
- Apple to Apple or Apple to Orange Comparison against vmware. Hope that is fair enough. Shame I am more familiar (and trained and almost almost certified) with vmware than KVM. Sigh..., Sorry, the corporate I used to work does not honor KVM yet. And currently, my projects are being delivered on ESXi Platform which I am freely licensed to use.

The Show

The Show has started.
Hacking in progress...

Cheers.
Will

Saturday, August 7, 2010

How to remove Single Quote

I'd like to achieve the following :

Input Text :

'AAAAA','BBBBB','123456'
'CCCCCCCC','OKOKOKOKOK','2234222'
'FFF','ASDFASDF','123'


Expected output :

Remove single quotes.

AAAAA,BBBBB,123456
CCCCCCCC,OKOKOKOKOK,2234222
FFF,ASDFASDF,123



Here is the answer :


sed "s/'//g" input.txt >output.txt


Or if you have GNU sed

sed -i "s/'//g" input.txt

Cheers.

tail, grep, and logger (aka the output is being buffered!)

QUESTION :

When I do the following in bash shell, it works well.
[root@lwlx root]# tail -f -n 1 /u/email.log | logger

But, when I integrate the grep command, it stops working and not producing any output.
[root@lwlx root]# tail -f -n 1 /u/email.log | grep Blocked | logger

ANSWER :

The output of (tail -f) is being buffered. The above won't work. Please see the workaround as follow.

To release the buffer whenever there are new lines in the log if you suspect that the output is being buffered :

tail -f -n 1 /u/email.log | perl -ne 'BEGIN{$|=1}print if /blocked/' | logger

What if I want two or more filters such as "Blocked" or "Denied" or "Blacklisted":

tail -f -n 1 /u/email.log | perl -ne 'BEGIN{$|=1}print if /Blocked|Denied|Blacklisted/'

Cheers.

Friday, August 6, 2010

WinExe

Guess what!

When you need to execute commands in one or more remote MS Windows computers from local "MS Windows computer", yes, that's right, we got PsExec as a CLI solution.

What if you need to execute commands in one or more remote MS Windows computers from local "Linux or Unix" computer? Well, never fear, John! We got a tool called WinExe (an PsExec equivalent in Linux/Unix Platform).

http://sourceforge.net/projects/winexe/

PsExec

When you need to execute commands in one or more remote MS Windows computers from local MS Windows computer, PsExec is the CLI solution.

http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx