Tuesday, September 2, 2014

Audio Playback Stopped Working

Lately I have been experiencing an issue whereby for some unknown reason my audio playback will suddenly stop working. So far this has only happened after a period of non-usage (not during playback), and especially after waking my computer from sleep.

For awhile I thought the only way to resolve this issue was to restart my PC, but since I very rarely do this and usually have many windows open (serious multi-tasker here) I wanted to find a way to fix this without having to close down everything I'm doing to restart my machine.

After a bit of research and trial and error, I determined (through no help of Microsoft; this time anyway) that by restarting the following services I could resolve the issue.
  • Windows Audio
  • Windows Audio Endpoint Builder

I then wrote the following batch script to make this easier for myself in the future. This script will open a new command window, stop and start the above services, and pause at the end so you can verify the results if you like. Clicking on this link will open the text view of the file in a new window where you can copy paste into your own *.bat file or download the provided script. Or you can right-click "Save as..." to download directly. :)

Audio Svc Restart.bat

Cheers,
Matthew

Saturday, March 10, 2012

Windows Powershell? Yeah, not so great!

So I was looking for an easy way to copy and rename a batch of files using a script that I could share with my friends. I was going to go old school and just write a batch script to do the job, but I thought, "hey, it's 2012 and I'm a developer, I might as well give Powershell a try." Boy was that a mistake.

After several hours of tinkering around I have yet to find a viable solution to make the script easily run on my friends' machines after it being downloaded from the internet. Maybe I'm going about this the wrong way, but I've already signed it using a custom PGP certificate that I created using Kleopatra. I also set my "ExecutionPolicy" to "AllSigned" as recommended several other bloggers. Heck I can't even get the blasted thing to run on my local machine.

Making this ridiculously difficult just to write a simple freaking script that I can share with my friends to help them out is just silly. I could have written a widget in VB.NET in half the time I put into researching Powershell that would have accomplished the same task and without having to worry about all this digital signature garbage. Just compile, zip, send, and run.

The moral of the story is that I've decided to avoid Powershell like the plague. Hopefully I'll never need to mess with it because it just gives me a massive headache thinking about digital signatures. I'm not a security expert, so this stuff is just a bother; and that's why I'm not an admin; I just develop data-driven web applications.

Tuesday, October 11, 2011

File & Protocol Disassociation

Ever wanted to disassociate (i.e. delete an association) a "Default Program" from a file or protocol but didn't know how? Unfortunately Windows 7 hasn't exactly made this process very user friendly as the solution required diving into the registry.


Warning: It's always a good idea to backup your registry before deleting things from it. Simply right click the folder icon and choose "Export" to backup everything that is a child of that node. Or choose it from the "File" menu to backup the entire registry (~200+ MB, so not recommended :P ). Deleting things from the registry if you don't know what you're doing can make your computer unable to boot into Windows.
For 1337 users: If you're confident in your skills, in Windows Registry just go to the path mentioned in the following paragraph, and delete the "String" value for the association you wish to eliminate.


Enough of that, let's continue. Here's what I have. I've accidentally selected Chrome as my default program for my "mailto" protocol. All "FileAssociations" and "URLAssociations" are stored in the following path in your registry: "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Clients\
<ClientName>\<AppName>\Capabilities\<FileAssociations | URLAssociations>"
-- "FileAssociations" folder contains file extension (or file type) associations.
-- "URLAssociations" folder contains protocol associations.

Notice the correlation in the screenshots below between the protocols belonging to Chrome and the "String" Value items in the URLAssociations list within the registry:

WINDOWS REGISTRY - BEFORE DELETING REGISTRY ASSOCIATION

DEFAULT PROGRAMS BEFORE DELETING REGISTRY ASSOCIATION

Notice that I still have my "mailto" association. Now I'll walk you through the steps of deleting it. You don't actually need to open Default Programs, but you can to confirm if you like. To do so, click Start -> Control Panels -> Default Programs -> "Associate a file type or protocol with a program."

The place to delete this association is in the registry at the above mentioned path (note the path in the footer of the Registry Editor window). Open the Registry Editor by clicking Start, then typing "regedit" in the search bar and hitting enter. Next navigate to the path show and delete the "String" value with the name of the protocol or file extension you wish you delete. In this case, I'm deleting my "mailto" protocol association, so I'll be looking in the "URLAssociations" folder as mentioned above. Now let's delete that booger...

WINDOWS REGISTRY DELETING THE "mailto" PROTOCOL ASSOCIATION

WINDOWS REGISTRY AFTER DELETING REGISTRY ASSOCIATION

DEFAULT PROGRAMS AFTER DELETING REGISTRY ASSOCIATION

Notice that the "mailto" protocol is no longer listed. We've successfully deleted the assocation. No restart required :)

Thursday, September 22, 2011

New Website, Coming Soon

I've finally purchase my own domain. Unfortunately the crooks at buydomains.com has decided to hold ransom the domain I wanted, for nearly $4k. This is particularly surprising to me since only days prior there was no response for that domain indicating its nonexistence. My only guess is that these scoundrel domain squatting companies have some way of tracking hits to domains not yet registered. Perhaps they have deals with the DNS servers, I don't know. Anyway, let this be a warning to the rest of you. I wanted to cry, lol. I really liked the domain I had picked, but had no choice but to find another one.

Anyway, in my shopping around for a trustworthy domain registrar and host I found the list below. Most of them seem to have some garbage in their terms forfeiture of all rights to your own Intellectual Property and creations. I also want to ensure that MY domain is owned by ME, exclusively. I don't want some registrar trying to pull a fast one on me with my domain. I've included some brief notes about what I discovered. They are ordered roughly by credibility and trustworthiness.
  1. PJLHosting.com (my choice)
  2. InMotionHosting.com (A fantastic alternative, I chatted at length with their tech. Excellent reviews.)
  3. InternetBS.net (ICANN Accredited, registrar only)
  4. GreenGeeks.com (out) - A few too many bad reviews :(
  5. WebHostingHub.com (out) - A few too many bad reviews :(
  6. HostGator.com (out) - A few too many bad reviews :(
  7. DNSCentral.com (out) - registrar only, non-accredited
These hosts had some super shady Service Agreements. I won't even mess with them. 
  1. NameCheap.com (out) - Same as NetworkSolutions below; same article too.
  2. NetworkSolutions.com (out) - Article 6 of their Service Agreement, ARE YOU FREAKING KIDDING ME?!
  3. Enom.com (out) - Shared domain ownership? Ahhhmmm NO!
Anyway, I hope to have my site live within a few weeks. If you're interested in my new domain, shoot me a message, otherwise I don't plan on linking from my blogs as I will maintain that site separately. As always, thanks to all my readers :)

~Matthew

Sunday, March 13, 2011

Wake-on-Lan (WOL) for Windows 7 Made Easy!

This was such a nightmare to troubleshoot that I just had to document the process. In my scouring the web, I found many like me experiencing the same woes in setting up their WOL. My whole purpose for doing this was in the interest of saving power. I could put my computer to sleep and still be able to wake it up remotely so I can RDP (Remote Desktop Protocol) into it to access my files while away. [EDIT: I recently found this great article on WoWLAN by Andrew vonNagy which details some of the benefits and downsides to using this technology, and provides a nice cost analysis for an organization case study. Check it out if you're interested in the Wireless WOL.]

There are numerous steps to the process, so I'm first going to outline all of them to give you a nice overview of how to get setup. Henceforth I will refer to the Wake-on-Lan capability as WOL. Here is a zipped file with shortcuts to all the Control Panels you'll need for your convenience. It also contains a script for the WOL utility linked at the end of this article. ;)

COUPLE QUICK NOTES BEFORE WE BEGIN
  • WOL ONLY works for Ethernet (i.e. hard-wired) connections, NOT Wireless!
  • You must use the MAC address of you Ethernet card.
  • Orange bullets relate to enabling WOL feature / services.
  • Green bullets relate to the actual routing of the packets to your computer.
  • Things you'll need to know about your computer: LAN IP, WAN IP, and MAC address. Real quick, hit Windows key + R and type 'cmd' then enter. In the console type 'ipconfig /all' and enter. Look for your "Ethernet card" and write down its IP (i.e. LAN IP) and MAC address. Then head to whatsmyip.org to get your WAN IP and write it down as well.
  • This guide is designed so you don't have to read everything, but only refer to the sections where you're stuck or having issues. The troubleshooting tools at the bottom can help you deduce what is wrong.
OUTLINE
  • Enable WOL in BIOS (from boot)
  • Enable WOL for your Ethernet Card (i.e. NIC)
  • Install Windows Feature "Simple TCPIP services"
  • Start Service "Simple TCP/IP Service" (enables ports 7 & 9)
  • Open UDP for Port 9 in Windows Firewall
  • Forward the port on your Router
  • Testing / Troubleshooting Tools
ENABLE WOL IN BIOS
Because of all the various motherboards out there, I'm not going to go into how to enable WOL in your BIOS, only know that you need to. However, if your BIOS, like mine, is severely limited in settings and no option is available to enable WOL, it might be safe to assume that it will work by default. My HP laptop has many of the BIOS settings locked for warranty purposes, but despite not having the option available, I am still able to use the feature.

ENABLE WOL FOR YOUR ETHERNET CARD (I.E. NIC)
Open "Device Manager" from the control panels or use the link in the zip. Expand "Network Adapters" and find your Ethernet Card. Right-click and open "Properties" then go to the "Advanced" tab. You should see something similar to the following. You want to enable "Wake on Magic Packet" or something similar.



INSTALL WINDOWS FEATURE "SIMPLE TCPIP SERVICES"
Open "Programs and Features" from the control panels or use the link in the zip. Click "Turn Windows features on or off" over on the sidebar. Scroll down and check "Simple TCPIP services" then click OK to install the feature.


START SERVICE "SIMPLE TCP/IP SERVICES"
Open "Services" from the "Administrative Tools" control panels or use the link in the zip. Scroll down to the service for which we just installed the feature. Make sure the service is started by clicking the link in the sidebar. Also ensure that the "Startup Type" is set to "Automatic" so that it will run with Windows.


OPEN UDP FOR PORT 9 IN WINDOWS FIREWALL
Open "Windows Firewall" from the control panels or use the link in the zip. Only UDP is needed, but you can if you with open the port for TCP as well. This is because UDP is a broadcast packet which can always be received by your NIC, whereas TCP requires the computer to be powered up. This can also be set to limit the IPs which can use the port and other security features to make your computer less vulnerable. These are the easiest settings.


FORWARD THE PORT ON YOUR ROUTER
You should see your routers' manual for the details, but here are the basics. Your router IP is almost always 192.168.1.1 or 192.168.0.1. Enter your router IP into the address bar in your web browser (Chrome ftw :P) and login to the admin page. Once there, you will find a section called something like "Advanced." What you are looking for is the "Port Forwarding" section. Make sure you forward port 9 to your LAN IP that we got earlier.

TESTING / TROUBLESHOOTING TOOLS
  • wakeonlan.me - Can auto send you magic packets on a schedule though the schedule is messed up. I had to set the schedule time to EST while keeping the timezone set to my timezone. It's quirky, but it works. When you get the schedule set correctly is should tell you how many minutes before it sends the packets at the top. Alternately you can use another computer on your LAN to test it, but be sure to use your computers' WAN IP address to ensure it actually works from outside your LAN.
  • Wake-on-LAN Packet sniffer v1.1 (direct download) - This nifty little free tool was incredibly useful when paired with the above site to verify that the magic packets were actually getting through to my computer.
  • Wake-on-LAN Utility (direct download) - This is what you'll be using from your remote location to send the magic packet which will wake up your computer. There are other utilities like this available, but I like this one. It's simple. I will also include a batch script in a separate zip which will make your life easier. You'll only have to edit the script to put your computer MAC and WAN IP.
  • whatsmyip.org - The indispensable tool for ensuring that your port is open to the outside world. Will only show open TCP ports. Not UDP as is used for WOL.
READER SUGGESTIONS
  • Android app with excellent reviews called "Wol Wake on Lan Wan" by Brobble, available on Android Market. (thanks to Emad)

Updated 15-Jan-2012
Fixed broken link to download my script pack. Thanks Anonymous chat user :)

Sunday, January 23, 2011

How to Minimize Skype to Windows 7 System Tray (Notification Area)

This is a paraphrase concerning Skype, from the original article at mydigitallife.infoAll credit for this article should go exclusively to the original author. The purpose of re-iterating it here is strictly archival. Please thank the author for this excellent tip.

Changes in design behavior for Windows 7 causes many software applications to minimize (a behavior initiated by clicking the 'X' in some software) to the Taskbar instead of minimizing to the system tray (The area where the time and date are displayed in the lower right hand corner of the desktop; now called the notification area). You will notice this behavior in Skype 4.2 and newer.

Here's the workaround to minimize Skype to the notification tray on Windows 7.

Updated Skype Built-In Method
  1. In Skype, go to Tools -> Options.
  2. Then, click on Advanced tab to go to Advanced settings.
  3. Uncheck and untick the Keep Skype in the taskbar while I’m signed in option.
    Hide and Remove Skype from Taskbar
  4. Click Save button, and the Skype button or icon will be removed from Taskbar on minimize.
Note: You won’t see the option if the Skype is in compatibility mode.
Compatibility Mode Method
  1. Exit or quit from Skype program.
  2. Right click on Skype icon on Desktop or Skype shortcut in Start Menu, and select Properties.
    Skype Properties
  3. Go to Compatibility tab.
  4. Under “Compatibility Mode’ section, check and tick the checkbox for Run this program in compatibility mode for: option.
  5. In the below drop-down box, select Windows Vista (Service Pack 2).
    Run Skype in Vista Compatibility Mode to Minimize to System Tray in Win7
  6. Click OK.
  7. Start the Skype program, and now it should minimize to system tray.

Wednesday, March 17, 2010

Gadgets Toggle Script

I like a nice tidy desktop, but I also like to have access to my gadgets when I need them. I like to keep things efficient and fast too, so I went on a search for a script that would toggle my desktop gadgets on and off. This was what I found. It works really well too, though I made just a few cosmetic tweaks to the code.

http://www.wiseontech.com/hack/quick-script-to-showhide-windows-gadgets