This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Copyright 2014 - Antony Bailey | |
# Upgrade BFGMiner for Minera | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IList<Documents> FindDocuments() | |
{ | |
DriveInfo[] allDrives = DriveInfo.GetDrives(); | |
IList<Documents> documentsList = new List<Documents>(); | |
foreach (DriveInfo d in allDrives) | |
{ | |
foreach (var file in Directory.GetFiles(d.ToString(), "*.xls", SearchOption.AllDirectories)) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for line in `testdb | cut -d: -f2 | sed s"/ //g"`; do | |
pacman -S $line | |
done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add and Enable SSL 3.0 for client and server SCHANNEL communications | |
md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0' -Force | |
md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -Force | |
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -name 'Enabled' -value '0xffffffff' -PropertyType 'DWord' -Force | |
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -name 'DisabledByDefault' -value 0 -PropertyType 'DWord' -Force | |
# Add and Enable TLS 1.0 for client and server SCHANNEL communications | |
md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0' -Force | |
md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server' -Force | |
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server' -name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @BatchSize INT | |
SET @BatchSize = 100000 | |
WHILE @BatchSize <> 0BEGIN | |
DELETE TOP (@BatchSize) t | |
FROM [MyTable] t | |
INNER JOIN [Ids] d ON d.ID=t.ID | |
WHERE ???? | |
SET @BatchSize = @@rowcount | |
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @Database VARCHAR(255) | |
DECLARE @Table VARCHAR(255) | |
DECLARE @cmd NVARCHAR(500) | |
DECLARE @fillfactor INT | |
SET @fillfactor = 90 | |
DECLARE DatabaseCursor CURSOR FOR | |
SELECT name FROM master.dbo.sysdatabases | |
WHERE name NOT IN ('master','msdb','tempdb','model','distribution') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print '-- query and plan hash capture --' | |
print '-- query and plan hash capture --' | |
print '-- top 10 CPU by query_hash --' | |
select getdate() as runtime, * --into tbl_QueryHashByCPU | |
from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create function [dbo].[udf_ContainsNonASCIIChars](@string nvarchar(4000),@checkExtendedCharset bit )returns bit asbegin declare @pos int = 0; declare @char varchar(1); declare @return bit = 0; while @pos < len(@string) begin select @char = substring(@string, @pos, 1) if ascii(@char) < 32 or ascii(@char) > 126 begin if @checkExtendedCharset = 1 begin if ascii(@char) not in (9,124,130,138,142,146,150,154,158,160,170,176,180,181,183,184,185,186,192,193,194,195,196,197,199,200,201,202,203,204,205,206,207,209,210,211,212,213,214,216,217,218,219,220,221,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,248,249,250,251,252,253,254,255) begin select @return = 1; select @pos = (len(@string) + 1) end else begin select @pos = @pos + 1 end end else begin select @return = 1; select @pos = (len(@string) + 1) end end else begin select @pos = @pos + 1 end end return @return; end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @backupPath nvarchar(400);DECLARE @sourceDb nvarchar(50);DECLARE @sourceDb_log nvarchar(50);DECLARE @destDb nvarchar(50);DECLARE @destMdf nvarchar(100);DECLARE @destLdf nvarchar(100);DECLARE @sqlServerDbFolder nvarchar(100); SET @sourceDb = 'db1'SET @sourceDb_log = @sourceDb + '_log'SET @backupPath = 'E:\tmp\' + sourceDb + '.bak' --ATTENTION: file must already exist and SQL Server must have access to it SET @sqlServerDbFolder = 'E:\DB SQL\MSSQL11.MSSQLSERVER\MSSQL\DATA\' SET @destDb = 'db2' SET @destMdf = @sqlServerDbFolder + @destDb + '.mdf' SET @destLdf = @sqlServerDbFolder + @destDb + '_log' + '.ldf' BACKUP DATABASE @sourceDb TO DISK = @backupPath RESTORE DATABASE @destDb FROM DISK = @backupPath WITH REPLACE, MOVE @sourceDb TO @destMdf, MOVE @sourceDb_log TO @destLdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT 'ALTER TABLE ' + isnull(schema_name (syo. id), 'dbo') + '.' + syo .name | |
+ ' ALTER COLUMN ' + syc.name + ' NVARCHAR(' + case syc. length when -1 then 'MAX' | |
ELSE convert (nvarchar( 10),syc .length) end + ');' | |
FROM sysobjects syo | |
JOIN syscolumns syc ON | |
syc .id = syo.id | |
JOIN systypes syt ON | |
syt .xtype = syc.xtype | |
WHERE | |
syt .name = 'varchar' |
OlderNewer