This file contains 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
from simplesocket import SimpleSocket, SocketDisconnected | |
class CharClient(SimpleSocket): | |
def __init__(self, *args, **kwargs): | |
self.create_client(*args, **kwargs) | |
def handle_recv(self, client): | |
char = str(client.recv(1), "utf8") | |
if len(char) == 0: | |
raise SocketDisconnected() |
This file contains 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/bash | |
set -e | |
export ELASTIC_URL="http://engpro.totvs.com.br:9200" | |
curl -sL -X GET "${ELASTIC_URL}/_cat/indices" | awk '$1 != "green" {print($3)}' | while read indice; do | |
echo -n "${indice} zero replicas to zero: " | |
curl -sL -XPUT "${ELASTIC_URL}/${indice}/_settings" -d '{"number_of_replicas": 0}' | |
echo | |
sleep 1 |
This file contains 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
#!/usr/bin/env python3 | |
import os | |
import subprocess | |
import configparser | |
def find(path): | |
paths = [path] | |
while len(paths) > 0: | |
path = paths.pop() |
This file contains 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
#!/usr/bin/env python3 | |
import subprocess | |
import re | |
def gen_hosts(): | |
''' | |
Current regions list on https://status.digitalocean.com/ | |
''' | |
regions = [ |
This file contains 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/bash | |
# gerando chaves | |
openssl genrsa -out private.pem 4096 | |
openssl rsa -in private.pem -out public.pem -pubout | |
# gerando assinatura | |
openssl dgst -sign private.pem -sha256 -out sign.sha256 /bin/ls | |
# verificando assinatura |
This file contains 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
local threads = {} | |
function setup(thread) | |
table.insert(threads, thread) | |
end | |
function init(args) | |
results = {} | |
end |
This file contains 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
// Para usar npm i ldap e executar assim: | |
// $ USER="usuario@dominio" PASS=`get_senha` index.js | |
const ldap = require("ldap"); | |
let SERVER = process.env.SERVER || "ldap://10.171.59.13:3268"; | |
let USER = process.env.USER; | |
let PASS = process.env.PASS; | |
let LOGIN = process.env.LOGIN; |
This file contains 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
''' | |
duckdns - update a https://duckdns.org domain | |
usage: | |
duckdns host=hostname token=duckdns-token ip=[ip|local|net] | |
parameters: | |
host - name of host created at https://duckdns.org | |
token - token of your account at https://duckdns.org | |
ip - ip (valid ip) 'local' (lan address) 'net' (internet address) |
This file contains 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
from flask import Flask, Response, url_for | |
from waitress import serve | |
from datetime import datetime | |
import time | |
import json | |
app = Flask(__name__) | |
@app.route('/sse') |
This file contains 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
#include <AL/al.h> | |
#include <AL/alc.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <signal.h> | |
#define BUFF_SIZE 44100 | |
#define FREQUENCY 44100 | |
int running; |