Adding Thumbnails To WordPress Posts

Now this may not work for all wordpress skins, but it will for the majority of the magazine/blog types like arthemia and convergence.

First, add a file to the “Media” section of your WordPress admin tools  by selecting Add File (or some sort of variation of that depending on the theme you have used) , select Upload file and find the picture you want to use as a thumbnail on your computer.  Once The file is uploaded it should look like this:

addpicture to wordpress

Note the highlighted area, this will be your picture’s path. Copy that line starting from wp-content for later use.

Next, go to the post we would like to attach the thumbnail to in the posts section of the dashboard. If you scroll further down the edit page of your post there should be a section for a custom field. Create a new custom field by clicking on the text box below name. For name input “Image” and for Value input our path for the image, in this case wp-content/uploads/2010/01/arthemia-screenshot10.jpg.

NOTE: The ‘I’ in Image, must be capitalized!

Adding A Custom Field
Adding A Custom Field

Now click Add custom field and we’re done, you should see your thumbnail on the blogroll.

Check Your Mail Server Security

This guide will teach you how to make sure that your SMTP mail server is not a relay server.

An open relay server allows people to use your mail server to deliver spam.

If you have an email server on Ubuntu or other Debian based operating system and you are setting it up using postfix and courier then by default they are not going to be open relay servers. There is a very simple way of testing. The mail-abuse.org offers an automated test suite. The way you run this is by logging into your server, this can be done through ssh.

From your mail server run:

telnet relay-test.mail-abuse.org

This will attempt to connect back to your machine and run a series of mail relaying tests against it.

Upon completion you should recieve the following message:

System appeared to reject relay attempts

If you are inadvertently running as a relay consult your mail server documentation for tips on how to prevent it.

The Protein Shake Cottage Cheese Diet

What is the diet’s objective?

  • Burn fat fast without losing muscle
  • Give your body few enough calories that it will need to feed off its own fat stores, but eat enough protein to keep your nitrogen balance highly positive so that your body does not consume its muscles (to any significant degree)

Who is this diet for?

  • This diet was developed for people who are looking to lose a little body fat (drop from 16% to 13%).

How long does the diet last?

  • The diet should be maintained for 7 to 14 days

What foods are part of the diet?

Obviously there is more to this thing than JUST protein shakes and cottage cheese

Food List

  • Protein Shakes (Whey powder + Milk or Water)
  • Cottage Cheese – 1% or 2% MF
  • Eggs – Fried (in oil or low fat margarine) or hard-boiled
  • Tuna (no mayo though – yogurt/tziki/non-fat sour cream)
  • Yogurt (low or non fat)
  • Apples, bananas, orages, grapefruit, etc – only in the morning or well in advance of bed
  • Vegetables (lettuce, tomatoes, peppers, carrots etc – no overly high fat veggies like avocadoes)
  • Water – lots! But at least 1 hour before easting or 2 hours after as it slows digestion
  • Milk (white 1% or skim, chocolate milk is allowed after a workout or run)
  • Coffee – no cream or sugar, only milk (don’t add coffee to your diet, but don’t feel like you have to give it up)
  • Beans (kidney/black/lima/chick peas ect.)

What level of exercise is required by the diet?

  • Obviously, the more the better
  • The purpose of the exercise is to assist in burning more calories than you consume
    • This can be achieved through diet alone, but if you cut your calorie intake too significantly, your body will go into “starvation mode” and you wont be able to lose weight
  • Exercise with weights (or pushups/chinups) 3-7 times a week
  • Jog/Bike/Walk (light cardio) 2 – 4 times a week

Is this diet healthy?

  • Not really, it’s pretty hard on your system, but it lasts for such a short time (7 – 15 days) that it’s not an issue

Putting it together:

Stick to these pointers and you’ll be set

  • You don’t need to focus on cutting calories too hard – that will happen on its own
  • You cannot eat carbs anytime close to going to bed (within 3.5 hours of bed time)
  • Try to fill up (not stuff yourself, just get to a point where you are not hungry) on high protein, low fat foods – avoids carbs (especially those from sugar) at all times other than breakfast (eat oatmeal at breakfast)
  • Going to bed starving is the worst! If you are hungry at bed time (to the point where it is going to make it tough to fall asleep) eat an egg and some cottage cheese – both of these foods contain lots of slow release protein that will feed your muscles through the night.
  • Protein is the best, carbs are MUCH worse than fat – stick to high protein, medium fat, low carbs
  • Remember you are creating a calorie deficit while preventing your body form going into starvation mode

Adding Ads to arthemia theme

This guide explains how to put your ads into the arthemia wordpress theme. By default, arthemia has 2 places for ads, the 468×60 pixel ad in the top right, and the 300×250 pixel ad a bit further down on the right side. Both of these sizes are common to Google AdSense.

Adding the 468×60 ad:

  • Head into your WordPress admin Dashboard
  • Click Appearance
  • Select Header (header.php) from the list on the right
  • Find the line of code (about half way down) that reads:
    • <img src=”<?php echo get_option(‘home’); ?>/wp-content/themes/arthemia/images/banners/wide.jpg” alt=”” width=”468px” height=”60px”  />
  • Just replace the entire thing with your ad code (make sure that your code is for a 468×60 pixel ad)
  • Scroll to the bottom of the page and click Update File

Adding the 300×250 ad:

  • Head into your WordPress admin Dashboard
  • Click Appearance
  • Select Sidebar (sidebar.php) from the list on the right
  • Find the line of code (right near the top) that reads:
    • <img src=”<?php echo get_option(‘home’); ?>/wp-content/themes/arthemia/images/banners/square.jpg” alt=”” width=”300px” height=”250px” />
  • Just replace the entire line with your ad code (make sure that your code is for a 300×250 pixel ad)
  • Scroll to the bottom of the page and click Update File

Categories in Arthemia Theme – Get them working

This guide explains how to get categories working properly in your arthemia themed WordPress site. By default the theme doesn’t really support your categories, this guide fixes that problem.

  • Find the ID’s of the categories you want to show
    • In the admin section of your site, go to Posts, and select Categories
    • Click on the one of the category titles on the right (Note, if you don’t have any categories yet, add some now)
    • One you click on a category title, the ID of the category will show up in your browser’s address bar. Remember which ID is for which category (You can have 5 categories listed on your Arthemia site)
  • Now that you know which categories (and their ID’s) that you want on your homepage, we’ll add them
    • Go to the Appearance section.
    • Select Editor, and click Main Index Template from the list on the right.
      • Find the section in the code that says: php $display_categories = array
      • Just use Edit->Find in your browser
    • Change the numbers in the brackets to the categories that you want listed on your page.
    • For example if, I want the categories with ID’s 5,3,9,7 and 1 on my site, I will change the line of code to read: <?php $display_categories = array(5,3,9,7,1); $i = 1;
    • NOTE: Only change the digits in the brackets, do not modify the rest of the line, just leave it as is.
    • Hit Update File at the bottom of the page.

You’re finished!

Speech to Text on a Mac Laptop Using the Internal Mic


MacSpeech Dictate 1.5
First, get Macspeech Dictate. It’s available for sale at www.macspeech.com, and you can save 10% on MacSpeech Dictate with Microphone by using coupon MACSPEECH during checkout. Once its loaded up it will ask you to create a profile by selecting a microphone. The stock Dictate application will not let you select your internal mic to be used as an audio input source. To get around this, we have to download two applications, the latest version of Soundflower from http://code.google.com/p/soundflower/downloads/list and LineIn from http://rogueamoeba.com/freebies/.

Install Soundflower and launch both applications along with Macspeech Dictate. If we go back to Dictate we can select “Soundflower 16ch” as depicted below.

Dictate Settings

Now go to LineIn and route the internal mic to Sounflower we select “Default System Input” and Output ” Soundflower (16ch)” then click “Pass Thru”.

LineIn Settings

Keep all these applications open and go back to Dictate and create your profile. Follow the rest of the steps in Dictate and this should allow you turn speech to text using your Mac Laptop’s internal Mic.

Mess with Your Landlord

This guide contains a list of ways for you to take the upper hand over your landlord. These are little-known, legal secrets that can help you when you fell like you are being pushed around by your landlord.

Interest on Last Month’s Rent Deposit

Remember that deposit cheque you made out for your last month’s rent? Do you think it’s a little strange that the landlord just gets to use that money for 11 months? As it turns out, the landlord must pay you interest on the last month’s rent deposit. The interest rate changes annually, but currently (2010) it’s at around 1.7%. So if you pay $400 a month, your landlord is legally obligated to give you $6.23 at the beginning of that last month. If you like math… that’s $400 x 0.017 / (11/12).

The concept of paying the last month’s rent upfront seems at first like it might be a scam in favor of the landlord. As it turns out, this deposit provides protection to the tenant – the fact that you have paid this deposit makes it much harder for a landlord to kick you out prematurely.

24 Hours Notice Before Showing

In most states and provinces (Ontario for sure) your landlord is required by law to give you 24 hours notice before showing the residence that you are renting. This is especially prevalent in student housing where landlords frequently take advantage of students by giving them only a few hours notice (or none at all) before showing the residence to groups of students looking to rent the house/apartment the next year. If your landlord tries to swindle you into having your home shown without 24 hours notice, you have every right to deny him/her entry to the residence.

Eviction due to Smoking / Pets

In Ontario, renting a house always brings to mind. “Are we allowed to have pets?” The answer is YES! Unless there is a clause in your lease agreement clearly not permitting pets within the residence (which technically isn’t even enough to keep you from doing it), pets are okay to have. The only real issue that can be justified is that if the pet is causing damages or disturbing tenants, which is the only justifiable reason for eviction in this case. Same of which goes for smoking within your residence, as long as it’s not disturbing other tenants, burning the carpets, or illegal substances!

C++ Execute Shell Command

Here is how you execute a shell command from within a c++ program on Linux/Unix

Example Code: (this code creates a new directory called newFolder22 in the /home/sam/ directory);

system (“mkdir /home/sam/newFolder22”);

Install Perl Module Linux | Ubuntu

This guide explains how to install perl modules using CPAN in Linux

  1. Type: perl -MCPAN -e shell;
    • This will take you into the perl cpan shell – if you are promted to answer some questions, just answer them (typically with the default answer – just press enter)
  2. Type: install MODULENAME
    • i.e. Type: install IO::Socket
    • Answer all the questions, generally just use the default (press enter)
    • if something fails and it appears that it should not have, you can try: force install MODULENAME