You are here

cli

youtube-dl yt-dlp: download the best available format

Submitted by Druss on Mon, 2022-03-07 13:24

yt-dlp downloads the best available format by default. However, if you use something like

yt-dlp -F [video]

you might find that it's not necessarily downloading the format with the highest resolution. This might very well be because it is unable to handle the codec of the video format in question. To fix this, install FFmpeg.

However, this might result in the "best format" being in a codec that you don't want or your device cannot support. In my case, my TV can't handle newer codecs so I need to do something like this:

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

Finding out which DNS servers are currently being used in Linux (Ubuntu)

Submitted by Druss on Tue, 2020-12-08 21:23

So, I've been facing some DNS issues with my Ubuntu box and needed to do some debugging. While I was certain that my router was assigning the Google DNS servers (8.8.8.8 and 8.8.4.4) via DHCP to my machine, I needed to make sure that they were actually being used. Usually, I would be able to tell by looking at the output of /etc/resolv.conf oslt. However what I found in resolv.conf was

Linux: Computer immediately restarts after shutdown

Submitted by Druss on Tue, 2020-07-21 02:53

So I have a Xubuntu box, an old PC that was running Windows previously. All is peachy with the Linux install bar one thing: every time I shutdown the system, it shuts down fine, but immediately restarts again. This wasn't happening with Windows and appeared to be an issue particular to Linux or Ubuntu.

Freeplane hangs in Kubuntu 18.04

Submitted by Druss on Mon, 2019-03-11 17:58

Freeplane, a fork of the mind-mapping program, Freemind, works really well. Except for the fact that in my (K)Ubuntu installation, it sometimes hangs in the middle of editing a node. Once it becomes non-responsive, the only fix is to kill the process and restart the program. The version of Freeplane in Ubuntu 18.04 is 1.6.13. However, the current version (March 2019) of Freeplane is 1.7.7. So, it's highly possible that upgrading Freeplane to the latest version will fix this issue.

Pages

Subscribe to RSS - cli