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__)
View QueryToFindExecutadedQuery.sql
SELECT top 2000 execquery.last_execution_time AS [Date Time], execsql.text AS [Script] FROM sys.dm_exec_query_stats AS execquery
CROSS APPLY sys.dm_exec_sql_text(execquery.sql_handle) AS execsql
where execsql.text like '%textoparaprocurar%'
ORDER BY execquery.last_execution_time DESC
View update-solr-documento-csharp.cs
private static void ExportClientesToSolr(List<Cliente> listaDeClientes)
{
Startup.Init<Cliente>("http://solr-server:8080/solr/solrcluster/");
ISolrOperations<Cliente> solr = ServiceLocator.Current.GetInstance<ISolrOperations<Cliente>>();
var total = listaDeClientes.Count();
var indice = 0;
foreach (var cliente in listaDeClientes)
{
indice++;
View UploadForm.html
<html>
<head>
</head>
<body>
<form action="http://thumbor-server/image" enctype="multipart/form-data" method="post">
Upload Image:
<input type="file" id="media" name="media" />
<input type="submit" />
</form>
</body>