Your XML friend XPATH command line xmllint

March 5th, 2011 mysurface

Do you have a large XML to analyze? to query for info? Maybe you are using a XML viewer, a string search for that. But if your XML have a proper structure and you have understand enough for the structure, you may want to consider to use XPATH. [Q] What is XPATH? XPath is a [...]

Posted in Text Manipulation, xmllint | Hits: 170748 | 76 Comments »

BTTB: looping for shell script under embedded linux

November 17th, 2010 mysurface

You may already realized Linux happened to appear at many places, such as web server, storage server, desktop, kiosk machine, mobile devices. Yes, more and more devices running embedded Linux. Yeah, Android is a modified version of Linux kernel too! Scarcity is still an issue, embedded Linux can be very different to Linux that hosted [...]

Posted in cut, for, if, seq, Text Manipulation | Hits: 173365 | 11 Comments »

Gnu Global, the programmer’s friend

May 25th, 2010 mysurface

GNU Global (gtags) is a source code tagging system similar to ctags but more than that. I always use vim as my c/c++ source code editor, and using ctags to helps me travels from function call to function definition. I do write a post indicates how does ctags works with vim. The reason I shifted [...]

Posted in Developer, global, gtags, gvim, vi, vim | Hits: 245686 | 7 Comments »

vim: Jump to the last known cursor when file open

May 21st, 2010 mysurface

When dealing with source codes by using vim, I usually open and close the files repeatably. It will be good if vim can automatically jump me to the last known position when I reopen a file. To have vim do so, you must have viminfo, which usually exist by default. Add in the setting into [...]

Posted in gvim | Hits: 168449 | 3 Comments »

sometimes, grep alone is enough to do the task

April 14th, 2009 mysurface

One thing that makes UNIXes command line so powerful is because of pipelines. Pipelines is a set of processes chained by their standard streams, so that the output of each process (stdout) feeds directly as input (stdin) of the next one. Simple words, pipelines pass the outcomes of a particular command as input to another [...]

Posted in grep, Text Manipulation | Hits: 195744 | 2 Comments »

Syslog: Sending log from remote servers to syslog daemon

July 23rd, 2008 mysurface

syslog is a standard for logging service in Linux, it usually run as daemon like syslogd or rsyslogd. Syslog daemon will be forward and store logs in /var/log directory, you may configure it to store at separate location if you want. (we will look into it later). And there is a major file that store [...]

Posted in Admin, logger, nc, rsyslogd, syslogd, tail | Hits: 206480 | 4 Comments »

Top Ten Processes Watcher

July 13th, 2008 mysurface

top command provides a dynamic real-time view of a running system. It can display system summary information as well as a list of tasks currently being managed by the Linux kernel. But if you want get something more specific, you must play some tricks on it. For example, I want a clean view of top [...]

Posted in head, tail, top, watch | Hits: 127104 | 4 Comments »

vim taglist plugin for developers

June 1st, 2008 mysurface

Taglist plugin provides vim to support source code browsing capabilities at sidebar. When you enable taglist, sidebar windows will be listing functions, classes, structures, enumerations, macro definitions and other parts of a source code file as shortcut. Shortcut will jump you to the particular portion of codes within a single page. The taglist may have [...]

Posted in vi, vim | Hits: 63805 | 4 Comments »

Discover user guides and manuals within your linux system

May 9th, 2008 mysurface

Do you realized that we can obtain a lots of user manuals and guideline documents from our system? There is a folder /usr/share/doc, you may find some useful docs already preinstalled by your distro. Those docs are in pdf or html format. I manage to find user manuals for valgrind, ipython, systemtap, boost etc. I [...]

Posted in Common, echo, find | Hits: 54276 | 2 Comments »

vim with ctags for multi-level directory hierarchy

April 24th, 2008 mysurface

I have wrote a post regarding vim with ctags, introduces how ctags allows you to travel across source codes, searching for function, objects, variables definition. To jump from function call to function definition, I usually do ctrl+] in vim. It should works fine as it should have already configured by default from most of the [...]

Posted in ctags, Developer, Text Manipulation, vi, vim | Hits: 68303 | 8 Comments »