Friday, July 30, 2010

Turn Any Action into a Keyboard Shortcut

Friendly Computers thought that this article can help you to increase your productivity by using keyboard shortcuts for any action.

Open source scripting language AutoHotkey may not be one of the most powerful or popular programming languages on the planet, but that's okay—it's not just made for programmers. That's because AutoHotkey is well within the grasp of regular folks like you or me—people who have a fair understanding of computers and are willing to learn just a little to make major strides in productivity. Today I'll show you how to use AutoHotkey to turn almost any action into a keyboard shortcut.

NOTE: I'm not a computer programmer by trade. In fact, I graduated from college a few years ago with a degree in Philosophy of Religion, Arts, and Science (a liberal arts degree I made up). My point is, even if you have absolutely no programming experience, creating simple keyboard shortcuts with AutoHotkey is well within your grasp.

Before You Get Started

First things first: You're an amateur programmer now, so you need to go download and install AutoHotkey. Once you've got that done, open a folder, right-click, and select New -> AutoHotkey Script. Give it whatever name you like, then open it up with your favorite text editor (I recommend Notepad++).

You can also grab a script of all the examples I discuss below here if you'd like to use it as a starting point.

What is a Hotkey?

In AutoHotkey, you can create keyboard shortcuts or remap keys easily in more than one way, but today we're going to focus on one method: Hotkey labels. The syntax of creating a hotkey is very simple, and can be used in two ways.

First, if you want to do something very simple—like remap a key—it looks like this:

hotkey::remapped key

...where hotkey is the keyboard shortcut that will activate the second part—in this case, a remapped key. That may seem rather vague, so let's look at a concrete example. I don't like the Capslock key as is, preferring instead to remap it to my Control key. With AutoHotkey, all it takes is:

Capslock::Control

If you add that small snippet of code to the AHK file you created above and then run the file (just double-click it), you'll notice that your Capslock key now works as a control key instead. Now not only have you got your control key at a much closer, less stressful range for your pinky, but you're not likely to accidentally fire the Capslock key when you don't want it. However, if you don't want to lose the Capslock key altogether—as there are times it can come in handy—you can add the following to your AutoHotkey script (Thanks mc_spanky_mcgee):

+Capslock::Capslock

With this hotkey, the plus sign (+) stands for Shift, so hitting Shift+Capslock will turn on and off the Capslock key so that turning on Capslock requires a much more deliberate process. For a full list of modifiers you can use to create hotkeys, check out this page. For a better idea of which symbols you can use, from Capslock to Tab to the Spacebar, check out the full AutoHotkey key list.

So far so good, right? You can actually remap almost any key in this way—including regular, non-modifier keys. So if you wanted to turn your "k" key into an "i", it'd be as simple as:

k::i

Not that remapping k to i would be terribly useful, but you get the idea. It is terribly simple.

Taking Hotkeys a Step Further

Now that you've got an idea of how to create hotkeys the simple way, we'll move on to slightly more advanced hotkey creation. First, we'll create a simple hotkey that will open Lifehacker when we press Windows-l (who wouldn't rather read Lifehacker than lock their desktop?). Quite simply, it looks like this:

#l::Run, http://lifehacker.com/

In this example, we're using the Run command, which can take any target—from web URLs to files on your hard drive—and, quite simply, open them.

As a result, creating a keyboard shortcut to launch anything at all is a breeze. You can launch any program, document, or web page with a simple shortcut of your choosing. If you were creating an iTunes shortcut with Windows-i (where the Windows key equals the pound sign [#]), for example, it might look something like this:

#i::Run,%A_ProgramFiles%\iTunes\iTunes.exe

You'll noticed I introduced another concept here: variables. The variable %A_ProgramFiles%tells AutoHotkey to look in my default Program Files directory—in my case, "C:\Program Files". I could have just made the command Run, C:\Program Files\iTunes\iTunes.exe, but using the variable means that—assuming I've got iTunes installed—the same shortcut will work on other computers that have iTunes installed to the default directory, even if their home drive is D:\ or F:\. For more on variables, check out AutoHotkey's introduction to variables, along with their list of built-in variables (like%A_ProgramFiles%).

Creating More Complex Hotkeys

So far our hotkeys have been very simple, one-line affairs, but sometimes you need more than that. In those instances, you can create multi-line actions that you want to occur when your hotkey is triggered. This requires a slightly different syntax.

hotkey::
Do one thing
Do more things...
return

Basically, as you can see, it starts out the same way with the hotkey followed by two colons. Then, however, you break to a new line and write your first action, followed by however many you want, and it ends with "return" (which signifies that the hotkey is done executing). So let's put it into practice.

The following keyboard shortcut, Windows-t, will automatically empty the Recycle Bin when I press it. When it's finished, it will show me a message telling me that the trash has been taken out.

#t::
FileRecycleEmpty, C:\
MsgBox, The trash has been taken out.
return

empty-trash.pngIn the hotkey created above, I used AutoHotkey's FileRecycleEmpty command, which takes the drive letter where the bin is located as a parameter. I also used another new concept: the MsgBox command, which displays the text after the command in a window. As you can see, I used it to confirm that the command was run and the trash was taken out.

Restrict Your Hotkey to a Specific Application

Sometimes you want to create a hotkey that will only be applicable to one specific application. In those cases, you need to use the #IfWinActive directive. To use it, you need to place #IfWinActive WindowType (where WindowType is the window or app you want the shortcut to apply to) followed by the hotkey, then followed again by #IfWinActivewithout any WindowType (so that all following hotkeys won't be restricted to one window or application). In the example below, I've set the Windows-o hotkey to open the Options in Firefox.

#IfWinActive ahk_class MozillaUIWindowClass
#o::
Send {Alt}t
Sleep 100
Send o
return
#IfWinActive

autoit3-window-spy.pngSo let's dive in and examine this bit of code. First, you'll notice theahk_class MozillaUIWindowClass bit. That may seem intimidating, but all it does is tell AutoHotkey that this shortcut will only work when a program using the MozillaUIWindowClass (like Firefox or Thunderbird) is active. You can grab the ahk_class using the AutoIt3 Window Spy, which you'll find in your AutoHotkey install directory. Just run it and click on the window you want to restrict a hotkey to grab the window class and that's a good starting point.

Next, we've used the Send command, which sends literal keystrokes to your window. The first one I sent was Send, {Alt}t, meaning that the bracketed text, Alt, indicates a modifier (again, go to the Send page for a closer look at modifiers)). If you were to press Alt-t in Firefox right now, you'll notice that the Tools menu drops down.

Then I sent the command Sleep 100, which tells the script to wait 100 milliseconds before going to the next command. I do this just to make sure the computer has time to react to my first command and the Tools menu is open. Then I sent the "o" key to select Options from the Tools drop-down menu. Finally, I ended the hotkey with the return followed by#IfWinActive to ensure any other hotkeys beyond this one aren't limited just to Firefox or Thunderbird (unless that's what you wanted).

Take Your Tweaks with You

The great thing about AutoHotkey is that you can compile your scripts to portable executables that can run anywhere by simply right-clicking the file and selecting Compile. Drop the resultant EXE on your thumb drive and take it with you wherever you go.

Source: http://lifehacker.com/316589/turn-any-action-into-a-keyboard-shortcut

Wednesday, July 28, 2010

How to Run the System File Checker (Sfc.exe) Offline in Windows 7 and Vista

Friendly Computers found this article useful and would like to share it with you.

The System File Checker (sfc.exe) is an useful tool that lets you scan the integrity of Windows system files, and repair corrupt or missing system files. Numerous cases have been resolved thus far by running Sfc.exe with the "scannow" parameter. However, there are situations where in a corrupt or missing system file prevents Windows from booting normally, and running Sfc.exe from Windows isn’t possible. In such cases, Sfc.exe can be run offline using two additional parameters, via the Windows Recovery Environment (Windows RE) in Windows 7 and Windows Vista.

Booting into Windows RE

Configure the boot order in the BIOS such that the first boot device is your CD/DVD drive.

Insert the Windows 7/Vista Setup DVD and restart the computer.

Alternately, you may use the Windows 7/Vista System Repair Disc if you have one.

When prompted, press a key to boot from the DVD. In the "Install Windows" screen, clickRepair your computer

Select your Windows installation, and click Next

Editor’s Note: Make a note of the drive-letter of your Windows 7 installation, as seen from Windows RE. This is the drive-letter you want to reference when running Sfc.exe offline.

Click Command Prompt

To scan the integrity (and repair) a specific file, use this command:

sfc /scanfile=d:\windows\system32\zipfldr.dll /offbootdir=d:\ /offwindir=d:\windows

The above command scans the file zipfldr.dll and replaces it if required.

To scan the integrity of all system files and repair them, run this command:

sfc /scannow /offbootdir=d:\  /offwindir=d:\windows

This process takes some time (<5 min in my case) to complete, and there weren’t any integrity violations.

Source: http://www.winhelponline.com/blog/run-sfc-offline-windows-7-vista/

Wednesday, July 21, 2010

5 Ways to Use Bootable Linux Live Discs

Friendly Computers found this article useful and would like to share it with you.

In the almost 20 years since Linux was first released into the world, free for anyone to use and modify however they like, the operating system has been put to a lot of uses. Today, a vast number of servers run Linux to serve up Web pages and applications, while user-friendly versions of Linux run PCs, netbooks, and even Android and WebOS phones.

One incredibly useful way that Linux has been adapted to the needs of modern computer users is as a "live CD," a version of the operating system that can be booted from a CD (or a DVD or, in some cases, a USB drive) without actually being installed on the computer's hard drive. Given the massive RAM and fast CPUs available on even the lowest-end computers today, along with Linux's generally lower system requirements compared to Windows and Mac OS X, you can run Linux quite comfortably from a CD drive.

Live discs allow you to radically transform the nature of the machine you're working on -- without modifying the installed operating system and software at all. There are a number of reasons you might want to do this. The most obvious is to test a new version or different distribution of Linux before deploying it, saving yourself the surprise of incompatible software or nonfunctional hardware after installation. But even if your business does not plan to deploy Linux as a desktop or server operating system, there are still good reasons to have a live Linux CD or two on hand.

Live CDs are great for system diagnosis and recovery when disaster strikes; they're also useful for securing and testing your network. And for road warriors, the ability to boot up a familiar, customized operating system on any machine, anywhere in the world, has an obvious attraction -- as do specialized live distributions designed to provide security and anonymity for workers with sensitive data or communications to protect.

Live discs are read-only, which means they're quite secure, since malware can't make any changes to the core system. If you do get an infection, it disappears as soon as you reboot.

Here are five ways to use live Linux in your business, as well as pointers to distributions best suited to each particular task.

1. Test-drive Linux

Over the years, Linux has developed from a usability nightmare into a fairly straightforward desktop operating system. With professional-quality productivity tools like OpenOffice.orgfor creating documents, spreadsheets and presentations and GIMP for image editing, as well as versions of familiar applications such as Firefox, Thunderbird, Adobe Reader and Flash, most common business tasks can be done pretty easily on a Linux system.

You can see how well adapted Linux is to your business by running several of the most popular desktop distributions from a live CD. Perhaps the most refined and user-friendly desktop system available right now is Ubuntu, which includes just about every application you could ever ask for, from business productivity apps to programs for multimedia editing, Web design, running databases, serving up Web pages and chatting online.

Ubuntu's installation disk is itself a live CD, so if you decide to install the system later you can just run the installer from the Ubuntu desktop.

2. Recover aging hardware

Linux in general has lower system requirements than other contemporary operating systems, but there are a few distributions that are specially designed to take advantage of old, even ancient, computer hardware, letting you squeeze a few more years of life out of systems you wouldn't even think of running Windows on -- including machines with broken hard drives.

Both Damn Small Linux (DSL) and Puppy Linux are designed for older systems, requiring only a Pentium 486 or equivalent CPU and 128MB of RAM to run well. DSL can even run with just 64MB of RAM. Both launch a usable, if somewhat stripped down, user interface that's perfect for tasks like sending and receiving e-mail, creating documents and surfing the Web -- in other words, basic administrative tasks.

3. Secure your network

Linux is already one of the more secure operating systems, since it was designed from the start as an Internet-connected system. Running it from a live CD makes it even more secure, since the disk image cannot be modified. Several distributions take advantage of the inherent security of the live CD to transform old computer equipment into powerful secure gateways for your network.

Zeroshell can be installed on any PC with a 233-MHz processor and 96MB of RAM to transform it into a fully featured gateway router and firewall. All the advanced features you'd expect from a modern gateway are present, including authentication via RADIUS server, quality-of-service monitoring and traffic-shaping, VPN and the ability to act as an 802.11a/b/g router on machines with the appropriate wireless cards.

4. Restore failed systems and recover lost files

When Windows fails to boot, smart IT professionals reach for their live Linux CDs. Whether the problem is a corrupted operating system or a damaged hard drive, you can boot up Linux from the CD drive, allowing you to read and copy files, run diagnostics or perform other maintenance tasks like partitioning drives.

While most Linux distributions have an assortment of at least some useful diagnostic and recovery tools (and often, looking at a drive through another operating system can be immensely useful in itself), specialized distros like the Ultimate Boot CD (UBCD) designed to run from discs are ideal for dealing with technical problems.

UBCD is the Swiss Army knife of recovery discs, containing more than 100 tools for performing deep sector-by-sector analysis of a hard drive's physical surface, recovering deleted or damaged files, rebuilding file tables, examining boot-sector errors and plenty more.

5. Work anonymously

Transform any computer into a paranoia-inspired privacy powerhouse using a CD-based distribution such as TAILS, The (Amnesic) Incognito Live System. With TAILS, you can surf the Web in total privacy -- all outgoing traffic is anonymized using the Tor service, which bounces your packets through random servers worldwide before delivering them to their destination.

In addition, the software included with TAILS is configured for privacy by default: Firefox comes with JavaScript and cookies disabled; the e-mail client, Claws, includes integrated GnuPG encryption; the Pidgin IM client is configured for Off-the-Record messaging, which encrypts and strips identifying information from your messages; and so on. Since it boots from a Live CD and saves no information on the host machine, once you remove the disc all traces of your activity simply disappear.

Find more live Linux distros

These choices only scratch the surface of the available Linux systems that can be run from a live CD -- Wikipedia's "List of Live CDs" entry names about 100 different Linux versions with live CDs, as well as live CDs based on other operating systems such as BSD, Solaris and even Windows. If you have a preferred Linux version, check the list -- chances are it will run from a live CD, with all the portability and security benefits that implies.

Source: http://www.pcworld.com/businesscenter/article/201542/5_ways_to_use_bootable_linux_live_discs.html

Friday, July 9, 2010

What You Need to Know about IPv6

Friendly Computers found this article interesting and would like to share it with you.

The Internet promises unlimited connectivity, but such connectivity requires that computers and devices find one another through a common address plan. The current plan, in place since the late 1970s, is running out of open addresses, and a new scheme called IPv6 is being put in place to power the Internet's next stage of growth.

For small businesses that plan ahead, this shift can enhance computing security and application reliability and performance. But waiting until the last minute could leave you scrambling for costly equipment updates, missing an opportunity to turn a necessary change into a business boost.

IPv6 has been around and touted by the networking industry as "coming soon" for many years, yet there is no grand, worldwide launch date. Some parts of the world, notably Asia, and some Internet service providers (ISPs) and related companies, are leading others in the transition. Now, though, it's widely recognized that a day of reckoning is coming within the next couple of years as an increasingly critical IP address scarcity forces widespread changeover.

What Is IPv6?

In 1981, the only computers with Internet access were part of military or research organizations. In this 8-bit environment, the 32-bit address space offered by Internet Protocol version 4 (IPv4) seemed unlimited, allowing nearly 4 billion possible addresses (2 to the 32nd power) for connected devices. Fast-forward nearly 30 years and millions upon millions of Internet users later, and the end of available addresses is in sight. Once all the addresses are assigned, then, in theory, no new device can be attached to the Internet.

A variety of creative, if not always legitimate, fixes for limited address space already exist. Some large Internet carriers are beginning to "hide" a large network behind a small number of public IP addresses, using the Network Address Translation (NAT) scheme, as consumers and small businesses do. While this workaround provides Internet access for more devices, its complexity can hurt network performance. Other carriers, especially in developing countries, are conducting "black market" auctions of IP address blocks to desperate companies and carriers.

IPv4 formats Internet addresses in a quartet of numbers, such as 70.42.185.10. This is distinct from URLs, such as www.pcworld.com, that are converted to numeric IP addresses by a Domain Name System (DNS) server. A single URL may be tied to multiple IP addresses, or multiple URLs may point to a single address.

In 1998, the Internet Corporation for Assigned Names and Numbers (ICANN) ratified a new Internet Protocol, IPv6. It shifts to a 128-bit IP address space (each broken into hexadecimal groups), which means around 340 undecillion (340 times 10 to the 36th power) possible addresses, or billions of addresses for every living person. This expanded space is critical for the continued growth of the Internet.

IPv6 Benefits

IPv6 benefits will include a level of security baked into the protocol. IPv4 was designed for an "age of innocence" with a small Internet population. IPv6 is for a bigger, more cynical age, so it carries capabilities for verifying addresses and known identities, and establishing trust between routers. It should become harder, for example, for criminals to use "address spoofing" attacks, where Websites or e-mail messages misrepresent where they come from.

IPv6-era routers and firewalls will provide greater protection against anonymous attacks, with much simpler and more reliable, secure connections for business computers moving financial and other sensitive data among servers and back offices.

Also, IPv6 will allow greater security and performance for business-critical applications, such as those that automate order placement and maintain customer billing and supplier relationships.

The greater control with IPv6 in how information is routed between computers could help small businesses and their ISPs to develop network performance and reliability that larger organizations and carriers now enjoy.

In addition, IPv6 will enable finer control of how rich media and critical applications perform on a network, and allow faster transactions over virtual private networks (VPN). IPv6 can boost VoIP or unified communications services because it improves quality of service (QoS), which allows certain types of network traffic, typically those sensitive to interruption, to get priority during heavy network use. A VoIP conversation or video Webcast on your network, for example, would get priority over a file transfer.

First Steps

As with the lead-up to Y2K (remember that?), vendors and service providers will do most of the heavy lifting. ISPs will lead consumers, while large corporations will have teams dedicated to the change. A small business will have to ensure that all network equipment and software is ready, updated, and switched over at the same time when IPv6 comes. Planning ahead will help prevent interruptions to the critical connections that take place via the Internet. It will also allow you to buy equipment and services at negotiated, well-reasoned prices rather than on an emergency, cost-is-no-object basis.

Support for IPc6--click for full-size image.Building a checklist of every piece of network equipment and researching its IPv6 capability is a solid first step. Be especially vigilant when noting those systems with IPv6 "transition" capabilities versus those with full, built-in IPv6 compliance that you'll want for the long run.

If your small business uses the Internet mostly for e-mail and instant messaging, then making sure equipment is IPv6-compatible should suffice. If, on the other hand, your business has begun building cloud applications; has ties to supplier, partner, or customer applications over the Internet; or has relationships with large suppliers and customers--then planning now might prevent business-endangering Internet outages later.

In moving your business to IPv6, the major points of concern are your ISP; your network infrastructure; and the server, workstation, or device that is in the hands of the user. Issues at the ISP are important but largely out of your hands. When the ISP and network infrastructure are IPv6-capable, the workstations and servers will largely hop on board. Issues at the server, workstation, or device level are largely already dealt with by current Windows, Linux, and Mac operating systems, which can work with IPv6 addresses and networking. Windows 7, for example, includes IPv6 as a basic protocol that is set up and configured just as IPv4 is. It's the network infrastructure where most businesses will find the major issues.

Support an Internal IPv6 Infrastructure

As more carriers and ISPs begin offering IPv6 addresses and services, it will become easier to justify making the move to IPv6, and it is at this point that infrastructure issues will begin to loom large.

If, within the last two years, your company purchased equipment for its network, including routers, switches, security devices, printers, photocopiers, or fax machines, it's very likely to be IPv6-capable. If the equipment is between two and five years old, it may have some IPv6 capabilities. If the gear is more than five years old, however, then its readiness is a crapshoot, and the switch to IPv6 is a strong reason to upgrade that equipment.

Unfortunately, there's no "IPv6-ready" sticker program in place for hardware. You'll have to check a product's administration program and look for IPv6 features, or ask each vendor about existing or upgraded IPv6 capabilities and, if necessary, begin to plan software or firmware updates.

Even if your infrastructure or ISP is not IPv6-capable, it may begin working with IPv6 addresses from workstations or servers using one of the IPv4-to-IPv6 transition protocols (including 6to4, Teredo, 6over4 and ISATAP) available on major operating systems. Each of these "dual-stack" protocols will, in one form or another, wrap IPv6 addresses within IPv4 packets; that's fine for a transition, but it's not a long-term solution because of security and stability concerns.

If you keep a piece of IPv4-only equipment, someday it won't be able to talk to the rest of the network because two different addressing schemes are at play--kind of like trying to use a telephone number to send a piece of paper mail.

You must check firewalls, intrusion prevention systems, DNS servers, and other security and service appliances for IPv6 compliance, as well. A firewall can easily block IPv6 protocols, and DHCP servers will have to be IPv6 capable in order to serve IPv6 addresses.

Click for full-size image.Once your company begins to look at IPv6, you can use certain Web sites and services that tell whether IPv6 connectivity exists. Both Google (ipv6.google.com) andYouTube (ipv6.youtube.com), for example, are available for new protocol searching and surfing now and make easy-to-remember test cases for IPv6 capability from your network.

While the transition will not be free or smooth for every company, the benefits of an IPv6 Internet outweigh the costs. Begin now, taking inventory, and then build a plan for the switch; that way, your company will be in position to take the next IP step without a major stumble.

Source: http://www.pcworld.com/businesscenter/article/200580/what_you_need_to_know_about_ipv6.html