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[’edit.php’][10]  = array( _x(’Add New’, ’post’), ’edit_posts’, ’post-new.php’ );

and add the below:

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

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

colors in bash -- script to display all the possible colors.

2010-06-06 3 min read Bash Fedora Linux

If you wanted to have colors in the bash output (including the colors in PS1-4), don’t you keep wondering how the color code would look on the terminal. So, I wrote this small script to show the complete color codes. This is how the output would look:

\"Bash

And here is the script:

  <td>
    <div class="text codecolorer">
      #!/bin/bash -<br /> #===============================================================================<br /> #<br /> # &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FILE: &nbsp;colors.sh<br /> #<br /> # &nbsp; &nbsp; &nbsp; &nbsp; USAGE: &nbsp;./colors.sh<br /> #<br /> # &nbsp; DESCRIPTION: &nbsp;Bash colors<br /> #<br /> # &nbsp; &nbsp; &nbsp; OPTIONS: &nbsp;---<br /> # &nbsp;REQUIREMENTS: &nbsp;---<br /> # &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BUGS: &nbsp;---<br /> # &nbsp; &nbsp; &nbsp; &nbsp; NOTES: &nbsp;---<br /> # &nbsp; &nbsp; &nbsp; &nbsp;AUTHOR: &nbsp;Amit Agarwal (AKA), amit.agarwal@amit-agarwal.co.in<br /> # &nbsp; &nbsp; &nbsp; COMPANY: &nbsp;Individual<br /> # &nbsp; &nbsp; &nbsp; VERSION: &nbsp;1.0<br /> # &nbsp; &nbsp; &nbsp; CREATED: &nbsp;09/21/2009 06:12:07 PM IST<br /> # &nbsp; &nbsp; &nbsp;REVISION: &nbsp;---<br /> #===============================================================================<br /> <br /> for c in `seq 0 255`;<br /> do<br /> t=5;<br /> [[ $c -lt 108 ]]&&t=0;<br /> for i in `seq $t 5`;<br /> do<br /> #Display the codes also for easier lookup in terminal<br /> <!--loginview start-->echo $i;${c}<!--loginview end--><br /> echo -e "<a class="zem_slink" title="Path (computing)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Path_%28computing%29">\\</a>\e[0;48;$i;${c}m|| $i:$c `seq -s+0 $(($COLUMNS/2))|tr -d \'[0-9]\'`\\e[0m";<br /> done;<br /> done<br /> <br /> # setup_colors - Adds colors to array CC for global use<br /> # 30 - Black, 31 - Red, 32 - Green, 33 - Yellow, 34 - Blue,<br /> # 35 - Magenta, 36 - Blue/Green, 37 - White,<br /> # 30/42 - Black on Green \'30\\;42\'<br /> <!--loginview start-->function setup_colors(){<br /> declare -a CC;<br /> for i in `seq 0 7`;<br /> do<br /> ii=$(($i+7));<br /> CC[$i]="\\033[1;3${i}m";<br /> CC[$ii]="\\033[0;3${i}m";<br /> done;<br /> CC[15]="\\033[30;42m";<br /> R=$\'\\033[0;00m\';<br /> X=$\'\\033[1;37m\';<br /> export R X;<br /> }<br /> function display_colors(){<br /> for i in $(seq 0 $((${#CC[@]} - 1))); do echo -e "${CC[$i]}[$i]\\n$R"; done<br /> }
    </div>
  </td>
</tr>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
\"Reblog
Enhanced by Zemanta

10 Wordpress Traffic Builder Plugins That Work

2010-05-26 2 min read Uncategorized

This article covers several useful <a class="zem_slink freebase/en/wordpress" title="WordPress" rel="homepage" href="http://wordpress.org">WordPress traffic builder <a class="zem_slink freebase/en/plugin" title="Plug-in (computing)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Plug-in_%28computing%29">plugins. The most important aspect of owning a <a class="zem_slink freebase/en/website" title="Website" rel="wikipedia" href="http://en.wikipedia.org/wiki/Website">website is the amount of visitors you receive. I’m referring to your website’s traffic, which can be very hard to generate in the beginning stages. It’s essential that you <a href="http://www.makeuseof.com/tag/6-websites-to-track-a-websites-traffic/">track your website’s traffic to see where you’re at.

Continue reading

Startup animation and theme for Fedora 12 onwards.

2010-05-20 1 min read Fedora Learning Linux

Since the release of <a class="zem_slink freebase/en/fedora" title="Fedora" rel="homepage" href="http://fedoraproject.org/">Fedora 12, fedora is using plymouth. Plymouth kicks in just after grub and before the Xserver starts.

Description:

Plymouth provides an attractive graphical <a class="zem_slink freebase/en/bootsplash" title="Bootsplash" rel="wikipedia" href="http://en.wikipedia.org/wiki/Bootsplash">boot animation in
place of the <a class="zem_slink freebase/en/text_messaging" title="Text messaging" rel="wikipedia" href="http://en.wikipedia.org/wiki/Text_messaging">text messages that normally get shown.  Text
messages are instead redirected to a <a class="zem_slink freebase/en/data_logger" title="Data logger" rel="wikipedia" href="http://en.wikipedia.org/wiki/Data_logger">log file for viewing
after boot.

Continue reading

Script to download all the related videos from youtube with youtube-dl

2010-05-17 2 min read Fedora Linux Uncategorized

Lets cut the long discussion <a class="zem_slink freebase/en/short_subject" title="Short film" rel="wikipedia" href="http://en.wikipedia.org/wiki/Short_film">short and directly give you the script. The script is combination of all the posts that I did in the past about youtube <a class="zem_slink freebase/en/uploading_and_downloading" title="Uploading and downloading" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uploading_and_downloading">downloads. You need to copy all the <a class="zem_slink freebase/en/uniform_resource_locator" title="Uniform Resource Locator" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator">URL&#8217;s in a file called &#8221;~/youtube.urls&#8221; which you want to be downloaded. Or if you need to donwload the related videos, then save the html of the page and give it as the first argument for the script. So, here&#8217;s the scrit:

Continue reading

Downloading all related videos from youtube with youtube-dl

2010-05-16 2 min read Fedora Learning Linux Uncategorized

How many time did you want to see all the videos (related) to the one you were watching on youtube but decided otherwise as the downloaded was not fast enough. Or has it happened to you that you wanted to <a class="zem_slink freebase/en/uploading_and_downloading" title="Uploading and downloading" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uploading_and_downloading">download all the related videos, in either case you can use the youtube-dl utility I blogged about some times back. First you need to get all the <a class="zem_slink freebase/en/uniform_resource_locator" title="Uniform Resource Locator" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator">URL&#8217;s in a <a class="zem_slink freebase/en/text_file" title="Text file" rel="wikipedia" href="http://en.wikipedia.org/wiki/Text_file">text file, and the simplest way to do this is :

Continue reading

Firefox 4.0 mockups for LInux/Windows and Mac

2010-05-11 1 min read Firefox
https://wiki.mozilla.org/Firefox/Projects/3.7_and_4.0_Theme_and_UI_Revamp
The link above will take you to the Mozilla wiki for the UI and theme mockups for the Firefox 4.0 release. Quite interesting but what I did not like is that the Linux mockup looks more like chrome. Not sure why mozilla would want to do that 🙂
  • Tabs-on-top: Defaut tabs to top of UI.
  • Hiding the Menu Bar: Hide the menu bar and add Page and Tools buttons.

The post is brought to you by <a href="http://fedorahosted.org/lekhonee">lekhonee-gnome v0.9<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.engadget.com/2010/05/10/mozilla-shares-tentative-vision-for-firefox-4/">Mozilla shares tentative vision for Firefox 4 (engadget.com) <li class="zemanta-article-ul-li"><a href="http://news.slashdot.org/story/10/05/11/1222211/Mozilla-Reveals-Firefox-4-Plans?from=rss">Mozilla Reveals Firefox 4 Plans (news.slashdot.org) <li class="zemanta-article-ul-li"><a href="http://www.techmeme.com/100511/p7">Mozilla&#8217;s Plans for Firefox 4: Faster, Sleeker Interface & Better Privacy Controls (Frederic Lardinois/ReadWriteWeb) (techmeme.com) <li class="zemanta-article-ul-li"><a href="http://www.techmeme.com/100510/p67">Firefox 4: fast, powerful, and empowering (Mike Beltzner/beltzner) (techmeme.com) <li class="zemanta-article-ul-li"><a href="http://blogs.chron.com/techblog/archives/2010/05/firefox_4_coming_soon_beta_as_early_as_june_1.html">Firefox 4 coming soon; beta as early as June (blogs.chron.com) <li class="zemanta-article-ul-li"><a href="http://r.zemanta.com/?u=http%3A//www.cbsnews.com/8301-501465_162-20004666-501465.html&a=17869870&rid=73c491d4-0778-448a-ba05-b7758f91e1c9&e=e813a95fa56524108572b5f7c80e8075">An Early Look at the Next Version of Firefox (cbsnews.com) <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/73c491d4-0778-448a-ba05-b7758f91e1c9/"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b85.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">

Continue reading
Older posts