You are here


Windows: Turn off all your monitors via the command line

Submitted by Druss on Wed, 2021-11-24 19:26
  1. Create a batch file named turnoff.bat on your desktop.
  2. Open it and add the following line
    powershell (Add-Type '[DllImport("user32.dll")]^public static extern int PostMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::PostMessage(-1,0x0112,0xF170,2)
  3. Save the batch file.
  4. Run the file to turn off your screens.There will be a brief command-line window that pops up during execution.

Tested on Windows 10.

Windows: Continuously monitor network connections

Submitted by Druss on Thu, 2021-10-28 20:59

You sometimes want to check if a program that you've installed is doing anything funky. While you could install a full-blown packet analyser like WIreshark, sometimes, that is overkill. A quicker and handier option would be to just rely on good old netstat. Like so:

netstat -bn 10

as well as

netstat -bf 10

-b: displays the program name (executable)

-n: displays the IP address

-f: displays the resolved form of the IP address

Youtube playing OK in browsers, but other embedded videos do not

Submitted by Druss on Sat, 2019-03-30 23:23

On a fresh installation of Windows 10, I found that Youtube was working just fine, but other embedded videos on sites like Twitch and Reddit were not. I thought it had something to do with HTML5 or flash, but as it turns out, it was because I had chosen the wrong version of Windows during the installation process. Choosing Windows Professional N or, basically any N version, results in video issues primarily due to the lack of appropriate codec and DRM support. Even Netflix will very likely not play. This also affects all browsers.

Create a bootable Windows installation USB drive using Linux

Submitted by Druss on Sat, 2019-01-19 02:32

I needed to install Windows and downloaded the 4.7GB Windows 10 ISO from Microsoft's website. Since I only had Linux machines at my disposal (and no DVD drives), I had to look to install the ISO on a pen drive. While the purists advocated that I use dd to accomplish this, I found that getting the USB to be bootable was something of a chore. So I looked for a friendlier solution and this is what I found for Kubuntu:

Buzzing noise when using the front audio jack

Submitted by Druss on Thu, 2015-01-29 22:26

New Windows 7 system: When I plugged in my headphones into the front audio jack, I immediately started hearing a buzzing and whistling noise in the earpiece. When I switched to the rear audio port, this noise went away. MP3s played clearly on both ports albeit with the buzzing noise in the background when using the front port.

Running a program as an administrator in Windows (7)

Submitted by Druss on Sun, 2014-08-03 10:28

Running a program in "privileged" mode (i.e., as an administrator) is as simple as pressing the START button, finding the program, right-clicking its name, and choosing Run as administrator. (You can similarly also choose to Run as different user, but to get this option, you'll need to press SHIFT before the right click.) This should bring up Windows' pop-up asking you to allow the program to be run as administrator where you click Yes and Robert is your uncle.

Copy/pasting large amounts of text via a PuTTY terminal

Submitted by Druss on Sat, 2014-08-02 23:23

While transferring a file to a remote server is pretty easily done using PuTTY's sister program, pscp, sometimes one finds oneself to be too lazy to go through the steps required. Shouldn't it be possible to simply copy and paste the (text) file into a remote editor via PuTTY? It is and it works a peach. However, it does crack the shits every now and then complaining about the length of the clipboard (paste).


Subscribe to RSS - Windows