Saturday, December 31, 2016

vba - Excel macro stopped working after Windows update kb4103729

Since Windows version 1803 update kb4103729 my Macro for generating a pdf of and mailing an invoice stopped working. It's a Macro with multiple commands in it and references to both the worksheet and a destination folder (see below).



I've checked all the references and ran all the solutions I could find here: deleting all .exd files, and changing the language settings for running VBA code (the update affects language packs and I'm running a Dutch version of excel). I hope someone can help me on this one.




The issue seems to be specific to this Macro (all versions I have of it, one for credit notes and two for invoices in other languages, are affected, but not the other Macros). It keeps giving me the second error box ("Not possible to create the PDF, possible reasons:...").



Here's the Macro:



Sub Create_PDFmail()
Dim FileName As String



If ActiveWindow.SelectedSheets.Count > 1 Then
MsgBox "There is more then one sheet selected," & vbNewLine & _
"ungroup the sheets and try the macro again"

Else

FileName = RDB_Create_PDF(Source:=Range("A1:F39"), _
FixedFilePathName:="C:\Users\woute\SharePoint\CareerCoach - Admin\Boekhouding\Verkoopfacturen\CC Factuur " & ThisWorkbook.Sheets("Template").Range("Template!E11").Value & ".pdf", _
OverwriteIfFileExist:=True, _
OpenPDFAfterPublish:=False)

'For the selection use Selection in the Source argument
'FileName = RDB_Create_PDF(Source:=Selection)


'For a fixed file name use this in the FixedFilePathName argument
'FixedFilePathName:="C:\Users\Ron\Test\YourPdfFile.pdf"

If FileName <> "" Then
RDB_Mail_PDF_Outlook FileNamePDF:=FileName, _
StrTo:=ThisWorkbook.Sheets("Template").Range("Template!H2").Value, _
StrCC:="", _
StrBCC:="", _
StrSubject:="factuur " & ThisWorkbook.Sheets("Template").Range("Template!E11").Value, _
Signature:=True, _

Send:=False, _
StrBody:="Beste " & Range("Template!H3").Value & ",

" & _
"In bijlage vindt u de meest recente factuur voor de dienstverlening " & Range("Template!B12").Value & "." & _
"
" & "...Bunch of body text" & _
"

Else
MsgBox "Not possible to create the PDF, possible reasons:" & vbNewLine & _
"Microsoft Add-in is not installed" & vbNewLine & _
"You Canceled the GetSaveAsFilename dialog" & vbNewLine & _

"The path to Save the file in arg 2 is not correct" & vbNewLine & _
"You didn't want to overwrite the existing PDF if it exist"
End If
End If


End Sub

Friday, December 30, 2016

windows - Batch file for starting powershell in a specific directory



I am learning to program in python through the book "Learn python the hard way".
Therefore I use powershell to run my programs.
Since I had to manually change the directory every-time I started powershell , I wrote a batch file to automate it.



The command I wrote is :



powershell.exe -noexit -command "'cd c:\self\pooja\"edu n career"\programs\python'"



The problem is that it runs but opens the directory of "programs" only.
Why is it not changing to python directory?



Finally , I did it by setting the "Start in" field in the shortcut property of powershell but I want to know why the batch file is not working as expected.


Answer



Close Nate, but that doesn't work when I run it on a "New Folder". Had to move the CD outside the single quotes to make it work.



powershell.exe -noexit -command "cd 'c:\New folder'"
powershell.exe -noexit -command "cd 'c:\self\pooja\edu n career\programs\python'"


windows - Connect "monitor-less" computer to a laptop with a cable

The idea is to connect both computers using a VGA cable and make my laptop's VGA port receive the image from my desktop computer. Is there a way to do it?


Specs:



  • OS: Windows 7 (desktop) / 8 (laptop)

  • Graphic cards: NVidia GeForce


Please tell me if I need to mention more details or explain further.


Thank you.


EDIT: I can use my desktop computer by borrowing a monitor but I don't have a permanent one for it
EDIT 2: In the end, I want to open my desktop computer without needing a monitor (since I don't want to buy a new one because it takes money and space...). I alse have RG-45 cable so a network solution is welcome too.

How to inspect / view an Excel macro before "enabling macros" for a sheet?


I'm receiving occasionally an xls file that contains a macro which I should use. If I don't have complete trust in the sender, I wish to look at the macro's source in order to verify that it indeed does only what it is supposed to.


However, in Excel 2010 the "edit" button under "view macros" is disabled unless I first enable macros for the sheet - but if I first enable macros then I can, at most, find out about malicious code only after that code has finished running...


How can I view the macro's source before enabling macros for the document?


Answer



You can have a look at all macros in a document by using the Developer tab in Word to give you easy access to the Visual Basic routines embedded in the document.


First you need to make sure that the Developer Tab is enabled. Go to File -> Options then:


developer tab


On the Developer Tab that should now appear there should now be a "Visual Basic" button which you can click to get to the Visual Basic editor.


Browsing through the document tree on the left of the editor you should be able see all the code and modules that are embedded in the document without first needing to enable macros.


I tend to do this with documents I do not trust.


Note: I've done this in Word, the same feature is available in Excel and the option to enable it is in the same place.


boot - unable to install windows and remove manjaro




I have Manjaro installed on my pc and now i want to remove it and install windows 7. made a bootable usb and tried installing. but getting many errors. i tried both GPT and MBR partition scheme. in boot options tried both Legacy and UEFI with secure boot on and off.



the error i get is " A required CD/DVD drive device driver is missing. If you have a drive floppy disk, CD, DVD or USB flash drive, please insert it now."\



NOte: if the windows installation media is in the CD/DVD drive, you can safely remove it for this step.



that bootable usb works effectively on existing windows pc.



I tried both front and back usb ports.




i dont know any linux. kindly explain in detail please.


Answer



If your ports use USB 3.x, then Windows 7 cannot use them, as it lacks USB 3.x
drivers.



Go into the BIOS, into a section that might have a name like
"System configuration".
Select "USB 3.0 Configuration in Pre-OS" or similar, and change it from "Enabled"
to "Auto". This allows the USB ports to function as USB 2.0 during boot,

but once the OS starts they will be switched to USB 3.0.
You can set this back to "Enabled" after you have installed the OS.
Do not forget to hit "Save and exit" to finish the BIOS setup.



If you have USB 2.0 ports, using them will also solve the problem
without changing the BIOS settings.



If your USB hardware is the "Intel® USB 3.0 eXtensible Host Controller",
the driver may be downloaded
from here,

for installation after Windows 7 is completely installed.


How to organize a hard drive for Linux/Windows sharing?

I have Linux Mint 14 and Windows 8 installed (dual-booting) on my computer. I mostly use Linux but still need Windows sometimes.


Here's a screenshot of the output of sudo fdisk -l command:


SU528171 example
https://dl.dropbox.com/u/37485576/fdisk%20output.png



  • sda1: The 350 MB partition Windows 8 allocates (I still don't know why.)

  • sda2: Windows installation

  • sda3: My shared NTFS drive

  • sda5: Linux Mint 14 installation

  • sda6: Swap area for Linux Mint


Most of my files are in sda3 which I share between the two OSs (kind of like my backup partition). I can access it from both operating systems. However, sometimes my files get corrupted.


Example: I recently downloaded Eclipse and extracted it to a folder in sda3 drive in Linux Mint. It was working fine. Then when I switched to Windows, it asked me to repair my drives because there were some errors. I accepted, Windows did some scanning and restarted. When I switched back to Linux Mint, I noticed that Eclipse wasn't working. When I checked, most of the files in Eclipse folder were corrupted. Similar things happen the other way around as well. Sometimes I'm not able to see and/or open files in Windows that I created/downloaded in Linux Mint. I'm tired of losing files like this.


I know this can be a hardware issue too (my computer is kind of old) but if it is not, is there a better way to share a drive than I currently do (a separate NTFS partition for both)?


Edit after request


df -Th output:
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda5 ext4 14G 11G 2.5G 81% /
udev devtmpfs 2.0G 4.0K 2.0G 1% /dev
tmpfs tmpfs 785M 1.1M 784M 1% /run
none tmpfs 5.0M 0 5.0M 0% /run/lock
none tmpfs 2.0G 2.3M 2.0G 1% /run/shm
none tmpfs 100M 16K 100M 1% /run/user
/dev/sda3 fuseblk 201G 186G 16G 93% /media/mAt
uname -a output:
Linux mAt-VAIO 3.5.0-21-generic #32-Ubuntu SMP Tue Dec 11 18:51:59 UTC 2012 x86_64 x86_64 x86_64 GNU/Linu

x

64 bit - Installing Windows x64 on 32-bit UEFI (EFI-IA32) via GRUB

I am attempting to install Windows 10 x64 (64-bit) on a device that only has 32-bit UEFI (for the moment)


Since x64 Linux can be booted via a custom 32-bit GRUB.. I assume it could also do the same for windows, but "how to use grub to bypass a 32bit uefi to boot windows 10 x64" seems to indicate otherwise, though the explanation given does not completely explain why (to me at least).


I believe GRUB's 32-bit EFI SHOULD be able to load Window's 64-bit EFI.


Alternatively, is it possible to use grub's newish 'ntldr-mod' to run windows x64 install bootmgr? (howto start WINDOWS OS installation on hard disk with grub2)


This question will likely evolve based on the answers.


Answers/Comments regarding WHY will be flagged as off-topic. All i'm interested in is HOW. If your answer is 'not possible', PLEASE provide more info.


'Architectures must match' is not a valid answer.


reference links:


Possible to install 64-bit Windows on 32-bit UEFI?


Install Grub2 (with EFI-IA32 support) to the ESP partition from within Windows 8.1 (32-bit) - Bay Trail tablet


[Solved] Chainload Windows8 UEFI with Grub2-efi


Windows installed in UEFI-GPT Mode menu entry


Can't boot a 64bit Windows USB from a tablet originally installed with 32-bit OS


Installing Ubuntu 14.10 (64-bit) on a Windows 8 bay trail atom tablet


How do I repair grub2 (not) booting 32-bit EFI on a 64-bit machine?

formatting - USB flash drive write protected. Cannot reformat

I accidentally pulled out my USB flash drive while formatting. Now when I insert it, a window pops-up saying it needs formatting. But formatting fails because it says that the stick is write protected. I tried using disk part, low level formatting, command prompt using admin. Nothing worked.


Does anybody know another method I could try?

windows 10 - Virus added .mbed File Extension

The files on my PC's 2 drives have been altered by a virus; all files on both drives now have an extra extension of ".mbed"




Here you have a screenshot to get my point:
enter image description here



So what is the shortcut way for me to correct all these file extensions?

Thursday, December 29, 2016

hard drive - Why doesn't an SSD improve the speed of running applications compared to a HDD?

In articles/forums about PC gaming I always see people saying how Solid State Drives only make games load faster at startup (of the application) than they would with a Hard Disk Drive, and that an SSD doesn't improve the speed/performance of an application that is executing (after startup) in comparison to a HDD.
Now I imagine that the first part of this is because during application startup, the operating system needs to fetch all of the application's instructions from the disk, and load them into RAM. And since SSD access is a lot faster than HDD access, program startup with a SSD should be a lot faster than a HDD.




Now what I don't understand is how this doesn't also affect programs that are currently running, since the OS can move a running application's memory pages from RAM to the page file/swap space on the disk. When the running program needs to access a page that was moved to the page file/swap space, a disk read needs to occur in order for the page to be brought back into RAM to be used by the application. So wouldn't an SSD also provide a performance increase here too, as opposed to just in application startup?

malware - How can I indentify this invisible window on my desktop?

There's an invisible window of some application on my desktop and the only thing detectable about it is its borders as seen in the image below. The window or its edges are not clickable.


Desktop with invisible window borders visible


I'm guessing this could be some malware so I need to identify which application is drawing that window. So far, I've gone through the list of running processes in Task Manager to see if something looks suspicious and have scanned the PC with Malwarebytes Anti-Malware to no avail. I also tried using Process Explorer's drag over window tool and it just detects explorer.exe. Could this be a bug in explorer? I'm running Windows 10.

Wednesday, December 28, 2016

WMIC is NOT on Windows XP?


I recently installed Windows XP on a computer because I wanted to confirm some stuff with WMIC. What I wanted to confirm is not relevant to my problem. WMIC is NOT THERE. On Windows 7 I can type "WMIC" from the command line and it runs just fine. On another iteration of XP I typed WMIC and it had to install it, fine. I can't use it there because what I'm testing requires a format.


I've updated EVERYTHING and installed all service packs (first two than the unofficial four) but it's still not there! I did a search for the file, and it didn't find it. I went to the folder in which the file is supposed to be, and it wasn't there (Windows\System32\wbem). What did I do wrong? How do I install WMIC onto Windows XP?


Answer



Home versions of XP don't have proper/full WMI support, so the odds are the WMIC utility just isn't included, regardless of the SP or updates applied.


If you really need it, perhaps try taking a copy from an XP Pro machine.


hard drive - Avoid read-write access to bad sectors on HDD to continue working on the HDD


I have a HP Pavilion dv6446 notebook. It had Windows Vista Home premium. After 4.5+ years of usage, just recently it started malfunctioning. While working fine, its screen goes white or sometimes some thin black lines horizontally. Laptop freezes. Hard reboot works.
Again it works for some 2 hrs or so, same error.


To diagnose I did run the Memory and Hard disk check which is present in the Bios Setup.
Memory test passed. Hard disk test returned an error saying something like - "Replace the hard disk". Bad.. Some sectors or platters have gone bad on the disk. (I confirmed this later by further tests mentioned below)


Then I tried installing a Ubuntu 11.10. It listed 3 partitions /dev/sda1, sda2, sda2.
It again gave error and could not install grub loader on /dev/sda1. Bad sectors.
Then redid the Ubuntu installation, this time asked to to install the Ubuntu on /dev/sda3. and kept /dev/sda1 for /home. Installed fine, and works fine as well.


Due to unavailability of WiFi/ Ethernet driver for that adapters under Ubuntu( at least I could not configure them and get the networking working at all), I decided to go back to reinstall windows Vista.


It did install fine. I did not have to format one data partition which has my data. I just formatted one partition which installed Windows So in effect HDD has not undergone a full format here. Worked ok for 1 day. But same white screen and freeze happened. Looks like while it is in use, it accesses the bad sectors for storing some data and that's when it bombs.


I am inclined to think HDD has not failed fully or crashed but has developed bad sectors.
Else if it was a HDD crash, it would have refused to boot at all let alone install on it.


Questions:



  1. Is there any HDD test check under windows or any such tools windows/linux based ewhere which can identify the bad sectors of the HDD and 'lock/isolate' them from further read-write access of any kind.


  2. If not what are my options, if any to salvage this laptop HDD without replacing it.



EDIT:


Would the Disk Error checking tool under windows help in any way?


Answer



Modern SATA harddisks (and several decades old SCSI harddrives) detect bad sectors and reallocate the data to spare sectors. This usually happens without the user noticing it. Problems only occur after the drive runs out of spare sectors, but SMART should have allerted the user long before that happens.


(Unless you or HP turned S.M.A.R.T. off in the BIOS).


Sometimes you can force the drive to do one more set of by trying to write to all sectors. Including the broken ones. This will fail and the drive will know the sector is bad and willa void that sector in the future.


But realistically: read all the data from it that you can. Then get a new drive. Drives are replacable. Lost data is generally not replacable.


Tuesday, December 27, 2016

ubuntu - Mount VMWare Disk Images Under Linux

Is it still possible to mount VMWare disk images under Linux?



I found the following two articles, both of them recommend to use kpartx -av diskimage-flat.vmdk. However both the articles are old and, when I try it on my Ubuntu Utopic 14.10, it no longer works any more.



$ sudo kpartx -av MyWin81.vmdk

$ sudo ls /dev/mapper/loop* | wc -l

ls: cannot access /dev/mapper/loop*: No such file or directory
0


Disclosure: My VMWare disk image IS a flat disk image. Furthermore (before you recommend loop mount), it is a multi-partition disk image, with first partition being Window8 and next two in Linux. It is the next two Linux partitions that I'm more interested to work on.



Can someone confirm please? Thanks.



Mount Flat VMWare Disk Images Under Linux
http://cromoteca.com/en/blog/mountflatvmwarediskimagesunderlinux/




Mount a VMware virtual disk (.vmdk) file on a Linux box
http://www.commandlinefu.com/commands/view/12554/mount-a-vmware-virtual-disk-.vmdk-file-on-a-linux-box



UPDATE:



vmware-mount looks very promising, but I can't get it working yet:



$ vmware-mount -p Win81.vmdk
VixDiskLib: Invalid configuration file parameter. Failed to read configuration file.

Nr Start Size Type Id Sytem
-- ---------- ---------- ---- -- ------------------------
1 2048 78643200 BIOS 7 HPFS/NTFS
2 78645248 6039552 BIOS 83 Linux
3 84684800 41144320 BIOS 83 Linux

% vmware-mount Win81.vmdk 1 /mnt/tmp1/
VixDiskLib: Invalid configuration file parameter. Failed to read configuration file.
Failed to mount partition 1 of disk 'Win81.vmdk' on '/mnt/tmp1/': Insufficient permissions to perform this operation


% vmware-mount -L
VixDiskLib: Invalid configuration file parameter. Failed to read configuration file.
No mounted disks.

$ vmware-mount | head -3
VixDiskLib: Invalid configuration file parameter. Failed to read configuration file.
VMware DiskMount Utility version 6.0.0, build-2496824

Usage: vmware-mount diskPath [partition num] mountPoint



NB, the 2nd and 3rd command is run directly as root, yet I get "Insufficient permissions to perform this operation"?

extract - Extracting background images from a PDF file?



I have a PDF file containing maps of the building I work in, here:



http://www.libsys.und.edu/dev/FloorPlans_All.pdf



The original source files have been lost, and I've been asked to extract the map images, preferably without the text and icons that have been overlaid on top of them. This has proven annoyingly difficult.




So far, I have tried the following GUI programs:




  • Adobe Reader: lets me select text, but not the background images

  • FoxIt PDF Viewer: lets me select text, but not the background images

  • XPDF on Ubuntu 10.10: lets mes select text, but not the background images



And also the following command-line programs:





  • pdfimages: extracts the icons indicating bathrooms just fine, but not the background images

  • pdftohtml: same as pdfimages, plus it makes a poorly marked up HTML document

  • pdfextract: same as pdfimages

  • convert: successfully saved images, but with the text burned into them



I've even tried opening the PDF manually in a text editor and extracting the stream objects by pasting them into a new file and saving it with a .jpg, .png, or .bmp extension (each in turn). Considering how little I know about the internal structure of PDF files, it's no surprise that this didn't work.




So ... is there any way I can retrieve the map images from this thing without also getting the text and icons?


Answer



You can download the XPDF library from http://www.foolabs.com/xpdf/download.html for Linux and Windows. Then run pdfimages -j input.pdf output and you should get output-000.jpg, output-001.jpg, etc. Also, check out http://linuxcommand.org/man_pages/pdfimages1.html for more usage options.


Unable to boot a 64-bit Windows 7 even in safe mode

For the last 3 hours I've been trying to fix my laptop but I can't find anything.



Let me explain my problem: I recently deleted a Linux-type partition on my HDD which was about 100GB, then I tried to size up my Windows partition (with EaseUs Partition Master). The software told me that it have to reboot the computer and resize during boot. So well, why not, I rebooted, the software launched and displayed "Unable to mount drive" or something. Then the laptop rebooted again, and then... nothing.



When I launch Windows, it says that Windows can't boot and shows error 0xc0000225, that there are missing drivers and stuff, but no file is specified, and that I should pick my repair disc (which I haven't) and repair Windows. I don't have any installation disc either for my version, Asus isn't giving them.

Monday, December 26, 2016

ssd - No discs found when trying to install Windows 8 with UEFI


I have a Vizio Notebook (CN15-A5). It came pre-installed with Windows 8 x64 and is taking advantage of UEFI out of the box. The BIOS (APTOS AMI) is in Secure Boot mode with the OS selected as "Windows 8".


I removed the stock HDD that came with the machine and put my own SSD into it. I created a Windows 8 Pro x64 installation disc on a 4GB USB flash drive formated as FAT32 since its apparently required for UEFI.


When I boot from the USB Win8 installation disc, I get suck when I reach the "Custom: Install Windows only" section. Normally you would see a list of available discs and their partitions, however my entire list is blank.


If I head back to the BIOS and disable Secure Boot and set the OS to "Other OS" and attempt again, I am able to see the list of available discs in the system and can install a copy of Windows 8. Unfortunately, doing it in this method results in an installation with a traditional 350 MB partition + OS partition instead of 4 partitions which is normal for a UEFI setup.


Has anyone run into this problem? I've tried loading defaults in the BIOS and attempting to install via every combination with no luck. Any help would be appreciated.


Answer



After several hours of trying to solve this, I finally found a solution:


In Windows 8 launch an Admin Command Prompt:


diskpart.exe
list disk
select disk # (change # to value of your USB drive)
create partition primary
select partition 1
active
format quick fs=fat32
assign
exit

In Windows 8, I mounted the x64 ISO as a drive (a built in feature, just right-click). I opened the drive and copied the entire contents to the freshly formatted flash drive through the regular File Explorer.


I grabbed a 2nd flash drive and formatted it FAT32 as well. I downloaded the x64 .zip file containing Intel Rapid Storage Technology (RST) drivers from Intel Download Center. I extracted the contents of the .zip file to the second empty flash drive.


First I set the BIOS to "Windows 8" as the OS and enabled Secure Boot mode. I plugged in only the flash drive containing Windows 8. (Don't plug the 2nd flash drive containing the RST drivers just yet.)


When booting I hit F7 to launch the one-time boot menu and selected the my flash drive which should have a "UEFI" prefix before the name. After getting to the Windows 8 custom installation section and seeing no available hard drives, plugin the 2nd flash drive into another USB port and select "Load Drivers." Browse to the folder containing the RST drivers to proceed.


The Windows 8 installer will take a minute to load the RST drivers and you'll immediately see your internal drives afterwards. Delete every partition on the target drive if you intend to do a full clean install and hit next on the drive which will likely say "unallocated space." The Windows 8 installer will create all the necessary partitions for a proper UEFI configuration for you and complete the setup.


batch - Rename files using cmd and allow duplicates file name

I have my batch file which consists of the following command.


REN "H:\April2012\A04\mr_sudheendra_holla_vaderhobli.pdf.1335780379203.ver1" "mr_sudheendra_holla_vaderhobli.pdf"

But if duplicate files exist, the command will not execute. I would like my command to rename the file name to *(1).pdf and *(2).pdf etc. if there are duplicates. How can I do that?

Lifespan of an SSD (NAND Flash) for minimal write use archive purposes: Write once, toss in (proverbial or literal) storage closet


Okay, so I saw this other question which was closed as being too localized and I understand the idea of that closure: Systems, environments and usage are all different.


But my question is about using SSD for minimal write use, archival purposes. Meaning, instead of storing tapes, optical media (BluRay, DVD-R, DVD-RAM, etc…) or even a hard drive somewhere safe, what about SSD which uses NAND flash memory for storage? I assume the act of simply plugging in an SSD, copying data and then tossing the drive in safe/secure archival space disconnected from a system is a solid (no pun intended) way of storing long term data?


I have worked with institutions that routinely archive things on hard disk drives in such a way. But as we all know a hard disk drive is one drop away from being wiped out. SSDs seem inherently much more resilient. This 2014 article in PC World (“Grueling endurance test blows away SSD durability fears”) seems to state that modern SSDs—even those used on a daily basis—will outlast their own self-professed max lifetime.


The reason I am asking this now is SSDs on a very basic consumer level are very cheap nowadays with—for example—120GB SSDs going for as low as $40, I believe these things would be a good long term storage for things such as archived photos, videos and such… And will only get cheaper as time goes on.


Answer



SSD technology is rapidly evolving and SSDs have not been around long
enough for reliable statistics. I have dug around and found information
that indicates that SSD is not reliable as long-term shelf storage,
information that I will list below.


According even for my more general knowledge, much of the reliability and speed
of SSDs is due to the firmware. The firmware of an SSD does house-cleaning
tasks when it is not occupied with requests from the operating system.
These tasks include compacting data into blocks, refreshing bits
and continuously testing bits and mapping the doubtful ones to spare bits.
Actually, heavy-duty SSDs, also called "enterprise", are mostly distinguished
only by having a larger number of such spare bits.


These house-cleaning tasks are not possible when the SSD is stocked while
disconnected from power.


The Dell article of
Solid State Drive (SSD) FAQ (PDF) from 2011 states this :



Q: I have unplugged my SSD drive and put it into storage. How long can I expect the drive to retain my data without needing to plug
the drive back in?


A: It depends on the how much the flash has been used (P/E cycle used), type of flash, and storage temperature. In MLC and SLC, this
can be as low as 3 months and best case can be more than 10 years. The
retention is highly dependent on temperature and workload.


imahe



While SSD technology has much evolved since 2011, the above article is still
alarming. I note that it does not say that all the data will lost,
but only that some data lose may occur after some days, weeks or months.


A more recent 2016 paper from Google,
Flash Reliability in Production: The Expected and the Unexpected
(PDF),
is summarized in the article
SSD reliability in the real world: Google's experience.


Among the conclusions by Google are :




  • High-end SLC drives are no more reliable that MLC drives.

  • Bad news: SSDs fail at a lower rate than disks, but UBER rate is higher (UBER means Unrecoverable Bit Error Rate and is the percentage
    of bits that have errors relative to the total number of bits that
    have been read).

  • SSD age, not usage, affects reliability.

  • Bad blocks in new SSDs are common, and drives with a large number of bad blocks are much more likely to lose hundreds of other blocks, most
    likely due to die or chip failure.

  • 30-80 percent of SSDs develop at least one bad block and 2-7 percent develop at least one bad chip in the first four years of deployment.



The article concludes :



SSD UBER rates are higher than disk rates, which means that backing up SSDs is even more important than it is with disks. The SSD is less likely to fail during its normal life, but more likely to lose data.



Another 2015 article,
Hard Drives, SSDs, Flash Drives: How Long Will Your Storage Media Last?,
repeats the above data and adds :



Many SSD manufacturers will list data retention either as part of the specification or the warranty for their drives. The JEDEC Solid State Technology Association sets the industry standard at one year for consumer drives.



More alarming data comes in 2016 from Seagate’s Alvin Cox, who was part of a
presentation
to the Joint Electron Device Engineering Council (JEDEC),
picked up by
ZDNet,
Slashdot and other sites.


The ZDNet article about this presentation,
Leaving unpowered SSDs in a warm room can kill your data fast, says :



New research suggests that newer solid-state hard drives, which are faster and offer better performance, are vulnerable to an inherent flaw -- they lose data when they're left dormant in storage for periods of time where the temperature isn't properly regulated.


The worrying factor is that the period of time can be weeks, months, but even in some circumstances -- just a few days.


A recent presentation by hard drive maker Seagate's Alvin Cox warned that the period of time data is retained on some solid-state drives is halved for every 9°F (or 5°C) rise in temperature where its stored.


That means if a solid-state drive is stored in a warm room, say 77°F (25°C), its data can last for about two years. But, if that goes up by a mere few degrees to 86°F (30°C), that data's retention period will be cut in half.



The article
The Truth About SSD Data Retention
gives a more precise table for the calculated retention period in weeks before
errors, as a function of both the running and ambient storage temperatures,
for an SSD used by consumers (as distinct from enterprise) :


enter image description here


Keep in mind that the above table is only statistical in nature,
so that your particular SSD can do even better, or even worse,
than the above numbers.


My personal conclusion is that an SSD is a very reliable component when
placed inside the computer case on an external housing,
as long as it is regularly powered on and is not left unpowered
for a long period.


I would therefore not recommend SSD for long-term storage,
unless stored in the right temperature (which is what?)
and is regularly powered on, verified, and left powered on for a time
sufficient for the firmware to do its house-keeping
(which is how long?). SSD is not reliable enough for the long term
unless multiple copies are kept, which sort of defeats the purpose.
Much more reliable technologies than SSD exist for this purpose.


HP/IBM BLADE HW + machine not boot according to boot order

This problem happens on both an IBM blade & HP blade



I installed Linux 5.X on my HP blade from a PXE server. Linux installed successfully from the PXE.



I changed the HP Blade boot order so "hard drive" is before the "PXE NIC" order
so Linux will boot from the hard disk.



Although "hard drive " was before "PXE NIC", HP blade still boots from the PXE and not from the hard disk.



Note I disconnected the PXE LAN and the Linux booted successfully from the hard disk (but I not want to remove the PXE LAN from the blade)




Example of HP boot order after successfully installed linux



 CD-ROM
Diskette Drive (A:)
USB DriveKey (C:)
Hard Drive C: (*)
PXE NIC 1 (**)



example of HP blade boot order before I installed linux (downloading linux from PXE server)



   PXE NIC 1 (**)
CD-ROM
Diskette Drive (A:)
USB DriveKey (C:)
Hard Drive C: (*)


Can anyone suggest why this is happening?

windows 7 - Fix an unusable flash drive

Make a bootable Windows10 32 bit flash drive (size 4 GB) but it does not seem to be working. How can I restore it to its original factory state and make it a bootable drive? Thanks!


Things I have tried and what went wrong:



  1. Used Rufus tool to do the job, failed halfway, made the drive write protected.

  2. Then followed this guide.

  3. On the clean command, things went bad, diskpart exited and my computer started went to not responding.

  4. Things were stuck on flash drive being in write protected.

  5. After googling a bit, I further went into DiskPart and tried all sorts of formatting and clear commands. I was able to remove the write protection, tried it from my computer it was working. Tried to format it to NTFS. It broke again.

  6. Downloaded Bootice and re-partitioned it to FAT32. It was working again, but became write protected.

  7. Saw this thread. But it fails on the step, create partition primary.


The current state of the drive, as seen my DiskPart is:


1

How can I install TeamViewer on Windows x64?



I have downloaded the newest version 8.0.18051 of TeamViewer 8 from their website. It claims to be "compatible with Windows 8".



That may be true for a 32-bit OS, but I cannot get the downloaded setup.exe to install on either Windows 7 x64 or Windows 8 Pro x64. Win7 says it's not a Win32 application; Win8 just says "This app can't run on your PC".




However, I have TV 8.0.17396 running on my Win7 x64, because I upgraded it from an former TV7 version.



I have tried:




  • running in a compatibity mode

  • running as Administrator

  • turning off SmartScreen (Win8)

  • downloading TV7 and installing that




Please advise.


Answer



The usual reasons for Windows 7 reporting an exe as "Not a valid Win32 application" is for one of the following reasons:




  1. File is corrupt, bad, or missing.

  2. File is not designed for your version of Windows.

  3. File is a virus, worm, or other malware file.


  4. Hardware incompatibility.



It is most likely not option 2 as it is designed to run on Windows 7 and 8 - I'm running it on both OSes (64 bit)



3 is also unlikely if you've downloaded it from the Teamviewer website. Malware is possible if the code/site had been compromised but unlikely given the volume of users of this product who would have reported something by now.



4 is unlikely unless you have an underlying and undetected hardware issue.



If we look at the reasons for 1 we know your file isn't missing (it's not trying to run a pre-installed application with missing dependencies.) So we are faced with it being corrupt or bad - that is, the file hasn't successfully downloaded completely.




I've just downloaded the same version for Windows (I'm assuming the full version and not the portable version etc.)



Calculating the MD5 hash using WinMD5Sum on it I get the following:



46bc67b377a0c84b1174f51c6709b8ae


I would recommend running an MD5 sum on the version you've downloaded and compare with the code I've provided above. Unfortunately they don't provide a hash on their website to validate the exe downloaded is valid.


Are the installation media for Windows 10 Home and Professional different?

I'm going to install Windows 10 on a new notebook soon, and I tried to prepare a USB drive for installation. Unfortunately Microsoft has pulled the 1511 update for the media creation tool, and I need that update so that the old Windows Professional key will be recognized and I don't have to perform an upgrade first before doing a clean install.


You can still find the 1511 version of the media creation tool on various sites, I tried that but I only get the choice between the "Windows 10" and "Windows 10 N" editions. With the non-1511 tool directly from Microsoft I got also the choice for Windows Professional there.


Are the installation media for Windows 10 Home and Professional actually different? Or can I install Windows Professional with a USB drive created with the "Windows 10" edition selected in the media creation tool?

windows 10 - Creators Update and bcdedit change?

Does anyone know if creators update introduced changes to bcdedit? My searching hasn't turned up much yet.




However, a standard script that I used to get machines setup for a safe mode reboot no longer works on my creators mode rigs. However, it does work on some non-creators Win 10 machines nearby.



bcdedit /set {current} safeboot network


Error: "The set command specified is not valid."



Is there an option that might work for all Win 10 versions?

Sunday, December 25, 2016

Can I use my ASUS-provided Windows 7 key with new installation?


I have a ASUS laptop with Windows 7 Home Premium key in the back.


My recovery cannot be started for some reason, I wish I can find solution for it.


So my only option is to install a new Windows 7 Home Premium from the legally provided ISO images in the Internet.


Can I use the key with these ISO images?


If I cannot what are my options? Asus website said they cannot provide a recovery ISO for me.


Answer



If you have the COA sticker intact, use that Product key to reinstall W7.


The ISO you have must be one from Digital River so it will work with OEM Keys, other iso's from Microsoft only work with retail keys.


If you do not have a DR iso, you can use a Dell W7 disc to reinstall W7, it will install without entering a key, once at the desktop, change the product key to the one you have on the sticker, then it should Activate.


Dell discs are plentiful, ask a friend, neighbor or co-worker to borrow one, that or search eBay for one, as they are cheap.


linux - Screenshot cron job not working


I've been searching all over the internet for an aswer to this but can't seem to find anything that works for me.


I want to run a cron job that automaticly takes a screenshot every minute. The script look like this:


#!/bin/bash
cd /home/ville/Skrivbord/screenshot
import -display :0 -win root screenshot.jpg

The code works fine when manually executed but does not work when i run it as a cron job.


The cron file look like this:


* * * * * /root/bin/screen.bash &> /dev/null
* * * * * /root/bin/syncdata.bash

The other task, syncdata works fine.


Here are some of the things i've tried without success:


Change permissions on /root/bin/screen.bash and /home/ville/Skrivbord/screenshot to 777 and change owner to root.


Change filename to screen.sh (maybe there's no difference between .bash and .sh?)


Change the import line to "import -win root screenshot.jpg" and "import -display :0.0 -win root screenshot.jpg".


Added the code:


# Set display to :0 if it's not already set.
: ${DISPLAY:=:0}
export DISPLAY

One time above the existing code in screen.bash and one time below.


Changed the line in cron to "* * * * * export DISPLAY=:0 && /root/bin/screen.bash".


Nothing works!


Please help me


Answer



Programs started by the cron daemon do not have the authentication data needed to connect to your X server. Try putting something like this in your ~/.xprofile:


if [ "$XAUTHORITY" ]; then
cp -f "$XAUTHORITY" ~/.Xauthority
fi

bios - How to boot into a Linux, non-primary partition if Windows bootloader is on the MBR

I have Windows 8.1 installed in legacy mode/BIOS mode (ie: Not UEFI at all). Windows 8.1 is installed in the primary partition (ie: first). I (intend to) have linux installed in a second partition on this drive.


Let's say I install Linux (run through it's installer and reboot). Problem: Will I be able to boot into this installed partition of Linux and if so how?


Note: In this case, I will not be installing GRUB automatically through the installer, therefore the MBR will still contain (as the title says) the Windows Bootloader.


A more general form of my question is, (and really what I want to know): How do I boot OS's on different partitions if they are remote from the MBR (ie: not linked directly from the MBR via a menu or chained transitively either).


Note: Sadly when I google for information on this and use the word "Windows 8", every installation guide assumes I am using UEFI, which I am not, I am in BIOS/legacy mode. I do not have an EFI parition and do not intend to use one.


edit: I don't intend to leave the windows bootloader there. My concern is, if the windows boat loader is left there (because I merely installed linux, not grub+linux), how do I boot up into Linux? I am unaware of how to pick an OS on a secondary partition if the MBR isn't pointing to it.

Saturday, December 24, 2016

How can I query an NTP server under Windows?


I am not interested in synchronizing my local clock with the remote server. I only want to query it and print the result.


I would have assumed that there is a port of ntpq for Windows, but was unable to find any.


All other NTP clients I could find, they always want to install themselves as a service or make it otherwise clear that they want to synchronize my local time.


Answer



C:\> w32tm /stripchart /computer:foo
Tracking foo [1.2.3.4].
The current time is 19/07/2012 17:39:48 (local time).
17:39:48 d:-00.0000840s o:-25.3004160s [@ | ]
17:39:50 d:-00.0000680s o:-25.3070080s [@ | ]
17:39:52 d:-00.0000690s o:-25.2987405s [@ | ]
17:39:54 d:-00.0000680s o:-25.3071530s [@ | ]
17:39:56 d:-00.0000690s o:-25.2993985s [@ | ]
17:39:58 d:-00.0000680s o:-25.3070270s [@ | ]

Wireshark shows NTP packets being generated by this. Some versions of w32tm have a /query option


C:\>w32tm /stripchart /computer:us.pool.ntp.org /dataonly /samples:5
Tracking us.pool.ntp.org [208.87.221.228:123].
Collecting 5 samples.
The current time is 19/07/2012 18:36:32.
18:36:32, +03.3575094s
18:36:34, +03.3573679s
18:36:37, +03.3572986s
18:36:39, +03.3570290s
18:36:41, +03.3565357s

Windows 7 services terminate unexpectedly

I'm running Windows 7 Pro 64-bit and recently started to have problems with my sound and network connection. According to the logs, the following four services keep on terminating at random times, but they all terminate at the same time. Reinstalling Windows did not help.



  • The TCP/IP NetBIOS Helper service terminated unexpectedly. It has
    done this 10 time(s).

  • The Windows Event Log service terminated unexpectedly. It has done
    this 10 time(s).

  • The DHCP Client service terminated unexpectedly. It has done this 10
    time(s).

  • The Windows Audio service terminated unexpectedly. It has done this
    10 time(s).

performance - Virtualizing a 32 bit guest on a 64 bit os


So I was wondering if anybody knew if there was any performance issues with virtualizing a 32 bit os, in my case 32 bit windows 7, on a 64 bit os, mac osX lion. I remember reading that running 32 bit processes in a 64 bit system can cause performance robbing situations with paging memory. Does this apply to virtualizing or am I misinformed?


I fully understand that the performance of the guest also depends on the amount or memory and cores you devote to your vm, but I was wondering more on the mechanics and the effects of mixing 32 bits with 64 bits.


Thanks everyone.


Answer



in theory it shouldnt be a problem. We could debate the semantics but If you are running any 32 bit programs on your 64 bit computer then you are running those programs in a virtual environment (which you likely are running 32 bit processes). But specifically speaking, when you are running windows on mac, your biggest problems are the challenges that your hypervisor will have in translating windows drivers to interact with the devices on your system. Usually this means the hypervisor works extra hard in keeping everything organized and translated appropriately. Bottom line, your biggest performance drop will have to do with how much power you pull from the processor constantly pegged out. If you are used to 6 hour mac battery life, say hello to 2hr battery life or less.


keyboard shortcuts - AHK — How to interrupt alternate keys for same hotkey?



I have a code that every time I press the hotkey, a letter is sent.



Pressing Q, Q, Q, Q, Q is sent "a", "b", "c", "d", "e", respectively. Then the loop restarts.




For example: pressing Q 13 times sends "abcdeabcdeabc".



My question is:



How can I reset the loop and return to the first letter ("a") if I do not press Q for a few seconds?



My code:



q::
Send, % ["a","b","c","d","e"][(count >= 5 || !count)? count := 1 : ++count]

return

Answer



I found a solution by myself. I hope this can help someone in the future.



Good luck. :)



q::
Send, % ["a","b","c","d","e"][A_TimeSincePriorHotkey>2500 || A_PriorHotkey<>A_ThisHotkey || (count >= 5 || !count) ? count := 1 : ++count]
return


bsod - Windows won't boot - gives blue screen


Background


Okay, so I have recently purchased a Sony Viao running Windows 7 Home Premium. It recently ran a CHKDSK scan at startup, which I thought was strange since I have not done anything to it recently. However, I just left it like that overnight, plugged in, since I didn't feel like waiting for it. In the morning, I checked up on it. It had a blank screen, which had the wallpaper of what seems like the Repair my Computer screen. I couldn't press anything because there was nothing to press, so I did a force shutdown by holding the power button for ~6 seconds. When I booted up, it asked me if I wanted to go to Repair mode again or if I wanted to boot up normally. I said that I wanted to boot up normally, so it went to the part where it said "Starting up Windows", with the glowing Windows logo. Unfortunately, it gets stuck here, and eventually goes to a blue screen. The blue screen says "UNBOOTABLE_BOOT_VOLUME". I reboot and the same thing occurs. Eventually I stopped doing this and went to the Repair screen.


Repair my Computer


I press F8 before the Windows splash screen, and it asks me what I would like to do. I hit "Repair my Computer", which then loads the files ("Windows is loading files..."). I then get to a screen that's blue, with some flowers on the side. This is the background image for the Repair My Computer. I wait for about half an hour, and then a window pops up, attempting and failing to detect problems. I then click the button that gives me some tools and the command prompt. None of them work except the command prompt.


In the Command Prompt


To do a diagnostics of my system status, I run SFC /SCANNOW, which tells me that there is a scan pending completion and to reboot to finish it. I do that and reboot, which brings me back to step one, since I still have the blue screen. After another hour, I get back to the command prompt, and this time I do CHKDSK D:. After about ten minutes, it tells me that the file system is NTFS. After twenty minutes, CHKDSK tells me that there are errors in the MFT mirror, the Volume Bitmap is incorrect, and there are problems with the File System. To fix them, I run CHKDSK /F D:, which fixes the problems listed. I then run the full check, and do CHKDSK /B /V /X D:, which gets stuck after processing file 24407 of 185840. I do not know what to do now. However, the BIOS is telling me that the hard drive is faulty and that I should replace it.


EDIT: I have successfully entered D: and copied my files to G: (my 1TB backup drive). Chkdsk is currently running, I am crossing my fingers for it.


EDIT 2: I have finished copying my files, and will be taking my laptop to Best Buy and then shipping it to Sony for repairs. Thanks to everyone that helped.


Answer



Since you recently purchased the machine and you haven't done anything unusual with it, I would suggest utilizing the warranty to get a replacement, or have it repaired. It sounds like a particularly bad hard disk drive is the source of your woes. You could try formatting and reinstalling the OS, but why bother when the drive may be dying slowly?


"Windows Critical Stop.wav" played randomly after Windows 10 Creators Update

I have been using my Windows 10 system for about half a day now following the Creators Update install. I have been getting the following sound being played randomly:


Windows Critical Stop.wav


I don't know the source, as there is no associated messagebox or notice anywhere.


How can I go about tracing this annoying problem?

Which RAID to use for File Server + Backup?

I want to setup a file server and a backup server in another building for our workplace (for clarification: I am talking about two systems, the file server in one building and the backup server in another). We decided we need at least 10 TB storage space. The plan was to buy two 4-slot NAS. Let's say I use RAID5 for the file server and buy 4x 4TB HDDs I would get effectively 12TB of storage, right?


Here is my question: Should I use RAID5 for the file server? It seems the most effective storage-wise, while RAID1 seems safer but I'd have to sacrifice half of the storage. Next question: What HDD sizes and which RAID would be best for the backup?


I already saw this thread, but it is already 6 years old and HDD sizes have changed drastically with 10TB being available. The comments suggested RAID10, is that the best approach nowadays? How are storage and parity divided in RAID10?

Friday, December 23, 2016

repair - Fixing bent pins on a CPU




While replacing a mainboard in a desktop machine (see related question), I did something stupid. I inserted the CPU into the new mainboard, but didn't check for the right position. When it didn't immediately lock in, I pressed slightly before realizing what was wrong. The result was a number of bent pins.



I tried every tutorial that popped up when Googling "CPU bent pins" - using credit cards, sewing needles, and a hunting knife to get the pins back into position - but to no avail: For every pin I get straightened out, two others are bent.



I have no problem getting individual pins straightened out, but my many attempts have led to many pins being slightly askew - enough for the CPU not to fit into the socket (An AMD X3 one). Maybe I just lack the motoric finesse. What I would need is some sort of a grid to fix all pins at once.



It's a €50 processor so the loss is not catastrophic. But I thought before I go buy a new one, I thought I'd check here whether anybody knows some magic trick, or a cheap generally-available tool to fix this.




Update: it turned out that the CPU was beyond salvaging: A pin broke off in the end, which made me give up. I bought a new CPU. Still, thanks a lot for the great input, and I think this is a useful reference for future generations.









This question was a Question of the Week.
Read the blog entry for more details or contribute to the blog yourself



Answer



Mechanical pencil is what I've always found to be best for this job. If you leave out any graphite and use the hole at the end you would normally write from it should fit snugly round the CPU pins.


Excel Chart Object without source data in Word going back to Excel

I have an Excel object chart in word. The chart is a line graph. The data is there because when I mouse over the line, I see each individual x and y value. However, the word file chart was sent to me. So, when I left click and "edit data" I get an error message that says


"The linked file is nto available. To edit the link, click the File tab. Click the Info tab, and then under related Documents, click Edit Links to Files"


Clearly, since this was not created on my machine, I can't edit the links and find the data.


I found a macro that will take a chart and recreate the data when the source data is lost or corrupted but that was written for or only works in Excel (or at least I don't know how to manipulate it to work with Word). The issue is when I copy and paste the chart into an Excel workbook, the chart copies but my data disappears. I guess that it tries to find the source data and then can't find it and makes it blank.


Any help would be greatly appreciated.


Thanks!

Set PSModulePath Environment Variable with PowerShell in Windows 10


I don't understand this. So currently my system environment variable named "PSModulePath" looks like this:


%ProgramFiles%\WindowsPowerShell\Modules;%SystemRoot%\system32\WindowsPowerShell\v1.0\Modules

Now observe the following PowerShell script:


$envarname = "PSModulePath"
$envar = (get-item env:$envarname).Value
[Environment]::SetEnvironmentVariable($envarname, $envar + ";C:\Expedited", "Machine")

All it should be doing is adding the path "C:\Expedited" to the PSModulesPath environment variable, right? Well, after running this script as administrator, the PSModulePath environment variable changes into this:


C:\Users\Username\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Expedited

Notice how:



  1. There were originally two paths, each of which contained percentage signs (variables) in the original, but afterward they all changed directly into hard-coded paths.

  2. The "C:\Users\Username\Documents\WindowsPowerShell\Modules" path sprung out of nowhere (it wasn't in the original!)


I don't have any idea why either of these two things happened. When adding a path to this variable, I would like to keep it as close to the original as possible, not make all these other changes. Is there any way to preserve the percentage signs that were lost? How do I edit this environment variable correctly from within PowerShell?


Answer



PowerShell - Get OS Environmental Variables without Expanding


You can use the Get-Item cmdlet with the -path parameter and then pass that the path of the registry key containing the PSModulePath environmental variable.


You can then use the RegistryKey.GetValue Method along with DoNotExpandEnvironmentNames to get the string value of the PSModulePath environmental variable without expanding it.




PowerShell


$envarname = "PSModulePath"
$regkey = Get-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
$envar = $regkey.GetValue($envarname, "", "DoNotExpandEnvironmentNames")
ECHO $envar


Note: You will want to be sure you run this from administrator elevated PowerShell command prompt or ISE screen for it to work
correctly.



enter image description here




Further Resources


Thursday, December 22, 2016

linux - USB stick mysteriously become write protected



So, somehow over the weekend, my 1GB USB flash drive has managed to become write-protected. There is no switch on the stick, so I'm concluding that something has corrupted at some point. Obviously I can't format it or remove.


The output from dmesg | tail is:


Buffer I/O error on device sdb1, logical block 328168
lost page write due to I/O error on sdb1
sd 73:0:0:0: [sdb] Unhandled sense code
sd 73:0:0:0: [sdb] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 73:0:0:0: [sdb] Sense Key : Data Protect [current]
Info fld=0x0
sd 73:0:0:0: [sdb] Add. Sense: Write protected
sd 73:0:0:0: [sdb] CDB: Write(10): 2a 00 00 05 08 00 00 00 01 00
Buffer I/O error on device sdb1, logical block 328200
lost page write due to I/O error on sdb1

I think the second and final lines are a giveaway to corruption, but I don't know how to interpret this output. Could someone help to see if this output gives any indication? I usually eject the drive before removing it, but I may have been lax once or twice. The data isn't critical, it's just bugging me. Any suggestions on how to fix it (if the drive even can be) would be greatly appreciated.


Answer



When a flash drive manages to become write-protected without a write protection switch , you can be damn sure about the flash storage being corrupted / damaged. At this point, there is nothing much you can do about it. It's an indication that your drive is going to die soon.
If it's in warranty get it replaced / repaired.


keyboard - Swapping Function (Fn) and Control (Ctrl) Keys on Lenovo ThinkPad W500



I'd like to swap the Fn and Ctrl keys on my ThinkPad W500 (like many others! See: How can I switch the function and control keys on my laptop? and Intercepting the Fn key on laptops)




  1. Numerous folks indicate that Windows doesn't register the Fn key as a keypress but using Mihov ASCII Master 2.0, that gives the ASCII value of a keypress, I see the Fn key returning FF (perhaps FF in this case means 'not registered'). I also see that keys like Ctrl register with one ASCII code when pressed alone and another when pressed in combo with another key. Fn will only register when pressed alone, so Windows definitely isn't seeing the combo. This took a solution like AutoHotKey off the table.


  2. I ran KeyTweak (which shows you the hardware scan codes of a keypress and the Fn key registerd as 57443). Using this program I remapped Fn to the Ctrl key; this worked perfectly. However, I suspect that because of the issue in #1, the combo of, for example, Fn + C did not execute a copy.




Short of retraining my pinky I'm actually considering removing the keyboard and resoldering the connections to swap those keys.




I'd love to get some input as to the root technical issue(s) and possible solutions here.


Answer



Apparently the FN key is not handled by the Windows keyboard driver, but rather by drivers developed by Lenovo. Hence remapping of the FN key is impossible by any Windows utility that switches keys, because the Fn key doesn't generate any scan-codes.



Apparently Lenovo is currently considering a modification to the BIOS that will make this possible. See this article: "Switch Mode for Fn/Ctrl Keys".



In conclusion you should (1) regard your BIOS to see if such an option already exists, and if not (2) check the Lenovo site for BIOS upgrades from time to time (just note that BIOS upgrades need to be done very very carefully, since a mistake means bricking your computer).



In the meantime, you can use this solution (just joking):




image


Windows 10 Desktop Colors stuck on Inverted, how to reset?


My Dad's computer, which runs Windows 10, somehow has gotten stuck with inverted colors (so everything appears as a negative) as a default.


Using the Magnifier function Windows =, I can trick Windows to show the normal colors by inverting the colors Ctrl-Alt-i. However, this is only a temporary remedy because as soon as I close the magnifier, the colors return to inverted/negative. I've also gone to the Ease of Use settings to no avail.


In an attempt to make this permanent, I went into the registry and looked at the Computer\HKEY_CURRENT_USER\Software\Microsoft\ScreenMagnifier : Invert key. It was set to 1, so I changed it back to 0 but the screen didn't change. The registry change has persisted through reboots, but the screen colors remain inverted.


It appears to me that Windows doesn't realise that its already in inverted mode.


Anyone know how to solve this problem?


Answer



There are several places where this can be set. You may have unintentionally applied a "Color Filter" which is somewhat buried within the ease-of-access settings.


To test quickly, you can try Win+Ctrl+C to see if the colors un-invert.


Assuming this is the issue, click the Start button and type "Colors" and select "Choose your accent color". Scroll down on the right until you see "High contrast settings" and click on that.


At the top on the right, you will see "Color & High contrast" and "Color filters".


I am guessing that "Invert" may have been selected under the "Choose a Filter" dropdown. Either select Off under "Apply color filter", or choose a filter that works better for your father's needs.
enter image description here


Wipe hard drive on old windows xp laptop - no CD Drive & no USB Boot support


I need to wipe an old laptop (one pass, all zeros will do).


The laptop is ancient and has:



  • Windows XP Professional installed as its sole os.

  • no USB boot support

  • no working CD drive

  • no hammer/drill
    I have nothing else to use with it, no external CD drive etc (not that that would work anyway, as the bios doesn't load USB drivers). So, just the laptop. It is connected to the Internet, and I'm familiar with technical operations, so don't be shy!


Basically, I need something that work similarly to EASEUS PARTITION MASTER, where I can install it on the laptop, in Windows xp. Tell it to wipe the laptop, and then on restart it boots in to its own command line temporary partition and gets the job done.


Any ideas?


Answer



I have tried this a number of times with success on old systems without USB boot support.
(Or to boot a VirtualBox VM with a USB stick. VirtualBox doesn't normally do USB boot either.)


Get a copy of Plop Boot Manager
Install it to the MBR.
Reboot.
Inside the boot manager you can select a USB drive to continue booting from, even if the system doesn't have USB boot support
So you just can pop in a USB stick with GParted, DBAN or whatever else you want to use to wipe the HD.


Read the documentation first. The thing isn't made for the average user.


worksheet function - Format Excel Column as a Date based on numbers

I have an excel file and a column of what are meant to be dates in the format of the first 4 digits being the year and the last 2 being the month. Is there a way to format this column in "mm-yyyy" format? I am importing these dates into another system and want to create a date field in the destination system.


Sample column data on the left desired output on the right.


196408 -> 08/1964


196701 -> 01/1967


200102 -> 02/2001


Is there an excel formula or some other regular expression that I could use to do this?

Wednesday, December 21, 2016

power supply - What is the name of the cable inside PC cases?



Due to limited linguistic and technical knowledge, I do not know (and can not find) the name for the 4 pin (or perhaps 3?) plugs that are used inside PC cases to deliver electricity.


My questions:



  1. What's the name of these cables? (they are used for connecting fans etc.)

  2. What's the difference between them and "Molex" cables?

  3. Is there a converter to attach to small 12V DC adapters' round end so that I can connect / run a fan externally?


Answer



These cable assemblies are typically used to deliver +5V and +12V DC to various components in the computer such as optical drives, hard drives, and fans. Molex (see Molex Connector) is the company that developed the typical connector found on the ends of these assemblies. Some people refer to the cable assembly itself as "Molex cables" but this is technically a misnomer.


Molex Fan Adapter


You can easily find adapters (pictured above) for connecting 3-pin (Molex KK-type) fans to these 4-pin connectors at your local computer store, or online. While I have not seen converters to connect DC power jacks, you can easily modify one by soldering your own power jack to it.


You can find the pinout easily online:


PC power supply harness pinout


With this information you can cut the appropriate wires and solder them to a DC power jack using the correct polarity. Be sure to use your meter to verify polarity if you're not sure.


More about DC Power Jacks: https://electronics.stackexchange.com/q/124943/2028


Standard user account for Windows 8.1 is created, but cannot login


When creating users accounts I am signed in under my Microsoft Live account, this account is already part of the Administrators group. I can create the new Standard User account but when trying to log on to the account I get the following message



The user profile service failed the sign-in



This is happening with every local account I create. I have tried deleting account and recreating with no resolution.


I am running a fully patched Windows 8.1 Pro 64 bit OS.


Answer



Google searching "The user profile service failed the sign-in" found this. Gives causes and tutorials, and has discussions with other users on alternate fixes.



This tutorial will show you how to fix the "User Profile Service
service failed the sign-in. User Profile cannot be loaded." error when
trying to sign in to a user account in Windows 8, Windows RT, Windows
8.1, and Windows RT 8.1.



Edit: Adding additional options that might fix the problem.



  1. Create a standard user account with a local login password. Then associate the Windows Live profile with that account. Change the Microsoft Live associated with the Windows Login.


  2. Dangerous solution suggested in Microsoft Forums here - Repair Windows 8.1 Installation.


  3. Check your Application logs for errors similar to the one detailed here. The gist of the solution was:




"I suggest you check the Advanced Security Settings for the
C:\Users\Default folder. Ensure you check the box "Replace all child
object permission with inheritable permissions from this object"."
Fixed this problem for me. I am now able to logon with the newly
created accounts just fine. Hopefully this will help others as well!



Phoenix Award BIOS won't boot from USB

I have installed several OSs in the past very easily on my system, but recently I've been trying to format Windows 7 on my pc by reinstalling it, just after a few seconds after I enter the BIOS settings, my CPU shuts down.


I could not even save the settings, even if I somehow happen to save the settings and boot when the screen says



press any key to boot from USB...



After pressing a key, the CPU again shuts down, it just won't boot from USB.


I don't know if CPU shutting down by after a few seconds I enter BIOS setting and not being able to boot from USB are 2 different issues or related.


Here are a few things I've tried:



  1. I tried booting windows 10 and ubuntu thinking that iso might be corrupt or something but it still happened all the time.

  2. I tried running the setup.exe file directly from the bootable USB. Initially, it started installing the windows but when it restarts, which is a part of the installation it again won't continue to boot from USB, CPU again shuts down.

  3. used another USB to boot, no luck.


I don't think there is some hardware issue, because when I let it boot to the current OS, it boots properly and runs with shutting down automatically.

hard drive - Folder Size 18.7gb but Size on disk 1.33TB - why/how could this have happened? Synology DS212 NAS RAID

To start - I am way out of my comfort zone trying to fix this problem but I am not sure what else to do!


We have (2) 3TB hard drives in a Synology DS212 NAS RAID and are constantly running into issues of not having enough space. Even though we are uploading 30-90GB weekly, there is no way that we should be completely full at this point. I clicked on a folder in the drive and pulled up the properties. It says that the size is 18.7GB but the size on disk is 1.33TB.


Screen shot from the folder properties.


I researched and was brought to this site where a question was answered.


Ultimately I learned that clusters have a minimum size and we thought that might be the issue, but even if we have the largest allocation size possible: 32,768 KB * 3612 (number of files in that folder) it would still only take up 118 GB of extra space.


Can anyone explain why this is happening?


As mentioned above, we upload photos and video files weekly (30-90gb) but after we export our raw camera files we delete those. Just thought that might be pertinent information.

How does memory/commit charge work in Windows 10?


This question is prompted by the following regularly observed phenomena I'd like to find an explanation for:



  1. Current commit is regularly higher than Physical usage + Pagefile size. What's up with that? Shouldn't that be impossible? [This it seems might be because of compression. Which transforms the question to: Why doesn't commit limit then go up or something? I.e. what's the point of compression if it doesn't help with memory usage?]

  2. Sometimes this reaches extreme levels where Current commit is more than double physical memory usage!

  3. When commit charge fills up and windows starts asking me to close things, most of the time physical memory is at around 60%. This seems horribly inefficient.


This is on windows 10, as reported by Process Explorer.


The ultimate question I'd like to answer, is: Can I forego artificially inflating my page file to levels my starved-for-space SSD is ill-equipped to handle just so I can actually effectively utilize my physical memory? (Or even if it wasn't as full. That is, I'd like to avoid suggestions like "Do X/Y/Z to your page file".)


Answer



This is actually pretty straightforward once you understand that commit charge represents only potential - yet "guaranteed available if you want it" - use of virtual memory, while the "private working set" - which is essentially the RAM used by "committed" memory - is actual use, as is pagefile space. (But this is not all of the use of RAM, because there are other things that use RAM).


Let's assume we're talking about 32-bit systems, so the maximum virtual address space available to each process is normally 2 GiB. (There is no substantial difference in any of the following for 64-bit systems, except that the addresses and sizes can be larger - much larger.)


Now suppose a program running in a process uses VirtualAlloc (a Win32 API) to "commit" 2 MiB of virtual memory. As you'd expect, this will show up as an additional 2 MiB of commit charge, and there are 2 MiB fewer bytes of virtual address space available in the process for future allocations.


But it will not actually use any physical memory (RAM) yet!


The VirtualAlloc call will return to the caller the start address of the allocated region; the region will be somewhere in the range 0x10000 through 0x7FFEFFFF, i.e. about 2 GiB. (The first and last 64KiB, or 0x10000 in hex, of v.a.s. in each process are never assigned.)


But again - there is no actual physical use of 2 MiB of storage yet! Not in RAM, not even in the pagefile. (There is a tiny structure called a "Virtual Address Descriptor" that describes the start v.a. and length of the private committed region.)


So there you have it! Commit charge has increased, but physical memory usage has not.


This is easy to demonstrate with the sysinternals tool testlimit.


Sometime later, let's say the program stores something (ie a memory write operation) in that region (doesn't matter where). There is not yet any physical memory underneath any of the region, so such an access will incur a page fault. In response to which the OS's memory manager, specifically the page fault handler routine (the "pager" for short... it's called MiAccessFault), will:



  1. allocate a previously-"available" physical page

  2. set up the page table entry for the virtual page that was accessed to associate the virtual page number with the newly-assigned physical page number

  3. add the physical page to the process private working set

  4. and dismiss the page fault, causing the instruction that raised the fault to be retried.


You have now "faulted" one page (4 KiB) into the process. And physical memory usage will increment accordingly, and "available" RAM will decrease. Commit charge does not change.


Sometime later, if that page has not been referenced for a while and demand for RAM is high, this might happen:



  1. the OS removes the page from the process working set.

  2. because it was written to since it was brought into the working set, it is put on the modified page list (otherwise it would go on the standby page list). The page table entry still reflects the physical page number of the page of RAM, but now has its "valid" bit clear, so the next time it's referenced a page fault will occur

  3. when the modified page list hits a small threshold, a modified page writer thread in the "System" process wakes up and saves the contents of modified pages to the pagefile (assuming that you have one), and...

  4. takes those pages off of the modified list and puts them on the standby list. They are now considered part of "available" RAM; but for now they still have their original contents from when they were in their respective processes. Again, commit charge doesn't change, but RAM usage and the process private working set will go down.

  5. Pages on the standby list can now be repurposed, which is to say used for something else - like resolve page faults from any process on the system, or used by SuperFetch. However...

  6. If a process that's lost a page to the modified or standby list tries to access it again before the physical page has been repurposed (i.e. it still has its original content), the page fault is resolved without reading from disk. The page is simply put back in the process working set and the page table entry is made "valid". This is an example of a "soft" or "cheap" page fault. We say that the standby and modified lists form a system-wide cache of pages that are likely to be needed again soon.


If you don't have a pagefile, then steps 3 through 5 are changed to:



  1. The pages sit on the modified list, since there's nowhere to write their contents.


  2. The pages sit on the modified list, since there's nowhere to write their contents.


  3. The pages sit on the modified list, since there's nowhere to write their contents.



Step 6 remains the same, since pages on the modified list can be faulted back into the process that lost them as a "soft" page fault. But if that doesn't happen the pages sit on the modified list until the process deallocates the corresponding virtual memory (maybe because the process ends).


There is other use of virtual address space, and of RAM, besides private committed memory. There is mapped virtual address space, for which the backing store is some specified file rather than the pagefile. The pages of mapped v.a.s. that are paged in are reflected in RAM usage, but mapped memory does not contribute to commit charge because the mapped file provides the backing store: Any part of the mapped region that isn't in RAM is simply kept in the mapped file. Another difference is that most file mappings can be shared between processes; a shared page that's already in memory for one process can be added to another process without going to disk for it again (another soft page fault).


And there is nonpageable v.a.s., for which there is no backing store because it's always resident in RAM. This contributes both to the reported RAM usage and to the "commit charge" as well.



This it seems might be because of compression. Which transforms the question to: Why doesn't commit limit then go up or something? I.e. what's the point of compression if it doesn't help with memory usage?



No. It has nothing to do with compression. Memory compression in Windows is done as an intermediate step, on pages that otherwise would be written to the pagefile. In effect it allows the modified page list to use less RAM to contain more stuff, at some cost in CPU time but with far greater speed than pagefile I/O (even to an SSD). Since commit limit is calculated from total RAM + pagefile size, not RAM usage + pagefile usage, this doesn't affect commit limit. Commit limit doesn't change with how much RAM is in use or what it's in use for.



When commit charge fills up and windows starts asking me to close things, most of the time physical memory is at around 60%. This seems horribly inefficient.



It isn't that Windows is being inefficient. It's the apps you're running. They're committing a lot more v.a.s. than they're actually using.


The reason for the entire "commit charge" and "commit limit" mechanism is this: When I call VirtualAlloc, I am supposed to check the return value to see if it's non-zero. If it's zero, it means that my alloc attempt failed, likely because it would have caused commit charge to exceed commit limit. I'm supposed to do something reasonable like try committing less, or exiting the program cleanly.


If VirtualAlloc returned nonzero, i.e. an address, that tells me that the system has made a guarantee - a commitment, if you will - that however many bytes I asked for, starting at that address, will be available if I choose to access them; that there is someplace to put it all - either RAM or the pagefile. i.e. there is no reason to expect any sort of failure in accessing anything within that region. That's good, because it would not be reasonable to expect me to check for "did it work?" on every access to the allocated region.


The "cash lending bank" analogy


It's a little like a bank offering credit, but strictly on a cash-on-hand basis. (This is not, of course, how real banks work.)


Suppose the bank starts with a million dollars cash on hand. People go to the bank and ask for lines of credit in varying amounts. Say the bank approves me for a $100,000 line of credit (I create a private committed region); that doesn't mean that any cash has actually left the vault. If I later actually take out a loan for, say, $20,000 (I access a subset of the region), that does remove cash from the bank.


But whether I take out any loans or not, the fact that I've been approved for a maximum of $100K means the bank can subsequently only approve another $900,000 worth of lines of credit, total, for all of its customers. The bank won't approve credit in excess of its cash reserves (ie it won't overcommit them), since that would mean the bank might have to turn a previously-approved borrower away when they later show up intending to take out their loan. That would be very bad because the bank already committed to allowing those loans, and the bank's reputation would plummet.


Yes, this is "inefficient" in terms of the bank's use of that cash. And the greater the disparity between the lines of credit the customers are approved for and the amounts they actually loan, the less efficient it is. But that inefficiency is not the bank's fault; it's the customers' "fault" for asking for such high lines of credit but only taking out small loans.


The bank's business model is that it simply cannot turn down a previously-approved borrower when they show up to get their loan - to do so would be "fatal" to the customer. That's why the bank keeps careful track of how much of the loan fund has been "committed".


I suppose that expanding the pagefile, or adding another one, would be like the bank going out and getting more cash and adding it to the loan fund.


If you want to model mapped and nonpageable memory in this analogy... nonpageable is like a small loan that you are required to take out and keep out when you open your account. (The nonpageable structures that define each new process.) Mapped memory is like bringing your own cash along (the file that's being mapped) and depositing it in the bank, then taking out only parts of it at a time (paging it in). Why not page it all in at once? I don't know, maybe you don't have room in your wallet for all that cash. :) This doesn't affect others' ability to borrow money because the cash you deposited is in your own account, not the general loan fund. This analogy starts breaking down about there, especially when we start thinking about shared memory, so don't push it too far.


Back to the Windows OS: The fact that you have much of your RAM "available" has nothing to do with commit charge and commit limit. If you're near the commit limit that means the OS has already committed - i.e. promised to make available when asked for - that much storage. It doesn't have to be all in use yet for the limit to be enforced.



Can I forego artificially inflating my page file to levels my starved-for-space SSD is ill-equipped to handle just so I can actually effectively utilize my physical memory? (Or even if it wasn't as full. That is, I'd like to avoid suggestions like "Do X/Y/Z to your page file".)



Well, I'm sorry, but if you're running into commit limit, there are just three things you can do:



  1. Increase your RAM.

  2. Increase your pagefile size.

  3. Run less stuff at one time.


Re option 2: You could put a second pagefile on a hard drive. If the apps are not actually using all that committed memory - which apparently they're not, since you're seeing so much free RAM - you won't actually be accessing that pagefile much, so putting it on a hard drive won't hurt performance. If the slowness of a hard drive would still bother you, another option is to get a small and therefore cheap second SSD and put your second pagefile on that. The one "showstopper" would be a laptop with no way to add a second "non-removable" drive. (Windows will not let you put pagefiles on removeable drives, like anything connected with USB.)


Here is another answer I wrote that explains things from a different direction.


p.s.: You asked about Windows 10, but I should tell you that it works the same way in every version of the NT family, back to NT 3.1, and prerelease versions too. What has likely changed is Windows' default setting for pagefile size, from 1.5x or 1x RAM size to much smaller. I believe this was a mistake.


hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...