Archive

Archive for the ‘Open Source’ Category

sendmail from the command line in GoDaddy

April 20th, 2009 2 comments

This is another useful tidbit to use with the article, Backing up your Database (with GoDaddy and Cron).

What it does: Allow you to send mail to a specified email address by using the program sendmail.

You do this from the shell in your GoDaddy account. I shouldn’t have to tell you that this tutorial is meant for the shared Linux hosting account.

/usr/sbin/sendmail.real -f myaccount@theurl.com
intendedrecipient@theotherurl.com

Type that all on one line. Of course, change the addresses to suit your needs, then press <enter>. You’ll be greeted with… nothing happening. sendmail is now waiting for further instructions. So type the following.

Subject: whatever your subject is
And now you type your message below that

And you’ll still be left with nothing happening. Now sendmail is waiting for you to tell it that the message is over. So simply type a period on a line by itself.

.

And press <enter>. Your message should now send.

This is handy for a cron job where you want either a receipt that the cron job completed, or perhaps you want a file (backup?) sent to you on a regular basis.

Example:

/usr/sbin/sendmail.real \
-f test@example.com \
recipient@example.com
Subject: Testing for HowTo
This is just a test message.
And this is a new line.
.

The following email is what I received.

from test@example.com
to
date Mon, Apr 20, 2009 at 2:22 PM
subject Testing for HowTo
mailed-by bounce.secureserver.net
This is just a test message.
And this is a new line.

Open Sourcery

March 27th, 2009 No comments

Recently I came across a gem of a site on the interwebs. I found 1889ca (Is it just called 1889? Maybe 1889 books?). It’s the home of some great stories, very much in the same light as Cory Doctorow’s works. But there’s a twist. These are children’s books. Not all of them (keep the little ones away from the Steam Duck series), but the majority are aimed at the “sub teenager” age range.

Recently, and much to my surprise, MCM, the man behind the site, launched an open source project: TorrentBoy. I felt like this was something I had to take part in. Who wouldn’t love to help drive the evolution of a wise-cracking boy who turns into a super-hero by tapping into the latent power that engulfs all of Earth’s inhabitants? I know I would!

So when MCM asked for the Twitter-Public’s opinion on which CMS (Content Management System) we’d recommend, preferably one built like a wiki, I just had to suggest the use of PmWiki. I like PmWiki. The documentation accompanying it is great. And, Lo! Check out the TorrentBoy site now! I wasn’t expecting to be able to contribute the way that I had, but I did.

So I’m not sure if this is a public awareness call for bored geeks out there who wish to contribute to an open source project (much like TorrentBoy, or any other project). If you want to help contribute to a project, you can. You’re not about to get your head torn off like you might if you play QuakeLive (people who play Quake can be scary mean!).

Programming Humans (Greying an Image)

March 22nd, 2009 No comments

I was in the shower and something struck me as slightly humorous. Just before the shower, I wrote a small program. It’s written in this new programming language that I call the “English Human programming language”. It features inline-comments (nifty snippets integrated into the code that the interpreter is fancy enough to parse out). In fact, the interpreter is intelligent enough to parse out anything that is written as a comment.

The “program” is a set of instructions for using “The Gimp” to gray out an image. The usual thing where only a certain portion of the image has any color left in it.

The program is reprinted below:

Instructions for "The Gimp".

File > Open
	select your picture

Click through the following. This will set up the picture
so that you can grey out what you want and leave color
where you want.

Select > All

Edit > Copy

Colors > Desaturate > Ok

Layer > New Layer > Ok

Edit > Paste

Layer > Anchor Layer

Now you can start "deleting the color" from the image.
"Shift-E" will select the "erase tool" but that might take
a while. I suggest you use the "Rectangle Select Tool"
(can get to it by pressing "r" on the keyboard). That will
select big chunks which you can then "Control-X" to delete
out of the picture.

There you have it, a set of instructions that when followed will fancify an image.

Categories: Open Source Tags: , , , , ,

How To: “Blog Roll” in Drupal (6.x)

March 12th, 2009 No comments

Recently I was asked to include a link to the South Okanagan Linux Users Group as a favor for them linking to the North Okanagan Linux Users Group, which I help maintain. The NoLUG runs on Drupal, which unlike WordPress (which I use for n3wt0n) does not include a “blog roll” by default. And by blog roll, I mean a collection of links to other similar blogs which is usually featured on every page throughout the site.

SOLUG scratched our back, it’s only fair in return to scratch theirs. So how do you go about creating a blog roll in Drupal? You may think about using an existing module, but that was too much work. Here’s the simple way.

Follow the path:

Home » Administer » Site building » Blocks (Add Block)

And fill in the following fields:

Block description - What the block will be called on the Blocks menu.
Block title - What the block will be called on the actual page.
Block body - The HTML to make up your blog roll.

The block body I used for the NoLUG site was simply an unordered list that makes for easy maintenance.

<ul>
<li><a href="http://clug.ca/" >Calgary LUG</a></li>
<li><a href="http://lug.kamloops.net/" >Kamloops LUG</a></li>
<li><a href="http://solug.org/" >South Okanagan LUG</a></li>
<li><a href="http://vanlug.bc.ca/" >Vancouver LUG</a></li>
</ul>

Now choose whichever configuration options you want to associate with the block. I recommend

Custom visibility settings: Users cannot control whether or not they see this block.
Show block on specific pages: Show on every page except the listed pages. (Leave the listed pages blank)

Make sure you click “Save Block” so your hard work is saved. This will take you back to the Blocks menu.

Scroll to the bottom of the Blocks menu, to the Disabled section. Locate the newly created “Blog Roll” and select either Right or Left Sidebar (or wherever you want to place the block). Click “Save Blocks” and there you have your new Blog Roll.

Categories: Open Source Tags: , , ,

Changing color of directories list

March 9th, 2009 No comments

In addition to changing the layout/color of your terminal, you can also set the colors of directories as displayed within the terminal. This comes in handy when you are SSH’ing into a remote PC and the directories are showing up as dark blue against a black background.

From within a terminal, copy the DIR_COLORS file into your home directory.

cp /etc/DIR_COLORS ~/.dir_colors

ls will automatically look for the .dir_colors within your home directory. Open that up and look for the section that looks like this:

# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
FILE 00         # normal file
DIR 01;36       # directory

Adjust the numbers to the appropriately matching color-codes (as defined just above that section). Now ls should display in the assigned colors.

Switch to our mobile site