Showing posts with label windows 7. Show all posts
Showing posts with label windows 7. Show all posts

Thursday, 19 July 2012

Java Command Line Performance Tools

Duke WavingWell most of my friends don't get to see my work. My main gig is creating customer Java training for Oracle. For example, the main Java programming course: Java SE 7 Programming.



Well my current assignment is to create some free content for the Oracle Learning Library. So my first tutorial is out:

Java SE 7: Reviewing JVM Performance Command Line Tools

OLL Entry | Tutorial Link



The tutorial covers some of the built in command line tools included with Java 7. With the tools, you can query running JVMs and find out a great deal of information about them. So if this sounds interesting check it out.

Monday, 21 May 2012

An HP Ultrabook with a Matte Finish (June 2012)

I ran across this a couple of weeks back, but I didn't have time to write about it.



HP EliteBook Folio 9470m

The HP EliteBook 9470m will be a 14" 3.5 pound ultrabook coming out in June 2012. Why am I blogging about it? HP announced a number of Ultrabook and Sleekbook notebooks a week or two ago. This machine (if I'm not mistaken) is the only one with a matte display. The base price should be around $1000.



I'm still waiting around to see what we are gonna get from Apple. Their new slim 15' MacBook pros could be interesting. But it is nice to have some alternatives.



Here are a couple of detailed reviews on this machine:



Laptop Review

Lilliputing

Thursday, 19 April 2012

Windows Equivalent of Grep

Microsoft Logo

I have been looking for a Windows equivalent for the Unix grep utility for some time. Only recently have I find the solution, it seems Google search has been leading me astray! :)



The command is:

findstr



and it has been available since Windows XP.



For example if I wanted to search all the .java files in the current directory and all sub-directories for "Class" I would use the following command.

findstr /s /n "Class" *.java



The /s switch searches all sub-directories. The /n switch displays the line number where the match was found. If a match is found, the file name and path is also displayed.



As another example, if I wanted to do a case insensitive search I would use:

findstr /s /i /n "Class" *.java



The command also supports regular expressions so you can make your searches as complex as you want.

Tuesday, 13 March 2012

Windows DNS Tricks


Microsoft Logo

Did you know you can view your Windows DNS cache? You can very easily with the following commands. Note that on Windows 7 or Vista, you must open your command prompt as Administrator for this to work. You can do this by right clicking the Command Prompt icon and selecting Run as Administrator.



To view the DNS cache type:

ipconfig /displaynds



This prints a lot of information for each entry. To just see the host names try:

ipconfig /displaydns | find "Record Name"



To search the for just the .com host names try:

ipconfig /displaydns | find "Record Name" | find ".com"



To clear the DNS cache use:

ipconfig /flushdns

Thursday, 23 February 2012

Cyberduck Drag and Drop stops working

Microsoft Logo

Problem: Using Cyberduck on Windows and suddenly drag and drop does not seem to work. When I drag a file or folder to Cyberduck, I get a "Not Allowed" icon and nothing happens.



Cyberduck is a great SFTP, FTP, and WebDAV client for Windows and Mac.



Solution: Have you been using VPN? In my case I had just used Cisco's VPN software to connect to the corporate network. Depending upon how the VPN software is configured, it may cut off all access to the local network. That should be cleaned up after you exit VPN. But apparently, it does not clean up everything. Just reboot your machine and that should fix the problem.

Tuesday, 21 February 2012

Windows 7 Updating a Read Only Directory/File

Microsoft Logo
Problem: You need to edit a read only file located in the C:\Program Files. However, you cannot reset the read only status of the file.



This is the problem I ran into when trying to edit C:\Program Files\NetBeans 7.1\etc\netbeans.conf. This is a NetBeans configuration file. The file is read only and so is the parent directory and the parent directory above it. I tried turning off the read only bit using File Explorer, the command line, you name it. Running as administrator had no effect.



Workaround: Do the following:

  1. Copy the file to a directory that you have write access to.

  2. Edit the file and make the changes you need.

  3. Rename the original readonly file. You can do this with Administrator privileges.

  4. Copy the edited file back to its original location.

Your read only file should now be edited.

Monday, 13 February 2012

Add Windows Update to Your Start Menu on Windows 7

Microsoft Logo

I found a tip on how to do this on anewdomain.net.



The only thing I had to do was create the shortcut to begin with. Just click Start and then search for "Windows Update". You should see a program entry for it. Right drag that to the desktop. A popup menu should allow you to create a shortcut. Once you have done that, follow everything in the tip.



This is an awesome tip, because I hate having to wait 5 minutes after a reboot to see if there are any new patches.

Tuesday, 7 February 2012

Combine Multiple Commands on one Line with Windows

Microsoft Logo

Can you combine multiple command one one line with a Windows command prompt? You bet.



Just separate each command with a semicolon (;) and precede the command with two ampersands (&&).



For example, the following line performs three directory listings with one command line:



dir;&&dir /w;&&dir /b

Thursday, 25 August 2011

Simple Command Line File Search with Windows XP and 7

Microsoft Logo

Ever want to do a really simple file search in Windows? Do you find the Windows graphical search tools difficult to use and unreliable?



Well fear not. You can use the Windows command line and the dir command to do most file searches.



To open a command prompt window:

On Windows XP: Start --> Programs --> Accessories --> Command Prompt

On Windows 7: Start --> All Programs --> Accessories --> Command Prompt



Now you can use the cd command to move around your disk.

To move up 1 directory level: cd ..

To move to the directory root: cd \ or in most cases cd c:\

To move into a directory (to the windows dir from the root directory for example): cd windows



Once you are in the desired directory you are ready to search. Here is a basic example of the command:

dir /s /b myfile.txt



This example would search the current directory and all sub directories for the myfile.txt file. The /s option searches subdirectories. The /b option displays the path to the file so you can see the path to the file and use a tool like File Manager to navigate to it.



Here are a couple more examples.



Here is an example of a search for all files that end in .help.txt. The * means all files with this file extension. This search takes place in the c:\windows directory.



C:\WINDOWS>dir /s /b *.help.txt

C:\WINDOWS\system32\WindowsPowerShell\v1.0\about_aliases.help.txt

C:\WINDOWS\system32\WindowsPowerShell\v1.0\about_arithmetic_operators.help.txt

C:\WINDOWS\system32\WindowsPowerShell\v1.0\about_arrays.help.txt





Here is an example of a search for all files that contain winhelp in the file name with any extension.



C:\WINDOWS>dir /s /b winhelp.*

C:\WINDOWS\winhelp.exe

C:\WINDOWS\system32\winhelp.hlp

C:\WINDOWS\system32\dllcache\winhelp.exe



C:\WINDOWS>





As long as you do not search the entire disk, performance is really quite snappy. Even searching the entire disk is still pretty good.

Tuesday, 26 July 2011

Launch Options for Windows 7 Taskbar


Microsoft Logo

If you are a Windows 7 power user, there are a lot of times you need to run an application as administrator. Or perform some other function other than launching app. Typically this is done by right clicking an app icon. However, apps on the Windows 7 Taskbar can only be unpinned from the bar when right clicked. Or so I thought...



Turns out if you shift right click an app on the Taskbar, you get the application pop up menu allowing you to perform special operations like "Run as Administrator". A time saver, much better than hunting for the app from the application menu.

Friday, 22 July 2011

Symbolic Links with Windows 7


Microsoft Logo

Did you know that Windows Vista and 7 support symbolic links? What are symbolic links you ask? Essentially it is a alias for a directory or file. Symbolic links have been a feature of Unix based operating systems for many years. For example, let's say I have a directory named: "C:\really\long\directory\name".



So I don't want to type that over and over again, instead I can make a sym link named "C:\rldir" and doing a "cd rldir" moves into a directory that is an alias for the real directory.



The How To Geek Has the Details: Using Symlinks with Windows Vista


Thursday, 23 June 2011

Cyberduck FTP/SFTP/DAV Client also Available on Windows

I just wanted to mention today that my favorite FTP/SFTP/DAV client for the Mac is now also available for Windows. The same great interface and functionality as the Mac client. You can download the Windows client for free at:



Cyberduck Site



My initial testing with the Windows version has been very positive. So I suggest you check it out.

Command Line Aliases for Windows

Microsoft Logo

Over the years, I have used Mac OS X and Unix quite a bit for work. However, my current job requires me to work with Windows XP and Windows 7. The Unix Bash shell has an alias feature which allows you to create short commands for commonly used commands. For example, typically I will setup an ll alias for the ls -l command on Unix. However, Windows doesn't have an equivalent. Or does it?



I have found that you can set up Windows batch files to work just like aliases in Unix. For example, let's say I want to set up aliases for ls and ll (which my brain is always trying use anyway). With a text editor create files that look like this:



ls.bat

@dir /w %1 %2 %3 %4 %5 %6



ll.bat

@dir %1 %2 %3 %4 %5 %6



The "@" symbol prevents the command from being echoed to the console making the batch file act just like a normal command. The "%" numbers are command line parameters passed to your command. This allows you to type ls C:\ and still have the command work.



To use the files, they must be placed somewhere in the path. Either a directory you have added to the path or the C:\windows\system32 directory. Once you have done this you should be able use the commands to your hearts content. Here are some examples I typically setup for all my Windows machines.



c.bat - CD to the root of the C Drive

@C:

@cd c:\



home.bat - CD to the current users home directory

@cd %homepath%



Simple command files like these can save you a lot of time when you work with the command prompt a lot.

Monday, 13 June 2011

Windows 7 Tip: Turn off Auto Snap Maximize Feature

Microsoft Logo

I feel blessed to run across this fix today. Ever since I started using Windows 7, the number one thing that drives me crazy is the auto tile and auto maximize features known as aero snap. Examples of this behavior include:

  • Drag window to the top of the screen. Snap, the window is maximized.

  • Drag a window to the left side of the screen. Snap, the window takes up the left side the screen.

  • Drag a window to the right side of the screen. Snap, the window takes up the left side of the screen.

But what if you just want to drag a window to the top of the screen? Or hang a window out to the left side of the screen to look at two windows side by side? Then the aero snap feature is freaking infuriating. Especially on a laptop where you have limited screen space.



So here are the steps to turn it off.

(1) Click Start --> Control Panel --> Ease of Access Center --> Make it easier to focus on tasks

(2) Scroll to the bottom of the screen.

(3) Under Make it easier to manage windows

(4) Check: Prevent windows from being automatically arranged when moved to the edge of the screen.



No more surprises when moving to the edge of the screen. Yay!!!!!!!!



Please note that this also turns off the following key combinations:

Win+Up - Maximize

Win+Down - Restore / Minimize

Win+Left - Snap to left

Win+Right - Snap to right

Monday, 23 May 2011

Swap Control and Command Keys on a MacBook Pro Running Bootcamp and Windows 7

Apple MacBook and MacBook Pro laptops are some of the best laptops out there on the market. Not only great for running OS X, but with Bootcamp they make great Windows laptops too.



However, one annoyance with Windows on a Macbook is the tiny little Control key on the left side of the keyboard. When you cut and paste a lot of text, like I do, pressing Control-c or Control-v can be a little difficult. Not a problem when running OS X, since you use your Command key (right next the the Space Bar on a Mac). However, once in Windows you stuck with that little Control key. Or are you?



Recently I found out there is a way to make your left Command key function like the Control key.This is not a key swap, it is really just a key reassignment. So the right command key still works like a the Windows key. But after making this tweak, your left Command key works just like the Control key making your cut and paste keystrokes a lot easier.



The key reassignment is done in the registry. However, since mere morals don't really want to work with the Registry and its nasty hex codes, there is a utilty to do this. Download Sharpkeys 3.0 from here and read the explanation of what it it does from RandyRants.



To reassign the key, start SharpKeys and click add your dialog looks like this:



Chose the left Command key as the "from" key (note in Windows it shows up as the left Windows key). And choose Control as the "to" key. Click OK.



Any reassigned keys are listed in SharpKeys in case you ever want to remove the mapping. Click on the "Write to Registry" button when you ready to make the changes to the Registry.





That's it, the changes have been written to the Registry. Logoff and log back in or reboot. Now you can cut and paste in Windows with your thumb instead of your with your little finger. Absolutely wonderful stuff! Enjoy.

Thursday, 19 May 2011

du Utility for Windows

Microsoft Logo

There are a lot of really cool utilities built into Unix. Found another today that has been ported to Windows. Check out the Windows version of du. Download it for free from Microsoft Technet:

Disk Usage v1.31



Very fast and useful to have for the command line.

Tuesday, 5 April 2011

Want to run Android on your Windows 7 Desktop?

Well you could install the Android SDK. Or you could get bluestacks.com's Android Virtual Machine. Here are the details.

BlueStacks offering Android virtualization within Windows, harmony for one and all -- Engadget



The web site doesn't seem to work yet, but the idea is very interesting. We needs a Beta!

Tuesday, 22 March 2011

Where is the Insert Key on Mac Metal Chiclet Keyboard?

I ran into a problem this morning. I needed to edit the command line in Windows 7 and insert some text. On a Windows/PC keyboard this is easy, just hit the Insert key.



However, I am using a MacBook Pro with an Apple brushed metal chiclet USB keyboard. There is no Insert Key. On older Mac Keyboards you could just use the Help key. But there is no Help key. lol. The answer is in the help documentation, but its buried deep. So here it is.



Insert Key on Mac Keyboard

Old Mac Keyboards: Help key

New Mac Keyboard: Function-Return



You could call it Function-Enter too, but my keyboard says "Return" on the enter key. Anyway, works like a champ for me. Thought I would share to save some other people a little time.

Monday, 21 March 2011

This is the MacBook Air Alternative You've Been Looking For: Lenovo X120e

Yes folks, this is the MacBook Air alternative you have been looking for.



Lenovo X120e



Ever since the MacBook Air came out last fall, I have been looking for a comparable PC alternative. Don't get me wrong, the MacBook Air is a wonderful machine. Fast, amazingly light, and elegant, the Air has everything you want in a laptop. However, after configuring the Air with everything I want, the machine costs north of $1500. Ouch!



The Lenovo X120e provides a PC/Windows 7 alternative. With models starting at $399 and $449, the X120e provides a lot of the bang for the buck. Features include:

  • AMD Fusion E-240 or E350 Dual Core Processor with build in GPU (Deep Dive into Processor Here)

  • 11.6" Matte Screen. Yes folks a matte screen! (For those of us who use our screen for reading and not combing our hair.) The 1366x768 resolution screen is sharp and clear.

  • At 2.93 lbs, its super light. Not quite as light as the 2.3lbs of an Air, but close enough.

  • Super responsive keyboard. This is the nicest ultra-portable keyboard I have encountered. A springy feel and a really nice layout.

  • Battery life is really good. About 3 hrs on the 3 cell and twice that on the 6 cell. With the included utilities, power consumption is very configurable. So you can get a little more life or a little less depending upon the configured power consumption.

  • A really solid feel to the system. Everything feels sturdy, from the keyboard to the screen hinge.

  • Choice of Windows 7 32 bit or 64 bit.

So those are the highlights as I see them. The only feature I would like to see added is a backlit keyboard. But the Air does not have that feature either.



Anyway, if you are looking for an ultra portable laptop you can carry around all day on those long business trips, give this machine a look. I think you will like it.

Wednesday, 23 February 2011

HP redesigns and refreshes EliteBook and ProBook laptops -- Engadget

Microsoft Logo

HP gets down to business with redesigned and refreshed EliteBook and ProBook laptops (hands-on) -- Engadget



Engadget has the latest on HP's business line of laptops. If you are looking for a nice solid laptop with a matte finished screen, check these out. They may not be as sleek as a MacBook Pro, but they are just as functional and cost about $1000 less.