Thursday, July 26, 2012

Quick Tip: How To Get YouTube Thumbnail Images



Saturday, May 26, 2012

Installing PDFlib on Apache/PHP running on Windows:

I just successfully installed PDFlib on windows XP running WAMP. Here is the process:Installing PDFlib on Apache/PHP running on Windows:
Here is the direct download for the currently latest version for windows:
http://www.pdflib.com/binaries/PDFlib/701/PDFlib-7.0.1p1-MSWin32-php.zip
Once you have finished downloading, extract the zip file. 
In the folder "bind" choose your php version, and open that folder. (php4 or php5)
Inside that folder, you'll have PHP sub versions, choose your sub version. If you don't know the exact PHP version you'ure using, run a php page with <?php phpinfo(); ?> in it. The PHP version will be printed right at the top of the page.
Inside the sub version folder, you'll find the pdflib's .dll file for your php version.
Copy the .dll file and save the copy in your php extensions folder. This folder is defined in php.ini as "extension_dir". So if you don't know what it is on your machine, open php.ini and search for 'extension_dir'.
On my system is was: c://wamp/php/ext/
Now open php.ini and add the extension. The format for this is:
  1. extension=file.dll

where file is the file name of the extension.
eg:
  1. extension=libpdf_php.dll

Now you have to restart apache, and you should have pdflib installed. I tested this using:
  1. <?php
  2. if (class_exists('PDFlib')) {
  3. echo 'PDF Lib supported';
  4. } else {
  5. echo 'PDF Lib not supported';
  6. }
  7. ?>

I don't know about XAMP, you you might have the pdflib extension already added to your extensions directory. If so, then all you have to do is add the lineextension=libpdf_php.dll to php.ini

Thursday, May 24, 2012

Creating Image Maps in Dreamweaver CS5




Adding images to your site is one of the simplest and easiest ways of making your web content come to life. I’d say it’s almost mandatory, actually. After all, what better way to ensure your content resonates with your viewers than to provide visual aids and imagery? You can add further interactivity to your site, however, by making your images more than static visual aids, but a dynamic, multi-part navigation system that can link to other pages on your site. These types of images are called image maps.

What are image maps?

An image map allows a regular image to serve as a type of navigation system. We can use an actual map as a perfect example of this. For instance, when users click on certain locations–sometimes called hotspots--on the image, they can be taken to pages related to those locations.
For example, Southwest Airlines’ Route Map page displays a map of the United States. The cities that Southwest flies to are indicated with a small circle. When users click on a circle or city name, they are taken to a page about that city through the use of an image map.
Image Map Example

How to make an image map

You can make any image an image map by designating clickable areas on it and giving it a link or an action. To create an image map, insert an image (Insert –> Image) on a page and select it in Design View. The image map tools are available in the Properties Inspector as seen below:
Image Map Buttons
Clickable hotspots can be created in three shapes:
  • Rectangles
  • Circles
  • Polygons
Once a hotspot has been placed on an image, the link location must be completed. Each hotspot may link to a different page.
And that’s all there is to it!
Have you thought of any creative or brilliant image to make into image maps? A map of the world, perhaps, or even a photograph of people? Please share if you have!

Monday, April 23, 2012

How Can I Start and Shut Down My Computer Automatically on a Schedule?

On Windows

To automatically start your computer up at a specific time of day, you'll actually need to edit your BIOS settings. To do this:
  • Boot up your computer and enter your BIOS setup. Usually this involves pressing the Delete key as your computer boots (your computer should say Press DEL to Enter Setup or something similar as you turn it on).
  • Navigate to the Power Options. If your BIOS supports it, there should be a function for automatically starting up your computer at a certain time of day. Mine was called "Resume by Alarm", but yours might be called something different.
  • Enable that setting and set the time you want your computer to start every day. Save and Exit the BIOS, and your computer should follow that schedule from now on.
You probably shut down your computer when you're done using it at the end of the day, but if not, you can set it to shut itself down on a schedule. This is easy to do with Windows Task Scheduler:
  1. Hit the Start menu and type in "task scheduler". Open up Task Scheduler from your results.
  2. In the right pane, hit Create Task. Give it a name, and under the General tab, check "Run with highest privileges". Also check "Run whether user is logged on or not", if you ever leave your computer logged out.
  3. Head to the Settings tab and check "Stop the task if it runs longer than" and set it to "1 hour". This won't stop your computer from sleeping, but will stop your computer from thinking a task is still running.
  4. Head to the Actions tab, hit New, and choose "Start a Program" as your action. Set the Program to shutdown and the arguments to -s.
  5. Lastly, head to the Triggers tab and click New. Change the schedule to fit whatever you want (say, Daily at 12:00AM), and hit OK. Hit OK again at the next window and your task should be saved in Task Scheduler.
That's it. Now your computer should shut down and wake up on your own schedule.

On a Mac

This process is much easier on a Mac than on Windows. To set it up on OS X:
  1. Open up System Preferences and click Energy Saver.
  2. In the bottom right corner, click the Schedule button.
  3. Check the box next to "Start up or wake" to schedule when your computer turns on and the checkbox beneath it to schedule when you computer goes to sleep, restarts, or shuts down. You can set the schedules for specific days, every day, just weekdays, or weekends only.
  4. Once you've made all your choices, click the OK button.
Note that if you're setting schedules on a Mac laptop, it will need to be connected to power for these schedules to function.
There are a number of different ways you could do this, too, like using previously mentionedWakeupOnStandby, but this is a nice low hassle method that doesn't require any extra software.

Saturday, April 21, 2012

Application Not Responding? Here’s How to Kill Processes with PowerShell


pshelltwo
Ever have one of those days where programs just aren’t cooperating?  You try terminating a program, but it doesn’t respond?   PowerShell can give you some extra fire power on those
days.

How Do I Stop A Program In PowerShell?

1.  The long command name stop-process can be shortened to kill.
2.  If you know the numeric process that you’re wanting to stop, you can enter it.  However,
 like most Window’s users, we know the name of the program we want to stop, so entering
the name would be more convenient.  The code below shows the next step (entering –processname to specify to PowerShell that it is going to stop a process with a name of
what we want).
kill -processname
3.  Next, we need to know the name of the process we want to stop.  If we want to stop
Chrome, for instance, we would enter:
kill -processname chrome
If we hit enter (and Chrome was open), the program would end.  Important note: some processes aren’t named what you think.  You can locate the name of the processes by
starting task manager and reviewing the processes.
Notice that Google Chrome is listed as chrome, while the calculator is listed as calc. 
In order to stop the calculator we would type:
kill -processname calc
4.  If we want to stop multiple process such as Chrome, calculator and Excel, we would
separate the processes by a comma:
kill -processname chrome, calc, excel
The above command would kill Google Chrome, the calculator and Microsoft Excel.

Monday, March 26, 2012

How to Remotely Shut Down or Restart Windows PCs



image
Windows includes Shutdown.exe, a simple utility for remotely shutting down or restarting Windows computers on your local network. To use Shutdown.exe, you must first configure the PCs you want to shut down or restart remotely.
Once you’ve configured the PCs, you can use a graphical user interface or command to restart the PCs from another Windows system. You can even remotely shut down or restart the PCs from a Linux system.
Configuration
The remote registry service must be enabled on each computer you want to shut down remotely – it’s disabled by default.
To enable it, first launch the Services control panel on the computer you want to shut down remotely. To do this, click the Start button, type services.msc into the Start menu and press Enter.
Locate the “Remote Registry” service in the list, right-click it and select Properties.

From the properties window, set the Startup type to Automatic and click the Start button to launch the service.

Next, you’ll have to open the required port in the computer’s firewall. Click Start, type “Allow a program” and press Enter. In the window that appears, click the “Change settings” button. Scroll down in the list and enable the “Windows Management Instrumentation (WMI)” exception.

Your user account must also have administrator permissions on the remote computer. If it doesn’t, the shutdown command will fail due to lack of permissions.
Remote Shut Down
To shut down the computer, launch a Command Prompt window on another computer (click Start, type Command Prompt, and press Enter). Type the following command into the command prompt window for a graphical interface:
shutdown /i
From the remote shutdown dialog window, you can add one or more computer names and specify whether you want to shut down or restart the system. You can optionally warn users and log a message to the system’s event log.

Not sure what the name of the remote computer is? Click Start on the remote computer, right-click Computer in the Start menu, and select Properties. You’ll see the computer’s name.

You can also use a command instead of the graphical interface. Here’s the equivalent command:
shutdown /s /m \\chris-laptop /t 30 /c “Shutting down for maintenance.” /d P:1:1

Shut Down From Linux
Once you’ve set up the computer, you can also shut it down from a Linux system. This requires the samba-common package installed – you can install it on Ubuntu with the following command:
sudo apt-get install samba-common
Once you have, use the following command from a terminal:
net rpc shutdown -I ip.address -U user%password
Replace “ip.address” with the numerical address of the Windows computer, “user” with the username of an account that has administrator privileges on the remote computer, and “password” with the user account’s password. You can add a “-r” option to the command if you want the computer to restart instead of shutting down.

If you have remote desktop access, you can also access the desktop and shut down or restart that way. The shutdown.exe command is a faster way of doing the same thing designed for system administrators – you can shut down or reboot multiple computers much faster than you could by logging into them one-by-one.



Saturday, March 10, 2012

How to Make Simple Graphical Shell Scripts with Zenity on Linux



Zenity adds graphical interfaces to shell scripts with a single command. Shell scripts are a great way to automate repetitive tasks, but they’re normally confined to the terminal — Zenity brings them out of the terminal and onto your desktop.
We’ve given an introduction to shell scripting in the past. You don’t have to be a programmer to get started with shell scripts — they require little more than knowledge of Linux terminal commands.

Getting Zenity

Zenity comes with Ubuntu by default. If you use an Ubuntu derivative, Such as Kubuntu, you may have to install it manually with the following command:
sudo apt-get install zenity
Zenity is a part of GNOME, so it should already be included on Linux distributions that use the GNOME desktop. Check your package manager for the zenity package if you don’t have it.

Using Zenity

You can play around with Zenity from the terminal. Let’s say you want to create an error window when a problem occurs with your shell script. Here’s an example command you could use:
zenity –error –title=”An Error Occurred” –text=”A problem occurred while running the shell script.”
Run the command and you’ll see a window with the message.
Put this single command into your shell script at the correct place and you’ll have a graphical error message. You could also use variables to include more information about the error.
Let’s say you want to ask a yes or no question. You could use a command like this one:
zenity –question –title=”Query” –text=”Would you like to run the script?”
You can catch the yes or no response in your shell script and perform different commands based on which button the user clicks.
There’s also a text entry dialog:
zenity –entry –title=”Favorite Website” –text=”What is your favorite website?”
Catch the user’s input in a shell script and you could store it as a variable.
There’s also a file picker, calendar, and other types of dialogs. For a full list of dialog types and their options, consult Zenity’s manual page.

An Example Script

Let’s try using Zenity to create a simple graphical shell script. With just three commands, we can create a graphical timer program:
#!/bin/bash
# This script asks the user for a time, waits the specified amount
# of time, and shows an alert dialog.
TIME=$(zenity –entry –title=”Timer” –text=”Enter a duration for the timer.\n\n Use 5s for 5 seconds, 10m for 10 minutes, or 2h for 2 hours.”)
sleep $TIME
zenity –info –title=”Timer Complete” –text=”The timer is over.\n\n It has been $TIME.”
We’re using some extra tricks here. We get the value of the TIME variable from the first zenity command and feed it to the sleep command. We’re also using /n to create new lines of text in the zenity dialogs.
After saving the shell script and running the chmod +x command on it to give it executable permissions, we can launch it.
Enter a duration and the script will use the standard sleep command to count down in the background. When the sleep command’s timer finishes, the script will display the zenity info message.
You could create a desktop or panel shortcut for this script and run it without even touching the terminal.