Browser or User agent identification with php.

2010-06-09 1 min read Linux

<a href="http://apptools.com/phptools/browser/source.php">Link

This is a link to very nice code to identify the browser used by the user. I have put a test program with this <a href="http://amit-agarwal.co.in/find_browser.php">here.<a class="performancingtags" href="http://technorati.com/tag/browser" rel="tag">

How To Run Subscriber-Only Competitions on Your Blog

2010-06-08 0 min read Linux
\"I\'m
Image by catspyjamasnz via Flickr

A Guest Post by David Cleland from TotalApps.

In 2006 I proudly started my first blog, DigMo! It was <a class="zem_slink freebase/guid/9202a8c04000641f800000000003ac3a" title="Technology" rel="wikinvest" href="http://www.wikinvest.com/industry/Technology">technology, it was creativity, it was music and it was <a class="zem_slink freebase/guid/9202a8c04000641f80000000000141ab" title="Education" rel="wikipedia" href="http://en.wikipedia.org/wiki/Education">education. Despite it being a bit of blog soup I was pleased at how quick the site grew but within a few years it reached a critical point beyond which I really couldn’t get the traffic to grow. The site was frankly far too general to appeal to a specific community.

Continue reading

Determine what process is listening on a port on Solaris, without lsof

2010-06-08 0 min read Linux Solaris
\"Desktop
Image by Metsuke iLife via Flickr

$ for x in `ptree | <a class="zem_slink freebase/en/awk" title="AWK" rel="homepage" href="http://cm.bell-labs.com/cm/cs/awkbook/index.html">awk '{print $1}&#8217;`; do pfiles $x | <a class="zem_slink freebase/en/grep" title="Grep" rel="wikipedia" href="http://en.wikipedia.org/wiki/Grep">grep ${PORT} > /dev/null 2>&1; if [ x&#8221;$?&#8221; == &#8221;x0&#8221; ]; then ps -ef | grep $x | grep -v grep; fi; done 2> /dev/null

Continue reading

The best in command line xml: XMLStarlet

2010-06-08 1 min read Linux

<a href="http://bashcurescancer.com/the-best-in-command-line-xml-xmlstarlet.html">Quite some time ago I wrote about using xsltproc to process xml on the command line. Thank fully someone pointed out XMLStarlet.? I now use XMLStarlet almost every day.? I work with a variety of REST based API&#8217;s gather information. XMLStartlet along with a simple for loop or xargs gives …

If you are on fedora then you can use xmlstarlet in the following way. First install the package:

Continue reading

Verify all the paths in the PATH directory

2010-06-08 1 min read Bash Learning Linux

Here is the command to test that all the directories in your path actually exist.

(<a class="zem_slink freebase/en/internal_field_separator" title="Internal field separator" rel="wikipedia" href="http://en.wikipedia.org/wiki/Internal_field_separator">IFS=:;for p in $PATH; do test -d $p || echo $p; done)

And the explanation :

Set the IFS to &#8221;:&#8221;

now we loop through the PATH variable

and test all the directories with &#8221;test -d&#8221;

Here is another version without IFS:

for i in ${PATH//:/ };do test  -d $i || echo $i;done

Continue reading

bash completion not working on Fedora

2010-06-06 1 min read Bash Fedora Linux

I had bash completion installed and after that I had made huge changes to my bashrc and also installed bashstyle. After this the bash-completion stopped working.

I had to spend a lot of time to figure out that the easiest solution was to source the bash-completion again in the end. 🙂

. /etc/bash_completion

Play media files in fedora.

2010-06-06 1 min read Linux

Found <a href="http://fedoraforum.org/forum/showthread.php?t=100206">here .<div class="smallfont">

Media (DVD, web content, video & audio) playback in Fedora

<hr style="color: #d1d1e1; background-color: #d1d1e1;" size="1" />

Note: This howto has been transferred to my blog here. (Instructions for Fedora 7+ can be found here)

Hello,
There have been many complaints about media not working in Fedora – MP3s, DVDs, etc. So, I decided to make this guide to help out – By installing a few packages, you can get the codecs for these media or media formats, and solve the problem.

Continue reading
Older posts Newer posts