Missing Hibernate option in Windows 10 Power Options?

Is Hibernate option missing from the Power Options in the Control Panel like in the screenshot below?

Here is a way to restore the missing Hibernate option back to the Power Options.

How to Fix?

Click the Cortana Search box on your taskbar, type cmd, right-click on the Command Prompt and select Run as administrator.

Once the Command Prompt is launched, type in the following command to enable the Hibernate feature.

powercfg /hibernate on

Next, run the following command to change the hibernation file type to full.

powercfg /h /type full

Reboot your computer. You should see the Hibernate option show up in the Power Options now.

Enjoy!

Mounting NFS Share on Windows 10 & 11 with Write Access

It is easy to mount a drive from Linux NFS share on Windows 10 & 11 machines. To do that make sure you have NFS Client (Services for NFS) is installed from Programs and Features. Following is the command to mount the NFS drive. Note that this command will run on cmd (Command Prompt) and not on PowerShell.

mount \<IP_ADDRESS>\<PATH_TO_DIR>\ drive:

For example, if the IP address of the NFS share is 10.235.0.10 and the directory you want to share is /var/www and you want to mount it to your Z drive, then you can run the following command.

mount \\10.235.0.10\var\www z:

But when you mount the drive you can browse the files using your Windows Explorer but you cannot create new files nor edit any files. To get write access on NFS share you have to make a small change in Windows registry before mounting the drive. Follow these steps.

  1. Open regedit by typing it in the search box end pressing Enter.
  2. Browse to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default.
  3. Create a new New DWORD (32-bit) Value inside the Default folder named AnonymousUid and assign the UID found on the Linux directory as shared by the NFS system. This is the UID of the user that has the write access to that directory on Linux system.
  4. Create a new New DWORD (32-bit) Value inside the Default folder named AnonymousGid and assign the GID found on the Linux directory as shared by the NFS system. This is the GID of the group that has the write access on the directory on Linux system.Windows 10: Regedit NFS AnonymousUid and AnonymousGid
  5. Restart the NFS client or reboot the machine to apply the changes.

Now run the mount command and you will get the write access.

Deploy your first ASP.Net MVC App to AppHarbor

If you’ve been developing ASP.Net MVC apps lately you might be thinking some online or cloud based app hosting platform available as PaaS for Microsoft technologies specially for hosting ASP.Net MVC apps just like OpenShift, Heroku and other platforms are available for technologies like Ruby, Python, PHP, Node.js and even supporting CMS like WordPress. The good news for ASP.Net developers is that there is a PaaS platform available which you might already know. The platform is AppHarbor. AppHarbor runs over Amazon AWS and has some nice features that I won’t go into the details of. If you are interested in knowing how AppHarbor works you can see their page here.

Regardless of AppHarbor provides a decent service, new developers might still face some difficulty in deploying their applications to AppHarbor. Specially, if you are developing apps based on new Visual Studio 2015 templates like MVC. Their are different ways to deploy but I would follow below approach which in my opinion is good and provide auto deployment or in other words Continuous Integration (CI).

What you need?

We will be using following tools and accounts.

  • Visual Studio 2015 (any edition, I used Professional version)
  • ASP.Net MVC app created from VS2015 MVC template
  • GitHub repo for the app/project
  • Local git repo for app with remote repo set as your GitHub app repo
  • AppHarbor app

What’s not covered?

Our focus today is deployment of our ASP.Net MVC app to AppHarbor. Therefore, we won’t be going into the details of how application is created or its architecture, what’s new in Visual Studio 2015, what is MVC, what is Git and GitHub, and how to connect your GitHub repo to AppHarbor etc. We will assume that you already have all the pre-requisites and we will just focus what problems can we come across during deployment and how to fix them.

Deployment Steps

  1. Initialize a Git repo and connect it with your GitHub repo.
  2. Create AppHarbor app from your GitHub repo. Whenever we commit/push our changes to our GitHub repo AppHarbor will automatically fetches the latest push and build it. Upon successful build it will deploy the app on its server otherwise it will keep last successful build. This makes things very easy.
  3. Create an ASP.Net MVC application using Visual Studio 2015 MVC template.
  4. Add the packages folder to .gitignore
  5. Enable NuGet Package Restore. In VS2015 click Tools>Options and then select NuGet Package Manager and make sure both checkboxes are checked in this section.
  6. In VS2015 right click on project and click properties, then goto Build Events tab. In the Post-build event command line text area paste the following command.
    1. if not exist “$(WebProjectOutputDir)\bin\Roslyn” md “$(WebProjectOutputDir)\bin\Roslyn”
      start /MIN xcopy /s /y /R “$(OutDir)roslyn\*.*” “$(WebProjectOutputDir)\bin\Roslyn”
  7. Now commit and push your changes to GitHub.
  8. That’s it! AppHarbor will automatically fetch the latest version changes and build it and you can check your AppHarbor application on its URL.

What’s Next?

There are few things that you need to take care of specially related to security. This MVC app uses SQL Server Compact which isn’t a good option for production level apps. Secondly, your connection string or password to database must not be committed to public GitHub repo.

This post will just give you smooth start without any difficulties which I faced among other people that you can see in the resources section below.

If you think this was helpful or if I have missed anything please do let me know in the comments below.

Happy coding!

Resources

  1. https://blog.appharbor.com/2012/02/06/use-nuget-package-restore-to-avoid-pushing-packages-to-appharbor
  2. https://support.appharbor.com/discussions/problems/79727-error-msb3202-when-building
  3. https://support.appharbor.com/discussions/problems/78633-cant-build-aspnet-mvc-project-generated-from-vstudio-2015-enterprise#comment_37577678

Resolving error in installing any gem by Ruby

After installing Ruby installer you might need to install some gems. For example if you are developing with RedHat OpenShift you want to install ‘rhc’ gem to access remote files on OpenShift. To install ‘rhc’ you would run following command.

>gem install rhc

But you might get following error specially on Windows machine.

>gem install rhc
ERROR:  Could not find a valid gem 'rhc' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect retur
ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (
https://rubygems.global.ssl.fastly.net/quick/Marshal.4.8/rhc-1.15.6.gemspec.rz)
ERROR:  Possible alternatives: rhc

Solution

The problem is due to running over a secure (https) connection to rubygems.org. Look at the help for “gem sources –h”, remove the https version and add http://rubygems.org

Run the following commands to do this.

 

>gem sources --remove https://rubygems.org/
>gem sources --add http://rubygems.org/

And now you can easily install any gem.

Microsoft Windows 10 Great UI Changes

My first experience with Windows 8 inspired bafflement and frustration. But I walked away from my first few minutes with Windows 10 with a sense of jealousy. It looks like a significant improvement, and I want it on my PC right now.

Microsoft is launching Windows 10 as the new face of both Windows and eventually Windows Phone. At one point during Microsoft’s Tuesday press event, Terry Myerson, the executive vice president in charge of Microsoft’s OS group, called the new OS “our most open, collaborative OS project ever.” Collaborative, indeed. Microsoft is looking for user feedback, and what I demo’d on Tuesday may not be the same OS that customers receive next year.

Microsoft executives didn’t even characterize the system as an alpha; they referred to it as a “build.” So with Windows 10 tentatively scheduled to be launched around the middle of 2015, there’s quite a bit of time to change, remove or add features before the system launches.

windows10 tech preview start menuIMAGE: MICROSOFT
The Windows 10 Start Menu fues Windows 7 icons and Windows 8 Live Tiles.

That said, we can still point to various features that embody the new Windows 10 experience, and will almost certainly make the cut. These include the revamped Start menu; the new “task view,” virtual desktops and ALT-TAB features; windowed apps; and the new “snap assist” capability. Granted, I had a just a few moments to play around with each. But I quite liked what I saw, and if you sign up for the new Windows Insider program, you’ll have a chance to form your own impressions beginning on Wednesday.

The revamped Start Menu: clean, intuitive

I’m not wholeheartedly in love with the new Start Menu. Aesthetically, it looks like someone surgically conjoined the Windows 7 and Windows 8 experience. Move past that inelegance, however, and it’s darn useful. On the left, there’s a list of frequently used apps, along with shortcuts to PC settings, as well as your documents and pictures folders. At the bottom, there’s a shortcut to launch an “all apps” view.

On the right, the Live Tiles reproduce the functionality of the Windows 8 Start screen, with resizeable tiles that can dynamically show you how much unread mail is left. It appears that you should think of Live Tiles more like notifications rather than app shortcuts, although you can use them either way. Microsoft’s demo station had a large oversize tile showing the current calendar appointment, which seemed appropriate.

windows 10 start menu longMARK HACHMAN
If you want, you can resize the Start menu, increasing or decreasing its size and adjusting its position.

Also, if you want to resize the Start menu itself, you’re free to do so.

As some leaked videos foreshadowed, you can revert to the Windows 8 Start page, if you so choose. But that option wasn’t checked off, leading me to believe that most people would prefer the desktop experience.

A new Windows world: Task view, virtual desktops, and ALT-TAB

One of the Microsoft executives I talked to referred to the new “task view” as a “poor man’s multimonitor setup.” I can understand why.

Virtually all Windows users use ALT-TAB to quickly shuffle between windows. It’s a great way to move from one task to the next. That capability is still available in Windows 10.

windows 10 alt tabMARK HACHMAN
Using Alt-TAB to cycle through windows isn’t that different than Windows 8, but you can see more of what each window holds.

What’s different, however, is the new “task view” button. Down in the Windows 10 taskbar, third from the left, is a button that, when clicked, brings up an array of “virtual desktops.”

What’s a virtual desktop? Think of it as a virtual display.

If you’re running a multimonitor set-up, chances are you’re already allocating different applications to different screens: a browser window on one display, Outlook on another, and maybe a chat app on your docked notebook. But with Windows 10, Microsoft allows you to snap more than one app to a screen. So if you choose, you could fill a secondary monitor with an Outlook pane and a PowerPoint file that you’re referencing in an email to the colleague.

windows 10 taskbarMARK HACHMAN
The Windows 10 taskbar includes the Windows button, which launches the Start menu, the new Task View button, and the Search button. To the far right, the “underlined” apps show that they’re located inside a virtual desktop.

But if you have one monitor, tapping the task view button—or more usefully, Windows+TAB—swaps between desktops, which are displayed on the bottom of the display. So if you have a “project screen” with PowerPoint, a browser window, and OneNote all contained within it, you can swap to an entirely different virtual desktop, or workspace, perhaps with Facebook and Xbox Music. You’ll also notice the apps themselves are shown above the desktops themselves, so if you can’t remember what virtual desktop actually owned that app, you can just jump into it regardless.

There’s also a feature that may or may not make it to final release: On your taskbar, you’re probably used to instances of multiple browser windows stacked on one another. But in Windows 10, you may also see that app “underlined” by a horizontal bar, showing that it’s in a virtual desktop.

windows10 tech preview virtual desktopIMAGE: MICROSOFT
The new task view shows you your virtual desktops, and the apps contained within them.

For now, virtual desktops are a convenience, but they could also emerge as a security feature, allowing users to assign permissions to different ones. Microsoft officials wouldn’t tell me if they’ll be isolated from one another or “sandboxed” over time.

Snap snaps with Snap Assist and windowed apps

And what about Snap, the nifty little feature that fills half of a Windows 8 screen? That’s been improved as well. Every app in Windows 10 can be dynamically resized in a window, although it remains to be see how well this works in practice.

Windows 10 snap assistMARK HACHMAN
Snap a document to one side of the screen, and Snap Assist will suggest some others.

In Windows 8, apps can be snapped by clicking the Windows key and the left or right arrow, snapping them to the left or right of the screen. That fills half the screen. With Windows 10, up to four apps can be snapped per screen, maximizing your productivity.

What’s neat, though, is that once you snap an app, Windows 10 suggests another, similar app that you might want to snap next to it, from a small collection of windows. The feature is intended to save you the hassle of hunting about through menus to actually construct a virtual desktop. Time will tell whether these suggestions will prove useful, but it’s a good start.

You can see, however, that a number of different features—Snap Assist, windowed apps, virtual desktops—all flow somewhat organically into one another. I’m honestly interested to see what difference they make in my own daily workflow.

Last but not least: Search improvements

Windows 10 also adds a search button to the taskbar, moving the other major functionality of the Windows 8 Start page to the desktop environment. If you’re like me, you really don’t click icons on the Start page any more (or use bookmarks when searching the Web). Instead, “searching” for recent apps or documents is often quicker.

windows10 windows product family 9 30 eventIMAGE: MICROSOFT
Microsoft promises consistent experiences over a variety of form factors and screen sizes.

That approach is also found in Windows 10. Microsoft officials say that Search and File Explorer now displays your recent files and frequently visited folders, making finding files you’ve worked on faster and easier.

Granted, Microsoft’s Windows 10 demonstration was somewhat orchestrated to put its best face forward. But with potentially millions of eager Windows users prepared to bang away on it beginning Wednesday, any flaws will be quickly exposed. What’s refreshing is Microsoft is actually encouraging this, similar to the way in which “developers”—i.e., fans—were encouraged to take its latest Windows Phone builds for a spin.

Love it or hate it? Microsoft wants to know. But I think you’ll quite like Windows 10.

[This article was first published on PCWorld]

How can I test if mod_rewrite on my server is enabled and working?

Note that mod_rewrite can only be used with web server Apache. Follow the instructions below to check whether module mod_rewrite is installed and correctly configured on your server.

Create the file .htaccess and add these two lines

RewriteEngine on
RewriteRule ^testing.php$ modrewrite.php

This tells the web server to load modrewrite.php when testing.php is requested.

Create the file modrewrite.php with this line

<?php echo "mod_rewrite works"; ?>

Create the file testing.php with this line

<?php echo "mod_rewrite does not work"; ?>

Now use your web browser to load testing.php. If you see “mod_rewrite works” your server has a working mod_rewrite instance. If you see anything else, including an internal server error, your server is not properly configured for mod rewrite.

What J talked about in 2013

The WordPress.com stats helper monkeys prepared a 2013 annual report for this blog.

Here’s an excerpt:

The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 37,000 times in 2013. If it were a concert at Sydney Opera House, it would take about 14 sold-out performances for that many people to see it.

Click here to see the complete report.

 

How to set a new OneNote screenshot shortcut in Windows 8.1

Image representing Microsoft as depicted in Cr...

 

Since in Windows 8.1, the Window+S key is used for search, it overrides OneNote screenshot shortcut. For now, you can manually set a shortcut key to Windows + A for OneNote screenshot. You’ll have to change the shortcut key through your registry. (Note: Unintended changes in your registry can cause problems, so make sure you follow these instructions exactly.)

 

1. Use Windows + R to pull up this dialog, and type regedit.

 

regedit

 

2. Now in the folders on the left, navigate down this path:

 

HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\OneNote\Options\Other

 

Note: The path requires the specific version of Office. In the path above, 15.0 refers to Office 2013. If you’re using Office 2010, type 14.0 in place of 15.0 at the end of the path.  Replace 15.0 with 12.0 if you’re using Office 2007.

 

3. In the folder named Other, right-click the white space underneath the files in that folder and select New, then select DWORD (32-bit) Value.

 

DWORD dialog

 

4. In the text entry field that pops up, type ScreenClippingShortcutKey. You just created a new DWORD. (If you are in Office 12.0, this DWORD will already exist.)

 

5. Right click this DWORD and select Modify, then in the Value field, type 41.

 

Your new shortcut key has been assigned to Windows + A. Now log off and log on again and you should be all set!

 

Set up Microsoft Office365 email on an Android

  1. From the Applications menu, select Email. This application may be named Mail on some versions of Android.
  2. Type your full email address, for example [email protected], and your password, and then select Next.
  3. Select Exchange account. This option may be named Exchange ActiveSync on some versions of Android.
  4. Enter the following account information and selectNext.
  • Domain\Username Type your full email address in this box. If Domain and Username are separate text boxes in your version of Android, leave theDomain box empty and type your full email address in the Username box.

NOTE    On some versions of Android, you must use the domain\username format. For example, if your email address is [email protected], type contoso.com\[email protected] Your username is your full email address.

  • Password Use the password that you use to access your account.
  • Exchange Server Use the address of your Exchange server. If you’re connecting to your Office 365 email, use outlook.office365.com for your server name.
  1. As soon as your phone verifies the server settings, the Account Options screen displays. The options available depend on the version of Android on your device. The options may include the following:
  • Email checking frequency The default value is Automatic (push). When you select this option, email messages will be sent to your phone as they arrive. We recommend only selecting this option if you have an unlimited data plan.
  • Amount to synchronize This is the amount of mail you want to keep on your mobile phone. You can choose from several length options, including One day, Three days, and One week.
  • Notify me when email arrives If you select this option, your mobile phone will notify you when you receive a new email message.
  • Sync contacts from this account If you select this option, your contacts will be synchronized between your phone and your account.
  1. Select Next and then type a name for this account and the name you want displayed when you send e-mail to others. Select Done to complete the email setup and start using your account.

NOTE    You may need to wait ten-to-fifteen minutes after you set up your account before you can send or receive e-mail.

 

Windows 8.1 to launch in October

Microsoft today confirmed what had been widely rumored for the past week: Windows 8.1 will bereleased to the general public in October. Specifically, “starting at 12:00am on October 18th in New Zealand (that’s 4:00am October 17th in Redmond), Windows 8.1 will begin rolling out worldwide as a free update for consumers on Windows 8 through the Windows Store.”

Today’s announcement indirectly confirms what my sources have also told me, which is that Windows 8.1 has been officially is in escrow, awaiting the final, formal designation that it’s been released to manufacturing.

Update: A Microsoft spokesperson says Windows 8.1 has not yet been released to manufacturing. “Development of Windows 8.1 continues to be on track, and we expect to reach the RTM milestone and release Windows to our OEM partners in late August.”

In Microsoft’s partner-driven world, that’s an important milestone. It means the code is on its way to OEMs, who in turn can incorporate it into new hardware designs for shipment this fall. After a year of generally miserable Windows 8 sales, those OEMs could use some good news to drive holiday sales.

The most visible change in Windows 8.1 is the addition of a “boot to desktop” option, as well as significant changes to the Start screen and support for smaller form factors. (For A full list of changes, see “Windows 8.1 unveiled: will it change your mind about Windows 8?”)

Customers, though, are going to have to wait.

Why the lengthy delay (more than two months) between this milestone and General Availability? I’ve heard some conspiracy theories suggesting that this isn’t the realrelease and that Microsoft is still furiously swatting bugs between now and an October public release.

The actual reasons, I suspect, are more mundane:

First, hardware makers need time to tweak drivers and utilities for existing devices so that the upgrade process goes more smoothly. That’s crucial for devices that require firmware upgrades to work properly with the new code. On the Windows 8.1 Preview forums, I’ve read page after page of reports from frustrated Preview users who had either failed upgrades or problems with incompatible devices. OEMs can’t afford widespread issues for customers getting released code.

Second, Microsoft still has work to do on its first-party Windows 8 apps, especially the unified Windows communication suite that incorporates the Mail, People, and Calendar apps.

And finally, those few extra months allow time for some high-profile third-party developers to get on board with Windows 8 apps. Facebook, for example, is still missing in action on the platform.

There will also, of course, be fixes for the official Windows 8.1 code between now and October, released via Windows Update. But the update itself is locked down.

There’s no indication in today’s consumer announcement of when the Windows 8.1 code will be available for developers on MSDN, nor when the Enterprise edition will be available for general release. I’ve asked Microsoft for comment and will update this post when I hear back. Update: Microsoft declined to comment on either of these questions.

[Ref: http://www.zdnet.com/windows-8-1-to-launch-in-october-7000019387/]