OpenID for non-SuperUsers

2010-09-07 2 min read Learning Uncategorized

Based on the results of my Unobtrusive <a class="zem_slink" title="OpenID Foundation" rel="homepage" href="http://openid.net">OpenID post, it is quite evident that there is a lot of partial <a class="zem_slink" title="Knowledge" rel="wikipedia" href="http://en.wikipedia.org/wiki/Knowledge">knowledge about OpenID out there. While my knowledge on the subject is far from complete, this post is my attempt to share what I have learned with others.

The target audience for the bulk of this post is people who are capable of adding autodiscovery links to their blog templates, may be able to install a small <a class="zem_slink" title="PHP" rel="homepage" href="http://www.php.net/">PHP script and/or know what a <a class="zem_slink" title="Hypertext Transfer Protocol" rel="wikipedia" href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol">HTTP <a class="zem_slink" title="List of HTTP headers" rel="wikipedia" href="http://en.wikipedia.org/wiki/List_of_HTTP_headers">header is.

Continue reading

when you press f9 'paste' is on , press f9 again and 'paste' is off, and so forth (works in insert-mode and command-mode)

2010-08-02 1 min read Bash Linux

<a class="zem_slink" title="Vim (text editor)" rel="homepage" href="http://www.vim.org/">vim&#8217;s pastetoggle: when you press f9 &#8217;paste&#8217; is on , press f9 again and &#8217;paste&#8217; is off, and so forth (works in <a class="zem_slink" title="Insert key" rel="wikipedia" href="http://en.wikipedia.org/wiki/Insert_key">insert-mode and command-mode) $ nmap :set paste!:set paste? Sets as paste toggle, with visual confirmation of state

* View this command to comment, vote or add to favourites * View all commands by Vilemirth

commandlinefu.com

by David Winterbottom (codeinthehole.com)

Continue reading

Adding a sub-menu in the wordpress admin menu :)

2010-07-29 2 min read Wordpress

For the impatient ones, first the code:
(in wp-admin folder, open the file menu.php) and locate the code:

$submenu[&#8217;edit.php&#8217;][10]  = array( _x(&#8217;Add New&#8217;, &#8217;post&#8217;), &#8217;edit_posts&#8217;, &#8217;post-new.php&#8217; );

and add the below:

$submenu[&#8217;edit.php&#8217;][7]  = array( _x(&#8217;Pending&#8217;, &#8217;post&#8217;), &#8217;edit_posts&#8217;, &#8217;edit.php?post_status=pending&post_type=post&#8217; );

And now the explanation and why do you need this 🙂

Problem:

There is no direct mechanism to access the pending posts in WP admin. I generally post through email and mark them as pending. So, whenever I go to my admin POSTs page, I will look through the list of pending items and post them as and when required. For this, when I am done with changes in one item, I need to either modify the address bar or need to go to posts link and then click the Pending items.

Continue reading

Using tput to save, clear and restore the terminal contents

2010-06-17 1 min read Linux

Using tput to save, clear and restore the terminal contents $ tput smcup; echo &#8221;Doing some things…&#8221;; sleep 2; tput rmcup Very useful for interactive scripts where you would like to return the terminal contents to its original state before the script was run. This would be similar to how vi exits and returns you to your original terminal screen.

Save and clear the terminal contents with:

tput smcup

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

SQuirrel SQL for Graphical interface to Oracle/MySQL and loads of other database -- OSS and free.

2010-06-04 1 min read Linux

<a href="http://blog.amit-agarwal.co.in/category/linux/">Bookmark this category

SQuirrel <a class="zem_slink freebase/en/sql" title="SQL" rel="wikipedia" href="http://en.wikipedia.org/wiki/SQL">SQL for <a class="zem_slink freebase/en/graphical_user_interface" title="Graphical user interface" rel="wikipedia" href="http://en.wikipedia.org/wiki/Graphical_user_interface">Graphical interface to Oracle/MySQL and loads of other <a class="zem_slink freebase/en/database" title="Database" rel="wikipedia" href="http://en.wikipedia.org/wiki/Database">database — <a class="zem_slink freebase/en/open_sound_system" title="Open Sound System" rel="homepage" href="http://www.opensound.com/">OSS and free.

<a class="zem_slink freebase/en/squirrel_sql_client" title="SQuirreL SQL Client" rel="homepage" href="http://www.squirrelsql.org/">SQuirreL SQL Client is a graphical SQL client written in <a class="zem_slink freebase/guid/9202a8c04000641f800000000f8545aa" title="Java (programming language)" rel="homepage" href="http://java.sun.com">Java that will allow you to view the structure of a <a class="zem_slink freebase/en/java_database_connectivity" title="Java Database Connectivity" rel="wikipedia" href="http://en.wikipedia.org/wiki/Java_Database_Connectivity">JDBC compliant database, browse the <a class="zem_slink freebase/en/data" title="Data" rel="wikipedia" href="http://en.wikipedia.org/wiki/Data">data in tables, issue SQL commands etc. The pre-requisites are java 1.5 and 1.6 in the sequence of the <a class="zem_slink freebase/en/installation" title="Installation (computer programs)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Installation_%28computer_programs%29">installer versions! Installers available at: <a href="http://sourceforge.net/projects/squirrel-sql/files/">http://sourceforge.net/projects/squirrel-sql/files/ Home page and installation instructions at: <a href="http://www.squirrelsql.org/#installation">http://www.squirrelsql.org/#installation Have a nice time with the SQuirreL!!<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://blog.amit-agarwal.co.in/2010/04/27/fvwm-look-and-feel-icons-and-themes/">fvwm Look and Feel, icons and themes (amit-agarwal.co.in) <li class="zemanta-article-ul-li"><a href="http://checkedexception.blogspot.com/2010/03/using-ms-sql-from-linux.html">Using MS SQL from Linux (checkedexception.blogspot.com) <li class="zemanta-article-ul-li"><a href="http://briancarper.net/blog/adminer-where-have-you-been-all-my-life">Adminer, where have you been all my life? (briancarper.net) <li class="zemanta-article-ul-li"><a href="http://helpdeskgeek.com/databases/an-introduction-to-oracle-sql-developer-part-v/">An Introduction to Oracle SQL Developer – Part V (helpdeskgeek.com) <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/6c1be63c-1479-4ac2-9707-3e8c8b750585/"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b12.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">

Continue reading

Google\’s RE2 regular expression library

2010-05-30 0 min read Bash
\"Image
Image via CrunchBase

?

<a class="zem_slink freebase/en/google" title="Google" rel="homepage" href="http://google.com">Google has announced the release of its RE2 library under a BSDish license. &#8221;At Google, we use <a class="zem_slink freebase/en/regular_expression" title="Regular expression" rel="wikipedia" href="http://en.wikipedia.org/wiki/Regular_expression">regular expressions as part of the interface to many external and internal systems, including Code Search, <a class="zem_slink freebase/en/sawzall" title="Sawzall (programming language)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Sawzall_%28programming_language%29">Sawzall, and <a class="zem_slink" title="Bigtable" rel="homepage" href="http://labs.google.com/papers/bigtable.html">Bigtable. Those systems process large amounts of <a class="zem_slink freebase/en/data" title="Data" rel="wikipedia" href="http://en.wikipedia.org/wiki/Data">data; exponential <a class="zem_slink freebase/en/runtime" title="Run time (computing)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Run_time_%28computing%29">run time would be a serious problem. On a more practical note, these are <a class="zem_slink freebase/en/thread" title="Thread (computer science)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Thread_%28computer_science%29">multithreaded <a class="zem_slink freebase/en/cplusplus" title="C++" rel="wikipedia" href="http://en.wikipedia.org/wiki/C%2B%2B">C++ programs with fixed-size stacks: the unbounded stack usage in typical regular expression implementations leads to stack overflows and server crashes. To solve both problems, we&#8217;ve built a new regular expression engine, called RE2, which is based on <a class="zem_slink freebase/en/automata_theory" title="Automata theory" rel="wikipedia" href="http://en.wikipedia.org/wiki/Automata_theory">automata theory and guarantees that searches complete in <a class="zem_slink freebase/en/linear_time" title="Linear time" rel="wikipedia" href="http://en.wikipedia.org/wiki/Linear_time">linear time with respect to the size of the input and in a fixed amount of stack space.&#8221; More information can be found on the <a href="http://code.google.com/p/re2/" target="_blank">RE2 project page.<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://glinden.blogspot.com/2010/03/gfs-and-its-evolution.html">GFS and its evolution (glinden.blogspot.com) <li class="zemanta-article-ul-li"><a href="http://research.swtch.com/2010/03/regular-expression-article-3.html">Regular Expression Article #3 (research.swtch.com) <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/456fa268-f416-4aec-ae05-4d1a9c9c2712/"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b65.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">

Continue reading
Older posts Newer posts