Wikipedia:Reference desk/Archives/Computing/2019 November 19

= November 19 =

Virus in bios
I have a virus in bios on Windows 10 how can I remove virus from bios — Preceding unsigned comment added by Dq209 (talk • contribs) 15:24, 19 November 2019 (UTC)
 * That depends a lot on the BIOS. (These days we call it UEFI, though.) How did you find out that you have it? Bona fide BIOS viruses are relatively rare, are you sure this is not a boot sector or MBR virus? What resources and knowledge do you have in the way of computer maintenance and repair? Were you keeping backups? Elizium23 (talk) 18:44, 19 November 2019 (UTC)

Just found out according to the IT guy at work that it is a boot sector and not a BIOS virus so how can I remove a boot sector virus I have a backup as I automatically backup my computer weekly — Preceding unsigned comment added by Dq209 (talk • contribs) 19:48, 19 November 2019 (UTC)
 * If it's a work machine, get your IT bods to fix it. However, the best course of action will be to nuke it from orbit (full reinstall of Windows, and the restore you data). LongHairedFop (talk) 19:45, 20 November 2019 (UTC)
 * I don't even trust doing that. Replace the hard drive outright, or at least do a "secure erase" operation on it if it supports that. 173.228.123.207 (talk) 21:13, 20 November 2019 (UTC)
 * Boot sector virus means it's in the boot sector of the hard drive, which is just the first few sectors of the drive, nothing special about it. The BIOS follows instructions from that part of your HDD in order to start your operating system. You can still boot from a Windows install CD and overwrite it just fine, or boot a Linux live CD and zero out the boot sector. Be warned that getting rid of this virus will mean that the rest of your hard drive will be inaccessible, as if you wiped it all so make sure to have things backed up. If you need to access files, using a Linux live CD or USB stick to start your computer and copy the non-backed-up files should be fine, because the boot sector virus doesn't get loaded when not booting from the infected HDD and it's extremely unlikely you'll get infected with a Windows virus when using a Linux OS. You might also be able to fix it with fixmbr/fixboot or something like that (which fixes the boot sector and preserves data on the HDD), but that might still leave you with an infection if the OS is infected as well as the boot sector (which is likely). It's also possible that the virus has overwritten partition data in which case you might have to take it to a shop that does HDD recovery if you need those files.
 * TLDR: since you have things backed up (but verify your backup first before doing anything in case something went wrong with it!) the safe thing to do is to just overwrite the HDD with zeroes, which will wipe the boot sector as well. 93.142.92.186 (talk) 23:12, 20 November 2019 (UTC)
 * Needless to say, you'll need to boot a "known clean" system before cleaning your MBR. If you boot infected, you'll just reinfect the HDD as you reconstruct the MBR... Elizium23 (talk) 23:27, 20 November 2019 (UTC)
 * Naturally. If you aren't dual-booting, the easiest way is to boot from a bootable CD or USB. I think Windows install media should do the job: while re-installing Windows, delete the partition table of the infected HDD and recreate the partitions. I believe Windows install is smart enough to overwrite the relevant sectors completely. If you're extra paranoid, you can also boot from a Linux install DVD/USB and wipe the hard drive with dd (Unix). 93.136.107.126 (talk) 04:58, 21 November 2019 (UTC)

CSS question
In CSS, is it somehow possible to define a class that says "the immediate parent node of this node should get a 'width: 100%' attribute"? J I P &#124; Talk 22:58, 19 November 2019 (UTC)
 * In CSS there are no selector for a parent node. Ruslik_ Zero 10:11, 20 November 2019 (UTC)
 * If you are willing to use jQuery, it has a ":has" selector that lets you select an element(s) that has another element(s) - which would make the first element(s) a parent. 135.84.167.41 (talk) 15:12, 20 November 2019 (UTC)
 * It's more like "know how to" than "willing to". The system already uses jQuery. How do I use jQuery on the CSS? J I P  &#124; Talk 00:09, 21 November 2019 (UTC)
 * jQuery is an extension to JavaScript. You don't place it in your CSS. You place it in your JavaScript. When the page loads, you define things like CSS styles for elements. Because it is JavaScript, you can do more with it. Further, the element selector syntax is purposely identical to CSS to make it very easy to move from CSS to jQuery. 135.84.167.41 (talk) 13:09, 21 November 2019 (UTC)
 * Ah, so I use jQuery to find nodes with a certain class, use further jQuery to find their immediate parents, and finally use jQuery to apply a style attribute to them? J I P  &#124; Talk 20:42, 21 November 2019 (UTC)
 * That's one way. The ":has" operator lets you select elements that have a certain kind of child and do somehing directly to them. For example: $("li").has("ul").css("background-color","red"); will find all li elements that have a ul element in them and change the background color of the li elements to red. You could similarly ask for $("table").has(".bogo').css("width","10em"); to get all table elements that have a bogo class in them and change the width to 10em. 135.84.167.41 (talk) 15:28, 22 November 2019 (UTC)