пятница, 7 сентября 2012 г.
вторник, 10 июля 2012 г.
понедельник, 9 июля 2012 г.
Deadlock Troubleshooting
Проблема, обнаружение, рекомендации
Deadlock Troubleshooting
Явно объявлять транзакцию + ...
NOLOCK+ROWLOCK как вариант преодоления deadlock
SQL Server Deadlock - NOLOCK and ROWLOCK hints
SQL Server Lock Contention Tamed: The Joys Of NOLOCK and ROWLOCK
can I resolve a deadlock with the rowlock hint?
Deadlock Troubleshooting
Явно объявлять транзакцию + ...
NOLOCK+ROWLOCK как вариант преодоления deadlock
SQL Server Deadlock - NOLOCK and ROWLOCK hints
SQL Server Lock Contention Tamed: The Joys Of NOLOCK and ROWLOCK
can I resolve a deadlock with the rowlock hint?
вторник, 8 мая 2012 г.
Как успокоить плачущего малыша
Заходим с орущим милым созданием на руках в ванную комнату, продолжая укачивать, включаем воду. Всё!
Рецепт не мой - подсмотрен где то форуме,
но реально действующее чудо проверено на моем полуторамесячном сыне.
Рецепт не мой - подсмотрен где то форуме,
но реально действующее чудо проверено на моем полуторамесячном сыне.

четверг, 26 апреля 2012 г.
Библиотека SFTP Client для NET
Надо было прикрутить к проекту загрузку файлов с ftp по протоколу sftp.
Почему то долго убил на поиски, пока не нашел SSH.NET
(This library is complete rewrite using .NET 4.0, without any third party dependencies and to utilize the parallelism as much as possible to allow best performance I can get.)
Почему то долго убил на поиски, пока не нашел SSH.NET
(This library is complete rewrite using .NET 4.0, without any third party dependencies and to utilize the parallelism as much as possible to allow best performance I can get.)

среда, 28 марта 2012 г.
пятница, 23 марта 2012 г.
Setup project with a CustomAction on x64 systems
Источник
Известная проблема с инсталлятором для x64, решаемая с orca
В статье описано как прикрутить этот фикс к Visual Studio
Известная проблема с инсталлятором для x64, решаемая с orca
В статье описано как прикрутить этот фикс к Visual Studio

SQL-ссылки (Восстановление базы без log-файла)
http://weblogs.asp.net/gunnarpeipman/archive/2009/07/21/attaching-sql-server-database-without-log-file.aspx
I needed to attach SQL Server 2008 database to server. There was no log file, just mdf. I don’t know why but it is not very easy to get this database online. After some digging in internet I found solution.
I suggest you to read and try out example by Paul S. Randal TechEd Demo: Creating, detaching, re-attaching, and fixing a suspect database. I also suggest you to bookmark this posting, you never know…. I found simplest solution from stackoverflow: How to recover database from MDF in SQL Server 2005? It works also for SQL Server 2008.
Create database with same name as MDF file you have.
Stop SQL Server and swap MDF files. Make sure you also keep new database you just created.
Start SQL Server. Database will be now in suspect state because log file is not correct.
Run the following script:
USE [master]
GO
ALTER DATABASE [MyDatabase] SET EMERGENCY
GO
ALTER DATABASE [MyDatabase] SET SINGLE_USER
GO
DBCC CHECKDB ([MyDatabase], REPAIR_ALLOW_DATA_LOSS)
GO
ALTER DATABASE [MyDatabase] SET MULTI_USER
GO
ALTER DATABASE [MyDatabase] SET ONLINE
GO
I needed to attach SQL Server 2008 database to server. There was no log file, just mdf. I don’t know why but it is not very easy to get this database online. After some digging in internet I found solution.
I suggest you to read and try out example by Paul S. Randal TechEd Demo: Creating, detaching, re-attaching, and fixing a suspect database. I also suggest you to bookmark this posting, you never know…. I found simplest solution from stackoverflow: How to recover database from MDF in SQL Server 2005? It works also for SQL Server 2008.
Create database with same name as MDF file you have.
Stop SQL Server and swap MDF files. Make sure you also keep new database you just created.
Start SQL Server. Database will be now in suspect state because log file is not correct.
Run the following script:
USE [master]
GO
ALTER DATABASE [MyDatabase] SET EMERGENCY
GO
ALTER DATABASE [MyDatabase] SET SINGLE_USER
GO
DBCC CHECKDB ([MyDatabase], REPAIR_ALLOW_DATA_LOSS)
GO
ALTER DATABASE [MyDatabase] SET MULTI_USER
GO
ALTER DATABASE [MyDatabase] SET ONLINE
GO
среда, 21 марта 2012 г.
Как подписать свое приложение (use self-signed certificate for code signing)
Источник
Creating a self-signed Certificate Authority (CA)
This creates a self-signed (-r) certificate, with an exportable private key (-pe). It's named "My CA", and should be put in the CA store for the current user. We're using the sha1 algorithm. The key is meant for signing (-sky).
The private key should be stored in the MyCA.pvk file, and the certificate in the MyCA.cer file.
то есть создали "доверенный" сертификат, с помощью которого потом создадим "рабочий" сертификат и уже им будем подписывать код
Importing the CA Certificate
Because there's no point in having a CA certificate if you don't trust it, you'll need to import it into the Windows certificate store. You can use the Certificates MMC snapin, but from the command line:
Creating a code-signing (SPC) Certificate
We'll also want to convert the certificate and key into a PFX file:
You can now use this certificate for signing code:
If you import the PFX file into the certificate store (you can use PVKIMPRT or the MMC snapin), you can sign code as follows:
Другой компьютер. Надо там сначала один раз выполнить:
Creating a self-signed Certificate Authority (CA)
makecert -r -pe -n "CN=My CA" -ss CA -sr LocalMachine(watch for line-breaks)
-a sha1 -sky signature -sv MyCA.pvk MyCA.cer
This creates a self-signed (-r) certificate, with an exportable private key (-pe). It's named "My CA", and should be put in the CA store for the current user. We're using the sha1 algorithm. The key is meant for signing (-sky).
The private key should be stored in the MyCA.pvk file, and the certificate in the MyCA.cer file.
то есть создали "доверенный" сертификат, с помощью которого потом создадим "рабочий" сертификат и уже им будем подписывать код
Importing the CA Certificate
Because there's no point in having a CA certificate if you don't trust it, you'll need to import it into the Windows certificate store. You can use the Certificates MMC snapin, but from the command line:
certutil -user -addstore Root MyCA.cerтак как созданный "доверенный" сертификат не настоящий (самоподписанный) - его ручками кладем куда надо
Creating a code-signing (SPC) Certificate
makecert -pe -n "CN=My SPC" -a sha1 -sky signaturePretty much the same as above, but we're providing an issuer key and certificate (the -ic and -iv switches).
-ic MyCA.cer -iv MyCA.pvk
-sv MySPC.pvk MySPC.cer
We'll also want to convert the certificate and key into a PFX file:
pvk2pfx -pvk MySPC.pvk -spc MySPC.cer -pfx MySPC.pfxIf you want to protect the PFX file, add the -po switch, otherwise PVK2PFX creates a PFX file with no passphrase.
You can now use this certificate for signing code:
signtool sign /v /f MySPC.pfx MyExecutable.exeэто последний шаг - приложение подписано! команда ниже - если хотим подписывать без файла pfx, а брать из хранилища сертификатов
If you import the PFX file into the certificate store (you can use PVKIMPRT or the MMC snapin), you can sign code as follows:
signtool sign /v /n "Me" /s SPC /d http://www.me.meНо это будет работать только на вашем компьютере, который знает о вашем самоподписанном доверенном источнике
/t http://timestamp.url MyExecutable.exe
Другой компьютер. Надо там сначала один раз выполнить:
certutil -user -addstore Root MyCA.cerПодписанные тобой программы будут показывать Publisher (без команды выше - нет). Также с другого компьютера можно и подписывать:
signtool sign /v /f MySPC.pfx MyExecutable.exeПодписывание сразу из Visual Studio через добавление в Post-build event command line
"C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\signtool.exe" sign /f [CERTIFICATE PATH] /p [PASSWORD] /t http://tsa.starfieldtech.com "$(TargetPath)"
Подписаться на:
Сообщения (Atom)