Skip to content

Instantly share code, notes, and snippets.

View georgepaoli's full-sized avatar

George Paoli georgepaoli

View GitHub Profile
@georgepaoli
georgepaoli / Permission denied (publickey)
Created February 1, 2018 16:27
Check that you are connecting to the correct server
1) verifique se ja possui alguma chave publica habilitada
ssh -vT [email protected]
2) caso nao tenha, registre uma em /home/<you>/.ssh
sh-keygen -t rsa -C "[email protected]" -b 4096
@georgepaoli
georgepaoli / install-docker-linux-mint-18.sh
Last active September 10, 2018 20:07
Install Docker in Linux Mint 18
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
sudo apt update
sudo apt install linux-image-generic linux-image-extra-virtual
sudo apt install docker.io
@georgepaoli
georgepaoli / gist:20aab441a01dbdac855d16f3890e7673
Created December 6, 2017 17:16
Exemplos de NodeJs acessando o MSSQL
// Acessa informações de metricas do MSSQL
https://github.com/awaragi/prometheus-mssql-exporter
@georgepaoli
georgepaoli / vs2012.vssettings
Created September 21, 2017 12:19
My VS 2012 Settings
<UserSettings>
<ApplicationIdentity version="11.0"/>
<ToolsOptions>
<ToolsOptionsCategory name="Environment" RegisteredName="Environment">
<ToolsOptionsSubCategory name="Documents" RegisteredName="Documents" PackageName="Visual Studio Environment Package">
<PropertyValue name="ShowMiscFilesProject">false</PropertyValue>
<PropertyValue name="AutoloadExternalChanges">false</PropertyValue>
<PropertyValue name="CheckForConsistentLineEndings">true</PropertyValue>
<PropertyValue name="SaveDocsAsUnicodeWhenDataLoss">false</PropertyValue>
<PropertyValue name="InitializeOpenFileFromCurrentDocument">true</PropertyValue>
@georgepaoli
georgepaoli / Angular HTTP Interceptor.js
Created August 28, 2017 20:53
Angular HTTP Interceptor Sample
// Create HTTP interceptor (https://docs.angularjs.org/api/ng/service/$http - Interceptors topic)
App.factory('AuthInterceptor', ['$window', '$q', '$location', function ($window, $q, $location) {
return {
request: function (config) {
config.headers = config.headers || {};
config.headers.ContentType = 'application/json; charset=UTF-8';
if (myGlobalVar.getToken()) {
// populate header custom fields
config.headers.Authorization = 'Bearer ' + myGlobalVar.getToken().access_token;
config.headers.iduser = myGlobalVar.getToken().iduser;
@georgepaoli
georgepaoli / project.csproj
Created August 11, 2017 18:25
Custom build version number in dotnet
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="BeforeBuild">
<!-- https://stackoverflow.com/a/6472195/2076784 -->
<PropertyGroup>
<Year>$([System.DateTime]::Now.ToString("yyyy"))</Year>
<Month>$([System.DateTime]::Now.ToString("MM"))</Month>
<Date>$([System.DateTime]::Now.ToString("dd"))</Date>
<Time>$([System.DateTime]::Now.ToString("HHmm"))</Time>
<AssemblyFileVersionAttribute>[assembly:System.Reflection.AssemblyFileVersion("$(Year).$(Month).$(Date).$(Time)")]</AssemblyFileVersionAttribute>
@georgepaoli
georgepaoli / rfc-sap-dotnet.cs
Created June 22, 2017 13:33
Exemplo de integração com SAP via RFC em C#
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SAP.Middleware.Connector;
namespace exemplo
{
@georgepaoli
georgepaoli / tcp-ip-socket-client.cs
Created January 9, 2017 20:28
TCP/IP - Socker Client
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace Client
{
class Program
@georgepaoli
georgepaoli / tcp-ip-socket-server.cs
Last active January 9, 2017 20:28
TCP/IP Socket Server
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace Host
{
-- Pegar a data removendo a HH:MM:SS:mmm
SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))
-- ou
SELECT convert(DATETIME, floor(convert(FLOAT(24), GETDATE())))
-- SQL Server Date Formats (http://www.sql-server-helper.com/tips/date-formats.aspx)
SELECT REPLACE(CONVERT(VARCHAR(10), GETDATE(), 103), '/', '') AS [DDMMYYYY]
-- Convert rows in concatenaded string list
SELECT STUFF((SELECT ',''' + field + ''''