Saturday, July 4, 2009

Blogger Template modification for "Read More..."

Some templates for Blogger do not have "Read More..." feature by default, but it is not very difficult to add it the way you like. The idea is to display post differently when it is in the home page or in any of other multi-post pages as a page of selection by a tag, for example, and when it is the page of the post itself. That condition can be checked directly with the page attribute data:blog.pageType: it is equal to "item" when the page shows the post itself.
  1. Backup the original template for the case: Blogger Layout/Edit HTML tap, Download Full Template;

  2. In the Blogger Layout/HTML tap make "Expand Widget Templates" checked;

  3. Find the structure showing a post, it looks like this:
    <div class='post-header-line-1'/>

    <div class='post-body'>
    <p><data:post.body/></p>
    <div style='clear: both;'/>
    </div>

    The line responsible for showing a post is <p><data:post.body/></p>

  4. The original unconditional structure should be replaced with the following one:
    <div class='post-header-line-1'/>

    <b:if cond='data:blog.pageType == "item"'>
    <style>.prepost{display:none;}</style>
    <style>.fullpost{display:inline;}</style>
    <div class='post-body'>
    <data:post.body/>
    <div style='clear: both;'/>
    </div>
    <b:else/>
    <style>.prepost{display:inline;}</style>
    <style>.fullpost{display:none;}</style>
    <div class='post-body'>
    <data:post.body/>
    <a expr:href='data:post.url'> Read more...</a>
    <div style='clear: both;'/>
    </div><br/>
    </b:if>

    This is pretty much the same as it is suggested in the Blogger Help on "How can I create expandable post summaries?" The difference is that I wanted to have three sections in a post instead of only two, so I added a "prepost" section which would be showed only in the pages with post lists, and not on the post page.

  5. In Setting/Formatting tag modify "Post Template" to:

    This part will appear unconditionally.
    <span class="prepost">This part will appear only in the list of posts.</span>
    <span class="fullpost">This part will appear only in the post itself.</span>

    The "prepost" section is useful in cases when post appearance in the list should be different to the "fullpost" section as it is done, for example, for "Big Green Egg BBQ Ribs - the path to success".

  6. Do not forget to save all the changes!
Read more...

Sunday, June 28, 2009

Change owner and delete a system file in Windows Vista

Sometimes it is necessary to delete a file but impossible even with Administrator privileges because the file is owned by system itself. It is still can be done by 1) changing owner of the file and 2) granting full control over the file to the new owner.

For example, in order to delete C:\pagefile.sys (Pagefile should be already disabled in Control Panel\System\Advanced System Settings\Advanced\Performance Setting\Advanced\Change\No Paging File) start CMD elevated (Shft+Ctrl+Enter) then:

>takeown /f c:\pagefile.sys
>cacls c:\pagefile.sys /G username:F

Replace [username] with a real name of the user which took ownership of the file. After that the file should become deletable.
Read more...

Tuesday, June 23, 2009

Recovering from Lost Linux Root Password

Root password can be changed without entering the old forgotten one. Just reboot the computer from LiveCD, then in command prompt mount the root partition on /mnt and make it the current root:


$ mount /dev/hda1 /mnt
$ chroot /mnt /bin/sh

Then

$ passwd

and enter a new password you think you will not forget :)
Read more...

Tuesday, June 2, 2009

Big Green Egg BBQ Pork Steak - The Quick аnd The Easy

Pork steak is not the top kind of a steak dish, but still is pretty delicious, quick and easy to cook.
Pork steak is not the top kind of a steak dish, but still is pretty delicious, quick and easy to cook.

  1. Salt and season the pork chops. If you like, marinade the pork in 1% vinegar solution (roughly 1 part of 5% table vinegar + 4 parts of water) interlaced with onion rounds, or any other marinade of your preference, but it is not really necessary.


  2. For this dish high cooking temperature is required. For the best result first it is necessary to clean up BGE from ash and small pieces of charcoal which could block free air flow through the area of burning, load only relatively big pieces of charcoal, then start Big Green Egg.


  3. Keep bottom vent about 3" open and top one half open to support strong burning. Let temperature reach up to about 600F.


  4. If desired, smoke chips soaked in water in advance can be thrown right over charcoal. This addition can drop temperature significantly down, so be careful not to over cool the BGE, add small quantity of the chips, let temperature get back to the high level again... or just don't add the chips. Adjust air vents to the position of stable temperature (low vent with 2" opening, top one with big circular cover closed and small holes all open). Put pork chunks on the BBQ grid and close the BGE cover. I have the medium size BGE, and there is not enough room for all 8 pork steaks I had that time, so I divided them into two batch of 4 steaks each.

  5. Depending on temperature it can take just a few minutes to have the pork done, so do not leave the BGE unattended. You can use a thermometer for better control how the cooking is going on, or simply check the meat every 1-2 minutes. When one side is roasted, flip steaks on the other side. I like steaks well done, so when there is no blood leak from a small cut, I take them out on a plate.

  6. Here is the first batch of steaks - and that was The Quick.

  7. Load the second batch and repeat the step 5 - that will be The Easy.

  8. Enjoy!


Read more...

Monday, June 1, 2009

Add GIMP script


To add a new script file to GIMP (GNU Image Manipulation Program) just copy it into C:\Program Files\GIMP-2.0\share\gimp\2.0\scripts directory and select the menu Filters/Script-Fu/Refresh Scripts. The new script will appear under the menu Script-Fu/MyScript. Read more...