Tag Archives: Windows

What’s running on port 80 in Windows?

Trying to set up Apache on a server, something is hogging port 80, but very “helpfully” the Resource Monitor just reports “System” with PID 4…

However, some commands found in a StackOverflow answer and its comments were helpful:

netsh http show urlacl
netsh http show servicestate
net stop http

Note: Do not just run these commands blindly and turn off services (in particular you should probably answer N when the last one asks…), but use them to identify what service(s) might be to blame. Then do an intelligent decision on whether the service is needed or not, before you potentially stop it and disable it…

Using SSH keys with BitBucket/GitHub on Windows

Couldn’t get this to work, but now it does, so… time for another “note to self”. 🙂

Prerequisites

  • Git, obviously…
  • PuTTY, with puttygen, plink and pageant, to be exact…

Setup

  1. Open puttygen.
  2. Load your private key, or generate a new one and save it.
  3. Copy your public key (“Public key for pasting …”) to BitBucket/GitHub/etc.
  4. Open pageant
  5. Load your private key.
  6. Check that the key authentication works by running e.g.
    plink -v git@bitbucket.org
    plink -v git@github.com
  7. Point the GIT_SSH environment variable to plink.exe.

Now, as long as pageant is running with your private key loaded, it should work to clone, pull, push, etc. to/from both private and public repos. E.g. git clone git@github.com:example/some-private-repo.git.

Key here, for me, was the GIT_SSH variable that so many blogs, StackOverflow answers and forum posts failed to mention… Without that set, the plink check did still work, but git clone did not. It just failed with an authentication error. With that variable set it now works perfectly. 🙄🙂👍

Sources: makandracards.com, vladmihalcea.com

Manual WAMP stack

For future reference…

PHP

  1. Download an x64 Thread Safe zip from php.net.
  2. Read the note about Visual C++ Redistributable in the sidebar of that download page, and install the one required for your version.
  3. Unzip somewhere and add to PATH.
  4. Pick a php.ini and adjust as necessary (enabled extensions, etc.).
  5. In particular, make sure the following is not commented out:
    extension_dir = "ext"
  6. Check that it works:
    php --version

Composer

  1. Download the Windows Installer from getcomposer.org.
  2. Run the installer..
  3. Check that it works:
    composer --version

Apache

  1. Download the Apache Win64 zip from apachelounge.com.
  2. Read the note about Visual C++ Redistributable above the downloads on that download page, and install the required one.
  3. Unzip somewhere and adjust httpd.conf as necessary (paths, enabled modules, etc.).
  4. Install as service:
    httpd.exe -k install
  5. Start the service.
  6. Check that it works:
    start http://localhost

Apache with PHP

  1. Add the following to httpd.conf.
    LoadModule php7_module C:/path/to/php/php7apache2_4.dll
    <IfModule php7_module>
        DirectoryIndex index.html index.php
        AddHandler application/x-httpd-php .php
        PHPIniDir "C:/path/to/php"
    </IfModule>
  2. Add an index.php to your DocumentRoot for testing, e.g.:
    <?php phpinfo();
  3. Restart the Apache service.
  4. Check that it works:
    start http://localhost

MariaDB

  1. Download a Windows x86_64 MSI Package via mariadb.org.
  2. Run the installer.
  3. Optionally add some of the following to my.ini under mysqld section:
    ; Only listen on localhost
    bind-address=127.0.0.1

    ; Enable logging of queries

    ; (probably bad in production, but very helpful for development debugging)
    general-log=1
    general-log-file=queries.log
    log-output=file
  4. Restart the service, if you changed anything in the ini.
  5. Check that it works by connecting with HeidiSQL or any other SQL client.

How to repair broken user folders in Windows

Tried moving my Documents/Desktop/Music/etc folders to a Google Drive mounted via Drive File Stream. Seemed to work well at first, but after the first reboot Windows clearly wasn’t happy and kept complaining about not finding the Desktop or the Documents…

Possibly because that drive seems to be mounted a bit too slowly (i.e. happens a bit after one has logged in)? And/or because it’s just mounted in a way Windows doesn’t like?

Either way, here’s how to…

Fix

  1. Open up regedit.
  2. Go to:
    Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
  3. Update all incorrect values.
  4. Reboot.

That seems to have fixed it for me anyways…

Source: scottiestech.info

Windows 10 Default app removal

Just a note to self…

Remove

Get-AppxPackage *xbox* | Remove-AppxPackage
Get-AppxPackage *windowsalarms* | Remove-AppxPackage
Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage
Get-AppxPackage *windowscamera* | Remove-AppxPackage
Get-AppxPackage *windowsmaps* | Remove-AppxPackage
Get-AppxPackage *officehub* | Remove-AppxPackage
Get-AppxPackage *people* | Remove-AppxPackage
Get-AppxPackage *skypeapp* | Remove-AppxPackage
Get-AppxPackage *getstarted* | Remove-AppxPackage
Get-AppxPackage *zune* | Remove-AppxPackage
Get-AppxPackage *solitairecollection* | Remove-AppxPackage
Get-AppxPackage *bing* | Remove-AppxPackage
Get-AppxPackage *onenote* | Remove-AppxPackage
Get-AppxPackage *sway* | Remove-AppxPackage
Get-AppxPackage *messaging* | Remove-AppxPackage
Get-AppxPackage *phone* | Remove-AppxPackage

Get-AppxPackage drawboardpdf | Remove-AppxPackage
Get-AppxPackage freshpaint | Remove-AppxPackage
Get-AppxPackage SurfaceHub | Remove-AppxPackage
Get-AppxPackage flipboard | Remove-AppxPackage

List

Get-AppxPackage | Select-Object -expandproperty name

Reinstall

Get-AppxPackage -AllUsers| Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

Source: www.howtogeek.com

How to lower USB headphone audio levels on Windows

When connecting my headphones via a simple USB-plug, the audio levels are often way, way, too loud. Today I had to turn the Windows audio level all the way down to 2% for the audio just to be OK’ish. That’s not very usable, and also kind of scary…

Finally I found something to fix it!

  1. Install Equalizer APO
  2. Open up “C:\Program Files\EqualizerAPO\config\config.txt”
  3. Replace its contents with:
    Preamp: -30 dB
  4. And adjust that level as necessary…

Finally I can use the Windows audio levels, and also not be afraid of suddenly having my ears destroyed if the audio were to move up a percentage or two…