lex program to display line nos with string hello

%{ #include #include int ln=1; %} %% “\n” {} .*hello.* {fprintf(yyout,”\n%d:%s”,ln++,yytext);} .* {ln++;} %% main() { yyin=fopen(“try1.txt”,”r”); yyout=fopen(“try2.txt”,”w”); yylex(); return 0; } int yywrap() { } Sample output try1.txt hai hello world test file language processor hello try2.txt 2:hello world 5:hello

Categories Lex

A vdsm hook ( macbind) to attach given mac address to a different bridge or openvswitch bridge .

It seemed to be a requirement to attach a VM nic to a different bridge than the currently defined bridge. Also, ovirt is not compatible with openvswitch to pick those bridges and attach a VM nic. I have written a vdsm hook which will help you to achieve this. The functionality has been pushed to …

Read more

Smooth upgrade from fedora 18 to fedora 19 !

I always failed to do a streaming update from earlier versions of fedora, but not this time. That said, I had fedora 18 version installed in my system and planned to upgrade to latest verison of fedora 19 named “Fedora release 19 (Schrödinger’s Cat) ” 🙂 Without much intro, let me share the steps I …

Read more

virt-manager hangs on ‘searching for available hypervisors’ window and not able to cancel it ?

Ah… I would say it ruined my day 🙂 I updated my fedora system from fedora 18 to 19 as mentioned in my previous post ( https://www.humblec.com/smooth-upgrade-from-fedora-18-to-fedora-19/ ) and was trying to play with VMs via virt-manager. How-ever virt-manager showed a window with title ‘Searching for available hypervisors’ and keep showing it indefinitely. I waited …

Read more

KVM guest reports errors – How to troubleshoot or track it ? systemtap ?

I have seen reports saying that – under some scenarios, the KVM guest system reports I/O errors in its ‘dmesg’ against virtio block devices and also, some times it cause the filesystems inside the guest to go ‘READONLY’ mode. Tracking such issues are a bit difficult and its a pain. I believe we should make …

Read more

Complete guide to extend guest disk from backend, LVM and Filesystem inside KVM guest.

First of all this is my guest system layout. There is a disk called ‘vda’ where my guest filesystem resides. IN GUEST Two guest logical volumes ‘fedora-swap’ and ‘fedora-root’ are created inside guest physical volume vda. Discard ‘fedora-swap’ for now. The physical volume layout is shown below: Now guest image is on a file in …

Read more

virtual-storage-console-for-rhev ?? 20 G thick allocated 20 VMs creation in 3min 18 seconds ??

A new feature framework have been added to RHEV 3.2 which allows other vendors to add/integrate new features into RHEV :   New Third-Party Plug-ins A key feature in Red Hat Enterprise Virtualization 3.2 is the availability of a new third-party plug-in framework. Developed through community and vendor collaboration and contributions, the plug-in framework enables …

Read more

Red Hat summit 2013 && RHEV 3.2 release..

  Red Hat launched next stable version of RHEV (3.2 ) in Red Hat Summit 2013 event and here is more details about it.   “RALEIGH, N.C. and BOSTON – RED HAT SUMMIT 2013 – June 12, 2013 – Red Hat, Inc. (NYSE: RHT), the world’s leading provider of open source solutions, today announced the …

Read more