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/bash | |
clear | |
REPOS=(teste teste1 teste2) | |
git=https://user:password@{organizationName}.visualstudio.com/{TeamProject}/_git/ | |
newRepo=https://user:password@{organizationName}.visualstudio.com/{TeamProject}/_git/ | |
for i in ${REPOS[@]} | |
do | |
echo $git$i |
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
tail -n +2 YOURFILE.csv/txt | split -l 1000 -d --additional-suffix=.csv - split_ | |
for file in split_* | |
do | |
head -n 1 YOURFILE.csv/txt > tmp_file | |
cat $file >> tmp_file | |
mv -f tmp_file $file | |
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
Import-module servermanager | |
Add-WindowsFeature web-server –includeallsubfeature | |
Import-Module WebAdministration | |
New-WebFtpSite -Name "LinxFTP" -Port "21" -Force | |
cmd /c \Windows\System32\inetsrv\appcmd set SITE "LinxFTP" "-virtualDirectoryDefaults.physicalPath:C:\inetpub\ftproot" | |
Set-ItemProperty "IIS:\Sites\LinxFTP" -Name ftpServer.security.ssl.controlChannelPolicy -Value 0 |
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
USE MASTER; | |
GO | |
-- Take database in single user mode -- if you are facing errors | |
-- This may terminate your active transactions for database | |
ALTER DATABASE Piloto | |
SET SINGLE_USER | |
WITH ROLLBACK IMMEDIATE; | |
GO | |
-- Detach DB | |
EXEC MASTER.dbo.sp_detach_db @dbname = N'Piloto' |
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
use [database] | |
go | |
select total_worker_time/execution_count as MediaCPU | |
, total_worker_time AS TotalCPU | |
, total_elapsed_time/execution_count as MediaDuration | |
, total_elapsed_time AS TotalDuration | |
, total_logical_reads/execution_count as MediaLogicalReads | |
, total_logical_reads AS TotalLogicalReads | |
, total_physical_reads/execution_count as MediaPhysicalReads | |
, total_physical_reads AS TotalPhysicalReads |
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 @TableName VARCHAR(255) | |
DECLARE @sql NVARCHAR(500) | |
DECLARE @fillfactor INT | |
SET @fillfactor = 80 | |
DECLARE TableCursor CURSOR FOR | |
SELECT OBJECT_SCHEMA_NAME([object_id])+'.'+name AS TableName | |
FROM sys.tables | |
OPEN TableCursor | |
FETCH NEXT FROM TableCursor INTO @TableName | |
WHILE @@FETCH_STATUS = 0 |
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
set transaction isolation level read uncommitted | |
select DB_NAME(database_id) as DataBaseName | |
, count(*) as [Missing Index Count] | |
from sys.dm_db_missing_index_details | |
group by db_name(database_id) | |
order by [Missing Index Count] desc | |
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 @query varchar(max) = '' | |
DECLARE @Remove nvarchar(1000) | |
select 'ALTER TABLE '+ a.name + ' drop column ' + b.name + '' as Remove | |
into #temp | |
from sys.tables a | |
inner join sys.columns b on b.object_id = a.object_id | |
where b.name like '%ROW%' | |
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
SET TRANSACTION isolation level READ uncommitted | |
SELECT TOP 20 ST.text AS [PARENT QUERY], | |
Db_name(ST.dbid) AS [ DATABASENAME ], | |
CP.usecounts AS [USAGE COUNT], | |
QP.query_plan | |
FROM sys.dm_exec_cached_plans CP | |
CROSS apply sys.Dm_exec_sql_text(CP.plan_handle) ST | |
CROSS apply sys.Dm_exec_query_plan(CP.plan_handle) QP | |
WHERE Cast(QP.query_plan AS NVARCHAR(max)) LIKE '%<MissingIndexes>%' or |
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
set transaction isolation level read uncommitted | |
SELECT TOP 20 | |
st.text as [SQL] | |
, cp.cacheobjtype | |
, cp.objtype | |
, COALESCE(DB_NAME(st.dbid), db_name(cast(pa.value as int))+ '*', 'Resource') as DataBaseName | |
, cp.usecounts as [Plan Usage] | |
, qp.query_plan | |
from sys.dm_exec_cached_plans cp |