Skip to content

Instantly share code, notes, and snippets.

View YuriFontella's full-sized avatar
💭
sad dev

Yuri Fontella YuriFontella

💭
sad dev
  • Porto Alegre - RS
View GitHub Profile
#!/bin/bash
##########################################################################
# Zabbix-Telegram envio de alerta por Telegram com graficos dos eventos
# Filename: zabbix-telegram.sh
# Revision: 2.2
# Date: 07/02/2017
# Author: Diego Maia - [email protected] Telegram - @diegosmaia
# Aproveitei algumas coisas:
# Script getItemGraph.sh Author: Qicheng
router.post('/zabbix_logic', async (req, res, next) => {
let alarm = { hostname: 'arch', group: 'servers', item: 'cpu', trigger: 'high', client: '5bbcab43c4ba0b3f9ba4eca6', type: 'zabbix' }
let current_time = moment().format('HH:mm:ss')
let rule = await model.Rules.findOne({
include: [{ as: 'acls', model: model.Acls }],
attributes: ['uuid', 'status'],
'use strict'
const Connection = require('simple-ssh')
const crypto = require('../services/crypto')
exports.command = async (customer) => {
const ssh = new Connection({
host: customer.ip,
'use strict'
const Connection = require('simple-ssh')
exports.reboot_bots = async (req, res, next) => {
const ssh = new Connection({
host: '',
port: 8110,
user: '',
pass: ''
[root@arch-docker ~]# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.253.51 netmask 255.255.255.0 broadcast 192.168.253.255
inet6 fe80::20c:29ff:fe9d:efba prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:9d:ef:ba txqueuelen 1000 (Ethernet)
RX packets 6936 bytes 610237 (595.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3872 bytes 483731 (472.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
@YuriFontella
YuriFontella / server.js
Created September 10, 2018 16:18
listen redis channels
const app = require('express')()
const server = require('http').Server(app)
const io = require('socket.io')(server)
const redis = require('redis')
server.listen(8890)
io.on('connection', function (socket) {
const connection = redis.createClient(6379, '192.168.0.100')
connection.subscribe('logs')
@YuriFontella
YuriFontella / angular.ts
Created December 28, 2017 20:21
form / component /service
FORM
<form class="ui form" [formGroup]="login" (ngSubmit)="onSubmit(login.value)" novalidate>
<div class="field">
<label>E-mail</label>
<input type="text" placeholder="Seu e-mail ou usuário" name="email" formControlName="email" required>
</div>
<div class="field">
<label>Senha</label>
<input type="password" placeholder="Informe sua senha" name="password" formControlName="password" required>
@YuriFontella
YuriFontella / nginx.conf
Created November 13, 2017 03:27
nginx configuration simple ssl
worker_processes 2;
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
pid logs/nginx.pid;
worker_rlimit_nofile 8192;
@YuriFontella
YuriFontella / arch-btrfs.txt
Last active November 10, 2017 20:43
Arch Install on BTRFS
# lsblk
# fdisk /dev/sda
o
n
p
(enter) = First
(enter) = Last
w
@YuriFontella
YuriFontella / google.service.ts
Last active January 9, 2018 03:41
gapi auth2
import { Injectable } from '@angular/core';
declare const gapi: any;
@Injectable()
export class GoogleService {
constructor() { }
authenticateUser(callback) {