Tuesday, May 11, 2021

To kill a stubborn

In MS-SQL, on an attempt to drop a DB getting an 'in use' error, even after it switched to the singly user mode by executing

USE master
GO
ALTER DATABASE [DB]
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;
GO
ALTER DATABASE [DB]
SET READ_ONLY;
GO


As suggested in an answer here, there is a way to find who is actually using the DB:

 

  select  d.name , convert (smallint, req_spid) As spid
      from master.dbo.syslockinfo l, 
           master.dbo.spt_values v,
           master.dbo.spt_values x, 
           master.dbo.spt_values u, 
           master.dbo.sysdatabases d
      where   l.rsc_type = v.number 
      and v.type = 'LR' 
      and l.req_status = x.number 
      and x.type = 'LS' 
      and l.req_mode + 1 = u.number
      and u.type = 'L' 
      and l.rsc_dbid = d.dbid 
      and rsc_dbid = (select top 1 dbid from 
                      master..sysdatabases 
                      where name like 'DB')


Tuesday, April 20, 2021

Ghost Files

In  Windows a space is not allowed in the end of a file name. When such a file is somehow created, it cannot be removed by regular means. As a workaround, try to specify the file location with the following notation:

"\\?\D:\path\filename "

 

Thursday, June 28, 2018

Fighting iOS paranoia

Newer iOS version do not trust custom issued certificates by default. To make a certificate trusted, do the following:
  1. Send the CA certificate to some other email available from the device as an attachment.
  2. Once received, tap on it and install it to a "profile"
  3. Go to Settings->General->About->Certificate Trust Settings
  4. You should see your CA certificate profile there. Make it trusted.

Monday, April 18, 2016

Youtube error

YouTube's HTML5 player failed to play on Mozilla SeaMonkey browser.
To make it work do the following:
  1. Go to the about:config page
  2. Set the value of media.fragmented-mp4.enabled to false
UPD: that settings prevents some site to show video gifs.
Looks like this setting works better:
media.mediasource.webm.enabled: true

Monday, January 18, 2016

Bitlocker

A new Surface laptop came with the bitlocker is not activated, but the hard drive was yet encrypted. The owner asked to turn off the encryption completely.
The UI of Windows 10 does not provide such an ability, but that could be achieved using the command line utility:
 manage-bde -off C: 

Read more how bitlocker works here.

Wednesday, October 28, 2015

Poor thing.

Blackberry PRIV for $700 ??? They will never make it.

Saturday, July 18, 2015

To remove a wrong driver in windows

Was unable to connect a neighbor's Nook Color as a mass storage drive to a windows computer. Turned out the ClockworkMod universal ADB drivers installed earlier have a priority and won't let the usbstor.sys (the mass storage) to be selected a the primary device driver. Uninstalling the driver for the device in the Device Manager did not help, it appeared again after the device was unpluged and then plugged again.
Knowing the vendor and product IDs (for the Nook Color they are VID_2080&PID_0002), I found the ClockWork's oem##.inf file in the %SystemRoot%\inf folder.
Where ## is a number of the .inf file where the device VID and PID were mentioned.
Tried to delete that oem##.inf and then reboot the PC, did not help.
But what did help, is Window's pnputil utility.
Execute the following command as administrator and then even no need to reboot:
pnputil -d oem##.inf

Also, there is an useful utility to maintain the currently and previously connected USB devices.