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

27 January 2016

Disable Chrome sign-in screen

Chrome has a logon screen that can become annoying. Instructions here provided the answer. To permanently disable it on Windows,
  1. Close out of Chrome. 
  2. Go to C:\Users\user-name\AppData\Local\Google\Chrome\User Data\Default\
  3. Open the Preferences file with Notepad (or other text editor).
  4. Search for "sync_promo"
  5. Initially, it will look something like "sync_promo": { "startup_count": 6}
  6. Edit it to this:
    "sync_promo":{"startup_count":6,"user_skipped":true,"view_count":4}
  7. Save the file.
  8. Exit the text editor.
  9. Open Chrome. Viola! No more annoying logon screen.

26 January 2016

Run a program on Windows startup

I had a shortcut to a batch file that needed to run on the startup of Windows 10 x64 Enterprise startup. All the various methods described (adding to the Startup folder, adding to regular Run key in registry) didn't work. Finally, this post on Stack Overflow solved the issue. This should work well on other versions of Windows too.

Because this is a 64-bit Windows, the change has to be made in Wow6432Node:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run
There, you can add a new string value, give it a name, and then double-click to edit it. Place the full path of the program in double quotes. If it's something requiring administrator privileges, on startup, Windows will display the UAC dialog.

08 April 2015

Memory issues with IISExpress process on Visual Studio 2015

Visual Studio 2015 comes with IIS Express, which enables the localhost to serve as a web server without having to set up the app in Windows IIS. I was building a C#/MVC/Bootstrap site that kept crashing IIS Express. Some research revealed that we can run the server in 64-bit mode: Just go to Tools > Options > Projects and Solutions > check the box for "Use the 64 bit version of IIS Express for web sites and projects."

Memory usage by IIS Express went from over 700MB to 8MB now. Much better.

11 September 2014

How to copy a WordPress blog to another Windows machine

Just ran into this today. A friend had a WordPress 4.0 blog set up on his Windows 7 machine across the country. I needed to continue development on it here. I assumed it would be as easy as a few exports/imports. Not so.

He exported the SQL for the blog in MySQL on his machine and zipped his entire WAMP server folder (usually the c:\wamp folder). I downloaded both, ensured my local WAMP server was running, and then ran the exported SQL on MySQL. Then I copied his uploaded WordPress blog instance, wpblog, from his WWW folder into mine.

I went to http://localhost:8080/. The WAMP server came up just fine (running on port 8080 to not conflict with IIS 7, which uses port 80 by default); however, I couldn't load the blog -- clicking it in the list of apps just brought up an error that it couldn't be found. What could be missing?

Well, a look into MySQL showed that it didn't have the wpblog database at all. Even though the exported SQL ran without error, it was run against the wrong database; the wpblog didn't exist. But this was only the tip of the iceberg, so to speak.

The WordPress data had hard-coded URLs (http://localhost/wpblog/) that wouldn't work with the port 8080 on my machine's WAMP setup (http://localhost:8080/wpblog/). To change these links on the data would have been quite a chore. I decided to stop IIS, so I could change WAMP to run on the default port 80 and address the issue with the links.

These were the steps to address the issues:
  1. Opened MySQL admin in the browser.
  2. Created the wpblog database manually via the UI.
  3. Clicked on the new database and opened the SQL tab.
  4. Pasted and ran the exported SQL from the friend's MySQL database. This created the tables and their data for WordPress to function (this included all the posts the friend had entered in WordPress).
  5. Went to Start button and typed cmd into the search box.
  6. This brought up cmd.exe at the top of the Start menu.
  7. Right-clicked cmd.exe and selected "Run as administrator".
  8. Clicked Yes on the User Access Control popup.
  9. In the elevated command window, typed net stop WAS to stop IIS. (You can use net start W3SVC to restart IIS later.)
  10. Opened the Apache configuration file (usually stored at C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf) with Notepad and changed the ports to ensure they pointed to port 80 and not 8080: Listen 0.0.0.0:80 and Listen [::0]:80
  11. Ensured I had successfully copied the wpblog folder (the WordPress blog instance in this case) from the uploaded wamp\www\wpblog ZIP file and placed it into my local wamp\www\ to make it an active app under the WAMP server.
  12. Restarted all the services on the WAMP server. Its icon turned green in the System Tray. (If it's yellow/orange, there's more than likely a port conflict.)
Now clicking the wpblog app on my WAMP server's home page brought the WordPress blog up with no issues. All the articles were there too. A successful migration!

Note that you don't need the entire WAMP server folder (which can be huge -- a GB or more). You just need the blog folder under the WAMP server's WWW directory. In this case, we didn't know so we copied the whole thing!

In addition to the above steps, you can use a migration plugin such as Duplicator to successfully move a WordPress blog, data and all, from one Windows machine to another. Additional help for the plugin can be found here. In our case, we didn't know about the plugin, so we used a more brute-force technique!