View FindMostExecutedStoredProcedures.sql
SELECT
DatabaseName = DB_NAME(st.dbid)
,SchemaName = OBJECT_SCHEMA_NAME(st.objectid,dbid)
,StoredProcedure = OBJECT_NAME(st.objectid,dbid)
,ExecutionCount = MAX(cp.usecounts)
FROM sys.dm_exec_cached_plans cp
CROSS APPLY sys.dm_exec_sql_text(cp.plan_handle) st
WHERE DB_NAME(st.dbid) IS NOT NULL
AND cp.objtype = 'proc'
GROUP BY
View FindMostExecutedQueries.sql
SELECT TOP 50
qs.execution_count
,OBJECT_NAME(objectid)
,query_text = SUBSTRING(
qt.text,
qs.statement_start_offset/2,
(CASE WHEN qs.statement_end_offset = -1
THEN len(convert(nvarchar(max), qt.text)) * 2
ELSE qs.statement_end_offset
END
View pingdom-app.js
var request = require('request');
var gpio = require('rpi-gpio');
gpio.setup(7, gpio.DIR_OUT,off7);
gpio.setup(11, gpio.DIR_OUT, off11);
var options = {
url: 'https://api.pingdom.com/api/2.0/checks',
headers: {
'User-Agent': 'rasp',
View .gitconfig
[user]
name = usename
email = email@email.com
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
[alias]
freebase = pull --rebase
commit = commit -a -v
View CreateVMFromVhd.ps1
Login-AzureRmAccount
Select-AzureRmSubscription -SubscriptionId "xxxx-xxxx-xxx-xxxx-xxx"
$rgName = "resourcegrup"
$location = "brazilsouth"
$storageName="storage"
New-AzureRmResourceGroup -Name $rgName -Location $location
View createcert.ps1
New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname *.domain.com
CE0976529B02DE058C9CB2C0E64AD79DAFB18CF4
$pwd = ConvertTo-SecureString -String "Pa$$w0rd" -Force -AsPlainText
Export-PfxCertificate -cert cert:\localMachine\my\CE0976529B02DE058C9CB2C0E64AD79DAFB18CF4 -FilePath e:\temp\cert.pfx -Password $pwd
View publishNuget.ps1
$Packages = New-Object System.Collections.ArrayList
$Packages.Add(@{packageName="My.PackageXPTO";filePath="..\..\Projects\MyPackage\bin\Debug\My.PackageXPTO.dll"})
$Packages.Add(@{packageName="My.OtherPackageXPTO";filePath="..\..\Projects\MyOhterPackage\bin\Debug\My.OtherPackageXPTO.dll"})
foreach($Package in $Packages)
{
$packageName = $Package.packageName
$filePath= $Package.filePath
View SchedulerTasks.bat
##List scheduler tasks
schtasks /Query /FO CSV /V > c:/output.csv
##Change the user scheduler task
schtasks /Change /TN "\Path\Schedulename" /RU "Domain\User" /RP "password"
View GenericJsonWebHookHandler.cs
public class GenericJsonWebHookHandler : WebHookHandler
{
public GenericJsonWebHookHandler()
{
this.Receiver = "genericjson";
}
public override Task ExecuteAsync(string generator, WebHookHandlerContext context)
{
usuarios = new List<Usuario>();
View app_deploy.py
from flask import Flask
from flask import request
import requests
import subprocess
import json
import time
payload_url = 'https://url-que-notificaremos-quando-o-deploy-terminar/'
app = Flask(__name__)