Näytetään tekstit, joissa on tunniste Windows 7. Näytä kaikki tekstit
Näytetään tekstit, joissa on tunniste Windows 7. Näytä kaikki tekstit

torstai 23. elokuuta 2012

Enabling Windows 7 hibernation mode

The hibernation setting in the shut down menu
It always seems to be a bit of a pain for me to figure out how to enable the hibernation mode in Windows 7 desktops. Hibernation is a mode where the current computer status is saved to the hard disk and the computer is then basically turned off. Waking up from hibernation takes far less time than waking up when the computer has been shut down completely, so I use hibernation almost exclusively. There's a TLDR tutorial on how to enable it (if it's not already available in the shut down menu), but I'll just write the short steps here:
  1. In Start Menu, type powercfg.cpl and hit enter
  2. With your selected power plan, click "Change plan settings" and then "Change advanced power plan settings"
  3. Set SleepAllow hybrid sleepOff
  4. Close the prompts you opened by clicking OK and Save changes
  5. From the Start Menu, find All Programs → AccessoriesCommand Prompt and right-click it, then select "Run as administrator"
  6. Now type powercfg -h on and hit enter. The hibernate option should now be available!

torstai 17. toukokuuta 2012

Windows PowerShell

The Windows PowerShell
One advantage that Linux (and other Unix-like systems) has always had over Windows is the powerful command line interface. Linux systems provide the user with dozens of little programs that can be combined, or piped, together to do more complex things. For example, the ls ("list") command lists the files in the current directory. The wc ("word count") command counts the number of lines, words and/or bytes in the given input. Pipe these together, and you can get the number of files in the current directory: "ls | wc -l".

With the Windows Command Prompt these kind of operations have traditionally been way more difficult. Of course, I guess most people never use the Command Prompt, but those who do miss these powerful features from Unix-like systems. Nowadays, however, we have the Windows PowerShell.

The Windows PowerShell has been around for a few years already and I've been vaguely aware of its existence, but never really looked into it until now. It seems to be readily available on all Windows 7 installations, and most likely on Windows Vista as well. You can find it from the Start Menu.

Basics

When you start the PowerShell, you might want to see what commands are available. You can use the Get-Command command or its alias gcm for that. You'll see many lines of text that end with "...", i.e. they are truncated. Use Get-Command | Format-List  or the short form gcm | fl to see everything, or gcm Some-Specific-Command | fl to get info on some specific command only. And since the PowerShell commands aren't that short, you might only want to see the list of short commands, or aliases, available Get-Alias. The PowerShell commands are case-insensitive, so that would be the same as get-alias. And by the way, the default alias for get-alias is gal.

When you are accustomed to Unix shells the weird part in PowerShell is that it is object oriented. The pipes actually pass around typed objects rather than character streams. So when you "print out a list of files", you are actually rendering a collection object consisting of file objects. I won't go into this in detail but it is good to know this.

Replacements for Unix commands

So, what commands replace the most used Unix commands? Here are some of the most important ones in the format of Unix-command: Windows-command (alias):
grep: Select-String
cat: Get-Content (cat)
ls: Get-ChildItem (ls)
mv: Move-Item (mv)
cp: Copy-Item (cp)
wc: Measure-Object -line -word -character (measure)
cd: Set-Location (cd)
tail -n 15 : cat | select -last 15
tail -f cat -path -wait

Aliases

OK, so the PowerShell can do pretty much anything a Linux shell could, and often with the same command. However, there aren't ready made aliases for all the commands. Luckily, you can define more of these aliases by yourself. Let's create that grep alias: Set-Alias grep Select-String. There! However, there's still a problem: if you now exit the PowerShell, your brand new alias is deleted. Luckily, you can save these into your profile file. First, type $profile to see the location of your profile file. Chances are it doesn't exist so you need to create it. After you have done that you can add your set-alias commands into it. You can then easily edit the file by typing notepad $profile.

However, when PowerShell starts the next time it will give you a warning that "the execution of scripts is disabled on this system". The command get-help about_signing explains in detail what you can do about this, but the easiest way is to restart PowerShell with the administrator rights and to enter the command set-executionpolicy remotesigned. You can now close the admin shell and open it up again with your normal rights and presto, your aliases are available to you right from the start!

Functions

Unluckily, aliases can only be created for plain commands, not for commands with parameters or pipes. However, these cases can be dealt with by creating functions. Let's create a function called tail. Open your profile file and add these lines to it:
function tail($1, $2) {
    cat $2 | select -last $1
}
Then, in your PowerShell, reload your profile script: . $profile (notice the dot). Now, when you want to see the last 15 lines in the given file, you can just enter this command: tail 15 [filename]. Voilà!

Further resources

I read quite a few web pages when learning the basics of PowerShell and you will probably find them useful as well. First, Microsoft, of course, has an Owner's manual as well as a large collection of useful PowerShell tips. Second, Stack Overflow has thousands of questions about PowerShell answered. Third, a Windows PowerShell blog has a more detailed list of those Unix equivalents in PowerShell. Finally, as usual, Google is your friend!

tiistai 10. elokuuta 2010

Back on tracks

About a month ago I managed to completely destroy my Windows 7 installation. Since then I have been using my desktop computer or the memory stick installation of Ubuntu Netbook Edition on this Asus EeePC 1101HA netbook of mine. Until now, when I finally managed to borrow an external DVD drive. See, the netbook actually shipped with a bootable recovery DVD which happily erased the hard drive and reinstalled Windows. That was rather surprising as I didn't see any obvious hints on the DVD that it would contain a feature like this -- I actually found out by accident that it was bootable at all. Anyway, my Windows 7 is now back up and running again. Let's see if I can find another way to wreck it later. :P

torstai 20. toukokuuta 2010

New GMA500 drivers

After installing, trying and removing Portal yesterday I thought of the graphics card drivers and found out that there's a new version out. Intel calls it 5.0.0.2024 which is rather strange since the previous version was called 5.2.1!? This driver still has a newer date than the previous one and in the device manager it appears as version 8.14.10.2024 which is greater than before (8.14.10.2020). No visible improvement in the Windows Experience Index figures though, but go install it anyway.

tiistai 6. huhtikuuta 2010

Tools for web developers

A handy tool for web developers is Dynamic Drive's Gradient Image Maker. Creating gradient images is a basic thing that a web developer has to do and there's no need to fire up Photoshop for something like that. Microsoft Paint can be used to create gradients, too, but a dedicated tool beats that hands down. :)

Another nifty tool, possibly for selecting the colors for your gradient, is Iconico's ColorPic. It can be used to pick a color anywhere from your screen. It's got an adjustable magnifier, you can nudge the mouse cursor pixel by pixel using the arrow keys, and you can select the average color of a small area of pixels in case selecting the color of a single pixel is not desired!

maanantai 15. maaliskuuta 2010

Opera 10.51 RC1

A month ago I wrote about Opera 10.50 beta. Now the 10.50 has already passed the beta stage and what's more, Opera 10.51 Release Candidate 1 for Windows has just been released. This version contains performance improvements and an even better JavaScript engine, especially what comes to memory management. These features are of course very welcome to all netbook users. :)

tiistai 9. maaliskuuta 2010

Image processing software

When you open an image file in Windows 7 it opens in Windows Photo Viewer by default. It can be used to view and rotate images but nothing else, so you need a better piece of software if you intend to crop, resize, adjust or otherwise edit your photos.

IrfanView does all this. It is a piece of freeware that I have used for as long as I have used the Opera browser and the NoteTab text editor, ten years or so. The user interface is minimalistic and the program is controlled using the menus or the shortcut keys. IrfanView can be used to batch process an entire folder full of images or just one image at a time. It can read dozens of file formats and write an impressive number of formats too. There are also lots of plugins for it bringing in some extra functionality. They are really easy to install because they are provided as one big installer file from the IrfanView homepage. What's also very important for netbook users is that IrfanView is a lightweight and fast program.

Hint: If you work with images that have transparency, set the IrfanView background color to pink (Options | Properties/Settings... | Viewing | Main window color). Then you will know exactly where the transparency starts and where it ends, as pink is featured in really few pictures, unlike black and white.

sunnuntai 7. maaliskuuta 2010

Text editors

So far I have introduced you to alternative office software, browsers, instant messaging software and PDF readers. Today it's text editors meant for plain text.

So, Windows ships with Notepad. It's as simple as a text editor can get. A good text editor can save you time by having useful shortcuts, being able to have several files open at once, allowing you to do search and replace on several files at once, allowing you to use regular expressions when searching and replacing, etc.

All this and much more can be done using NoteTab Pro. It costs $29.95 but is well worth every penny. There is also a free version called NoteTab Light which is a very capable program too -- a comparison of features between the different versions can be found here.

I myself have been an avid NoteTab user for years already, not least because it has got its own scripting language which can be used to program the application to do almost anything you can think of. Automatic reformatting of any text you just copied to clipboard from another program? Consider it done. HTML table wizard? Piece of cake. FTP integration? No problem. The scripts are called clips and organized into clipbooks. The program comes with many ready made clipbooks and more can be downloaded.

NoteTab has also got a very active and helpful community at the Yahoo! Groups. It is divided into a general section, clips, and www-authoring.

The only thing that NoteTab lacks is syntax highlighting for other languages than HTML. If you need that, I can warmly recommend an open source program called SciTE.

perjantai 5. maaliskuuta 2010

Alternative PDF readers

Previously I have written about alternatives to Internet Explorer and alternatives to Windows Messenger. This time it's alternatives to the Adobe Reader.

Foxit Reader is a small and fast PDF reader. It is commercial software but the basic version is free and has all the main features and, in some aspeceven more than Adobe Reader has.

Sumatra PDF is another slim and quick reader. It is designed so that it does not require any special installation procedures and can be used from a USB stick. It is also open source, if that's what you prefer.

Both of these are good alternatives to the Adobe Reader, so it's a personal choice between them. Either one works faster than the Adobe Reader, and the software that you are using on your netbook can never be too fast.

keskiviikko 3. maaliskuuta 2010

Pidgin instant messaging software

Windows ships with the Messenger instant messaging (IM) software. I, too, use Messenger, along with ICQ that I have even been using for a much longer time.

A while ago I found out that my Messenger was taking ridiculous amounts of CPU time, slowing down the entire system. It appears that it was because of (some of) the advertisements that the main view displays so I started looking for another IM software and found Pidgin. It is a lot faster than Messenger and does not display any advertisements. It also supports multiple IM protocols, i.e. you can use both ICQ and Messenger using the same piece of software. Google Talk and many other protocols are supported too, so give it a try. :)

PS. Related to alternative software: a month ago I wrote about alternative web browsers!

torstai 25. helmikuuta 2010

Disable login prompt

A quick tip on how to speed up the system when it is waking up from hibernate or sleep mode. If you are the only person that has physical access to your laptop or if you trust everyone else that does, you might want to consider disabling the Windows password prompt. In Windows 7 this is done in Control Panel > All Control Panel Items > Power Options > Require a password on wakeup. Then click "Change settings that are currently unavailable" and then select "Don't require a password" and finally "Save changes". Now Windows won't delay you with password prompts when waking up. Plus, you can always lock your computer any time with Windows key + L.

perjantai 19. helmikuuta 2010

HD videos

Slashdot recently featured an article called How to play HD video on a netbook by PCPro. It includes buying a codec for about $10 (although someone commented on the original story that Shark007's codecs do the same thing for free). However, I'm happy to report that the Asus EeePC 1101HA plays HD videos out of the box! I tried it with a 1920×816 (1080p), 23.967 FPS trailer of The Bourne Ultimatum, found from H264info.com. As is mentioned in the PCPro article too, some stutter in the video is inevitable, especially in the scenes where a lot is happening at once, but basically it is perfectly watchable anyway. The sound plays very smoothly and there was no stutter to be heard.

sunnuntai 14. helmikuuta 2010

Password management

Many of us have dozens of passwords to tens of different services: emails, web forums, workplace computers, games, etc. It is often quite difficult to remember all of them and as a result people use the same password in many services. This is a bad habit because now if your password gets stolen from one service, the attacker gains access to your other systems too. Many people also use very weak passwords, something like "qwerty" or "12345", which are easy to guess just by trying out the most common alternatives.

Luckily there are solutions to these problems: password manager programs. The program saves and encrypts all your passwords behind one master password. That one still needs to be a strong one and you need to memorize it, but after you have set up the system, that's the only password you are ever going to have to remember again. I have been using KeePass and its cross platform version KeePassX. I won't bother writing a full featured review as I just found a recent KeePass review by soft2review, so if you are not yet convinced that you need KeePass, go read it!

lauantai 6. helmikuuta 2010

ReadyBoost

Trying to improve the performance of my netbook led me to try out the Windows ReadyBoost feature. ReadyBoost is a feature that utilizes a memory stick or a memory card as a fast cache, in addition to using the slow hard disk. This works because flash memory is usually faster than a hard drive, at least in random reads/writes. So, I used my USB memory for a while and, while I did not commit any actual measurings, I felt the computer was indeed more responsive, especially when multiple programs were running simultaneously.

Because a memory stick sticking out from the side of the netbook is not a very nice feature I went ahead and bought a fast SDHC card (Class 6, 8 GB, ~14 €) to be permanently stuck into the memory card slot (which, by the way, in Asus EeePC 1101HA's case only supports SD, SDHC and MMC cards and not, for example, MemoryStick cards..). Then I formatted the card into the new exFAT file system and gave it to Windows to be used as a ReadyBoost disk.

You may think that this is a waste of money and time but as far as I can see it is never a bad idea to buy SD cards. Firstly, many, if not most, digital cameras support those. Secondly, 8 GB is quite a lot of space, so the card could well be used for copying files from one computer to another. Thirdly, you could just use it like any other drive in your computer and, for example, install another operating system (namely Linux or Chrome) to it. Running an OS from a flash disk should save the battery because flash disks only consume a fraction of power compared to the regular, spinning disks. So who knows, I might do that some day. And if I do, I will be posting about my experiences here.

lauantai 30. tammikuuta 2010

Windows + P

Windows 7 introduces some new shortcuts compared to the earlier versions of Windows. My absolute favorite of the new shortcuts is Windows key + P. This allows you to choose the presentation mode, i.e. attach or detach an external display, such as a projector, a TV or a regular computer display. In the previous versions of Windows there was no simple way to do it (well, according to my definition of simple -- of course I know how to do it, but anyway). Windows 7 makes it extremely simple.

torstai 28. tammikuuta 2010

New Windows Experience Index figures

When writing my previous blog entry about the graphics driver I found out that there's another new version of the driver available. In the Device Manager this version knows the number 8.14.10.2020 but on Intel's site it is known as version 5.2.1. Anyway, this update improved the Windows Experience Index figures again: the rating for gaming graphics rose from 2.4 to 2.7 and the rating for desktop graphics from 4.3 to 4.5. :)