This file contains hidden or 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 Head from 'next/head' | |
import { GraphQLClient, gql } from 'graphql-request' | |
import { useState, useEffect } from 'react' | |
const Home = () => { | |
const [data, setData] = useState() | |
const endpoint = 'http://localhost:4000/graphql' |
This file contains hidden or 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 strict' | |
const Fastify = require('fastify') | |
const mercurius = require('mercurius') | |
const auth = require('mercurius-auth') | |
const { ErrorWithProps } = mercurius | |
const app = Fastify() |
This file contains hidden or 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
https://developer.android.com/studio#downloads (command line) | |
Depois de baixado criar a seguinte estrutura de pastas (você pode fazer a sua) | |
Terminal | |
mkdir -p /opt/android-sdk | |
Dentro da pasta android-sdk descompacte o conteudo do zip baixado |
This file contains hidden or 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 { getSession } from 'next-auth/client' | |
import { useCallback, useState } from 'react' | |
import axios from 'axios' | |
import useSWR, { mutate } from 'swr' | |
const api = axios.create({ | |
baseURL: process.env.API, |
This file contains hidden or 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 strict' | |
const fastify = require('fastify')() | |
const db = require('./knexfile') | |
fastify.register(require('fastify-knexjs'), db.development, err => console.error(err)) | |
fastify.register(require('fastify-jwt'), { | |
secret: '@xyZ33#a21' |
This file contains hidden or 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/sh | |
## CONFIGURAÇÃO | |
touch /etc/hostname | |
echo "emcasadormindo" > /etc/hostname | |
sed -i -- 's/#pt_BR.UTF-8 UTF-8/pt_BR.UTF-8 UTF-8/g' /etc/locale.gen | |
sed -i -- 's/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen |
This file contains hidden or 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 strict' | |
const readline = require('readline') | |
module.exports = hint => { | |
return new Promise((resolve, reject) => { | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
}) |
This file contains hidden or 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
# Add support for https on wget | |
RUN apk update && apk add --no-cache wget && apk --no-cache add openssl wget && apk add ca-certificates && update-ca-certificates | |
# Add phantomjs | |
RUN wget -qO- "https://github.com/dustinblackman/phantomized/releases/download/2.1.1a/dockerized-phantomjs.tar.gz" | tar xz -C / \ | |
&& npm config set user 0 \ | |
&& npm install -g phantomjs-prebuilt | |
# Add fonts required by phantomjs to render html correctly | |
RUN apk add --update ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-ubuntu-font-family && rm -rf /var/cache/apk/* |
This file contains hidden or 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 strict' | |
const { RTMClient } = require('@slack/rtm-api') | |
const { WebClient } = require('@slack/web-api'); | |
const { sleep } = require('sleep') | |
const web = new WebClient() | |
const _ = require('lodash') |
This file contains hidden or 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
let alarm = { hostname: 'arch', ip: '127.0.0.1', group: 'servers', item: 'cpu', trigger: 'low' } | |
let rule = await model.Rules.findOne({ | |
include: [{ as: 'acls', model: model.Acls, attributes: ['hostname', 'ip', 'group', 'item', 'trigger', 'status', 'time_start', 'time_end'], where: { type: 'zabbix' } }], | |
attributes: ['uuid', 'status'], | |
where: { client: '5bbcab43c4ba0b3f9ba4eca6' }, | |
order: [[{ as: 'acls', model: model.Acls }, 'sequence', 'DESC']] | |
}) |