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
'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) {
@YuriFontella
YuriFontella / arch-install.txt
Last active May 21, 2017 19:08
Arch Linux Install
# loadkeys br-abnt2
REDE
# systemctl start dhcpcd # Habilita o dhcpcd
Testando a conexão:
# ping -c3 google.com
@YuriFontella
YuriFontella / git.txt
Created May 14, 2017 22:25
Comandos git
Primeiro repositório:
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/YuriFontella/algum-repositorio.git
git push -u origin master
Instalando o Git