Skip to content

Instantly share code, notes, and snippets.

View pedroppinheiro's full-sized avatar

Pedro Victor Pontes Pinheiro pedroppinheiro

View GitHub Profile
@pedroppinheiro
pedroppinheiro / comandos_gerenciamento_disco.md
Last active August 22, 2022 18:45
lidando com gerenciamento de espaço em disco

###Mostrar quanto de espaço em disco está sendo ocupado

df -h ou df -h .

###Mostrar por pasta quanto de espaço em disco está sendo ocupado (muito útil)

du --max-depth=1 -h /

@pedroppinheiro
pedroppinheiro / ad_check_cli.js
Created June 1, 2020 14:06
Script para obter informações de conta expirada dos usuários (ad_check): usando o comando de "net users <usuario> /domain"
#!/usr/bin/env node
const Promise = require('bluebird');
const cmd = require('node-cmd');
const [,, ...args] = process.argv
if(!args[0]) {
console.log("Informe um nome de usuário")
return
}
1 hostname elliot-01
2 echo elliot-01 > /etc/hostname
3 bash
4 vim /etc/modules-load.d/k8s.conf
5 curl -fsSL https://get.docker.com | bash
6 docker version
7 docker ps
8 apt-get update && apt-get install -y apt-transport-https
9 curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
10 echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
@pedroppinheiro
pedroppinheiro / mensagem de erro mostra comandos disponíveis do Jenkins Pipeline.md
Created April 13, 2020 13:34
Comandos disponíveis para serem utilizados em steps do jenkins pipeline

No such DSL method 'waituntil' found among steps [ArtifactoryGradleBuild, MavenDescriptorStep, addInteractivePromotion, archive, artifactoryDistributeBuild, artifactoryDownload, artifactoryEditProps, artifactoryGoPublish, artifactoryGoRun, artifactoryMavenBuild, artifactoryNpmInstall, artifactoryNpmPublish, artifactoryPromoteBuild, artifactoryUpload, bat, build, catchError, checkout, collectEnv, collectIssues, conanAddRemote, conanAddUser, deleteDir, deployArtifacts, dir, dockerFingerprintFrom, dockerFingerprintRun, dockerPullStep, dockerPushStep, echo, emailext, emailextrecipients, envVarsForTool, error, fileExists, findBuildScans, getArtifactoryServer, getContext, git, initConanClient, input, isUnix, junit, library, libraryResource, load, lock, mail, milestone, newArtifactoryServer, newBuildInfo, newGoBuild, newGradleBuild, newMavenBuild, newNpmBuild, node, parallel, powershell, properties, publishBuildInfo, pwd, pwsh, readFile, readTrusted, resolveScm, retry, rtAddInteractivePromotion, rtBuildInfo, rtColl

@pedroppinheiro
pedroppinheiro / selenium IDE scripts.md
Last active March 18, 2020 12:19
scripts para selenium IDE

Script para gerar CPF aleatorio

versão normal:

OBS: O algoritmo possui um bug. Nem todo CPF que ele gera é válido. Necessário corrigir.

(function () {
  aleatorio = function () {
  aleat = Math.floor(Math.random() * 999);
 //o preenchimento dos zeros à esquerda é mais facil com a função padStart da string

return ("" + aleat).padStart(3, '0');

@pedroppinheiro
pedroppinheiro / comandos_uteis
Created January 9, 2020 14:36
Comandos úteis
Detalhamento de informações sobre o usuário do AD:
net users <nome_usuário> /domain
@pedroppinheiro
pedroppinheiro / index.js
Created January 6, 2020 00:45 — forked from zkat/index.js
npx is cool
#!/usr/bin/env node
console.log('yay gist')
@pedroppinheiro
pedroppinheiro / import_csv.sql
Created December 30, 2019 14:44
Script para importar csv em tabela temporária
--https://stackoverflow.com/a/52750830/1252947
CREATE TABLE #tempTable1
(
pasta VARCHAR(50),
subpasta VARCHAR(50)
)
BULK INSERT #tempTable1
FROM '<CAMINHO COMPLETO>'
@pedroppinheiro
pedroppinheiro / treinamento docker e kubernets - 21-11-2019.txt
Last active November 22, 2019 20:40
treinamento docker banpará - leandro vibe
sudo su
sudo apt update && apt list --upgradable
apt install openjdk-8-jdk
apt install maven
curl -fsSL https:/get.docker.com | bash
docker version
docker container run hello-world
@pedroppinheiro
pedroppinheiro / schemaspy_config.file
Last active August 28, 2019 15:15
schemaspy config and generation command
#Command: java -jar ./schemaspy-6.0.0.jar -configFile C:/Users/pedro/Desktop/schemaspy/schemaspy_config.file
# type of database. Run with -dbhelp for details
schemaspy.t=mssql08
# optional path to alternative jdbc drivers.
#schemaspy.dp=path/to/drivers
schemaspy.dp=C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssql-jdbc-7.4.1.jre8.jar # esse jar é baixado do site da microsoft
# database properties: host, port number, name user, password
schemaspy.host=localhost
schemaspy.port=1433