Batushka's Web Hosting and Design
Screen Capture with Audio for Linux PDF Print E-mail
Written by Fr. Robert Bower   
Thursday, 31 March 2011 18:03

I have written a small bash script that is uses ffmpeg to capture video from your screen and audio from your default microphone and zenity to provide a GUI. It is based on a script by metal1000x who's original script can be found here.

The script's menu allows you to select a window of your choice or to select a monitor. In this version of the script the monitor choices are hard coded. Please feel free to change the script to meet your needs.

The script now includes the the option to choice whether to include audio or not.

The script can be downloaded here

Requirements

The script requires that ffmpeg already be installed along with zenity which is used to provide the GUI.

Last Updated on Friday, 01 April 2011 08:07
 
Using Vim with Midnight Commander PDF Print E-mail
Written by Fr. Robert Bower   
Friday, 21 January 2011 08:51

This article is for us old school types. Midnight Commander is a great file manager. Features include an ftp client, a file viewer, and a file editor. While the online file viewer and file editor are good but if you want use a different command line text editor you can configure midnight commander to use it. In this example to I will use vim and Ubuntu.

  1. Select Configuration under the options menu in Midnight Commander.
  2. Deselect use internal edit and use internal view.
  3. Save your changes
  4. At the command line run $sudo update-alternatives --config editor
  5. Select Vim from list
  6. Add the following lines to your .bashrc
    • EDITOR=/usr/bin/vim
    • export EDITOR=/usr/bin/vim

Now when you select edit or view in MC Vim should start.

Last Updated on Friday, 21 January 2011 09:11
 
Converting Images with ImageMagick PDF Print E-mail
Written by Fr. Robert Bower   
Monday, 03 January 2011 12:16

When you take a photo with your digital camera most often that image is too large for your website.

Today you can buy a 10 megapixel camera for $80 and that camera will produce a picture with an average file size of 2.2 Megabytes. You certainly don't want to load your website with pictures that large. The smaller the file size the better as far as the web is concerned. The maximium size in most cases should be no larger then 100 kilobytes.

The question becomes how do you shrink the picture down in size? I use two different programs to manupulate images. The first is GIMP which is an Opensource alternative to Photoshop. Gimp is a great program and if you need to do image manipulation you should have this program. Gimp is great working with a few photos but if I have 50 pictures I need to shrink down for a website I prefer ImageMagick.

ImageMagick is a command-line program that allows you to convert or manipulate images and works great for converting a large number of pictures. Once the right command is entered and the return key is entered, ImageMagick happily processes the photos with no more input from the user. ImageMagick is fairly quick but quick can be a relative term. Imaging processing is a heavy cpu process so it may take some time so once the process starts go get a cup of coffee.

There are two commands you will use with ImageMagick one is convert and the other is mogrify. Both commands change images convert is usually considered safer because it takes the old image, changes the image, and saves the new image with a new name but be warned you can destroy the old image if you make the new name the same as the old. mogrify takes the images and converts it so the original is gone and the new image takes it place. There is a path option that prevents this behavior but you are new to the program so do you really trust yourself. The first time I used the path option I did it wrong and mogrify happily ate the original image. So what is the point of this paragraph? Always, Always, did I say Always work on a copy of your pictures, ImageMagick will happily do what you tell it and if you tell it to eat your originals it will.

Here is a mogrify batch command to change the image resolution to 72 dpi and set the quality to 80% on all jpeg files in the current directory and save them in the directory /home/frrobert/Pictures/testmagik Warning if the specified directory does not exist ImageMagick will happily do it in the current directory.

mogrify -resample 72 -quality 80% -path /home/frrobert/Pictures/testmagik *.jpg

What! Lets dissect that command

mogrify
Is the command that will change the image.

-resample 72
Changes the resolution to 72 dpi.

-quality 80%
Changes the the quality to 80% which will allow the image to be compressed but on the screen the image to appear very similar to the original.

-path /home/frrobert/Pictures/testmagik
Saves the file in the indicated directory. If the directory is different then the current directory and is valid the original image will remain intact.

*.jpg
All files in the current directory ending with the extension jpg will modified by the command.

Here is a convert batch command to change the image resolution to 72 dpi and set the quality to 80% on all jpeg files in the current directory and save them in the current directory with a new file name with the prefix SM plus the original file name Example: picture.jpg become SMpicture.jpg

convert *.jpg -resample 72 -quality 80% -set filename:orig %t  SM%[filename:orig].jpg

Lets dissect this command.

convert
Is the command that will change the image.

*.jpg
All files in the current directory ending with the extension jpg will modified by the command.

-resample 72
Changes the resolution to 72 dpi.

-quality 80%
Changes the the quality to 80% which will allow the image to be compressed but on the screen the image to appear very similar to the original.

-set filename:orig %t
Sets the variable filename:orig to the top part of the name of the current file

SM%[filename:orig].jpg
Takes the variable filename:orig adds the letters SM to the front of it and saves the new file with that name.

To find out more about ImageMagick or to download the program go to http://www.imagemagick.org/

Last Updated on Monday, 03 January 2011 16:15
 
Custom 404 Error Page PDF Print E-mail

Taken from http://docs.joomla.org/Tutorial:Create_a_Custom_404_Error_Page

Special note: The article's example uses a relative link to the 404 error page. In order to avoid redirect errors in certain situations such as SEO friendly URLs use an absolute link.



This tutorial will show you how to create a custom 404 Error Page for use in your Joomla 1.5 Web Site.
This page summarizes popular techniques for adding Joomla! 404 Error Pages, as discussed by Amy Stephens and others in the Joomla! Forum Post [http://forum.joomla.org/viewtopic.php?f=199&t=251089 Custom 404 Inside the Content Area]

== Four Steps to Creating a Custom 404 Error Page ==

1. Create an Uncategorized '404' Article

Create an 'uncategorized' article in Joomla! to serve as your 404 Page. Include some text such as ''Sorry, we could not find the page you were looking for...'' and if necessary, also any useful navigational links. For example, you may wish to add a link back to your site's home page.

2. Create and copy a link to that new 404 Article.

Create a menu item which links to the new 404 Article and 'apply' your changes. Then copy the URL information (index.php?optio...), set the menu item as 'unpublished' and close out of the menu editing page. You may want to paste the copied URL into Notepad or somewhere accessible for the time-being.

3. Copy error.php to your Template's Directory

In your Joomla! installation copy the file error.php from the templates/system directory, to your Template directory. For example, if I was using a template named 'Cleancloud' I would copy the error.php file to the templates/cleancloud directory.

4. Modify error.php to Redirect 404 Errors to your 404 Article

Edit the error.php file as follows, adding the code below immediately under the 'restricted access' line:

 if (($this->error->code) == '404') {
header('Location: index.php?option=com_content&view=article&id=75');
exit;
} 


Replace the location information (index.php?option..) with the URL from the menu item you created.

== Additional Steps toward a Better Custom 404 Error Page ==

* Add the following line to the robots.txt file located in the root directory of your Joomla! installation.

Disallow: /index.php?option=com_content&view=article&id=75


Replacing the (index.php?option..) location with your 404 Article URL.

* Follow the Best-Practices described here: http://www.alistapart.com/articles/perfect404/

* Be creative, add a [http://www.geekhaiku.com/tag/404/ 404 Haiku] or maybe an [http://www.smashingmagazine.com/2007/08/17/404-error-pages-reloaded Interesting Photo]

Taken from http://docs.joomla.org/Tutorial:Create_a_Custom_404_Error_Page

 
Why Hire a Freelancer? PDF Print E-mail
Written by Fr. Robert Bower   
Tuesday, 21 December 2010 10:02

One of the questions is why hire a freelancer to do your web design?  I think the simplest answer is flexibility and cost efficiency.

As a freelancer I have a great amount of flexibility in what type of services I can provide.

You maybe a large company with an IT department but just need an extra person for a few months to work on an Intranet site for maintenance work orders.

You may be a web design company owner that needs a developer to assist with a technical aspect of project for one of your customers that is not in your knowledgebase.

Developing a relationship with a freelancer expands the knowledge base of your company but avoids the cost associated with an traditional employee. Need a programmer for a project that lasts 2 weeks but you don't need them till the next programming project comes through the door. A freelancer can be the answer. Keeping an employee on staff for an occasional need is not cost effective but using a freelancer is. You pay a freelancer when you need them but don't pay them when there is no need.

A freelancer gives your company the flexibility to work on projects that may exceed your current knowledgebase in a cost effective manner.

Last Updated on Friday, 31 December 2010 08:52
 
<< Start < Prev 1 2 3 4 5 6 Next > End >>

Page 1 of 6