Skip to content

Instantly share code, notes, and snippets.

View scalone's full-sized avatar

Thiago Scalone scalone

  • CloudWalk
  • São Paulo / SP
View GitHub Profile
from jwcrypto import jwk, jwe
import json
import time
def encrypt(payload):
payload = json.dumps(payload)
protected_header = {
"alg": "RSA-OAEP-256",
"enc": "A128GCM",
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <osal.h>
#include <xui.h>

Quality Analyst Test

1. Introduction

This is a test created to a job position interview.

For this exercise, we advise you to:

  • We would recomend work with linux/Mac;
  • All documents creates on this process should be shared with the e-mail thiago@cloudwalk.io, we would recommend google docs for it;
  • Install Ruby;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define THREAD_STATUS_BAR 0
#define THREAD_COMMUNICATION 1
#define THREAD_STATUS_DEAD 0
#define THREAD_STATUS_ALIVE 1
#define THREAD_STATUS_COMMAND 2
TOKEN=""
class Notification
def self.create(serial_number)
loop do
begin
puts "SEND NOTIFICATION [#{serial_number}]"
payload = {"content" => "APP_UPDATE", "range" => "specific_logical_numbers", "group_id" => 2001, "logical_numbers" => serial_number, "kind" => "processing"}
uri = URI("https://api.cloudwalk.io/v1/notifications?access_token=#{TOKEN}")
http = Net::HTTP.new(uri.host, uri.port)
file = FileDb.new("./main/params.dat")
file["connection_management"] = "1"
tcp = TCPSocket.new(host, port)
entropy = PolarSSL::Entropy.new
ctr_drbg = PolarSSL::CtrDrbg.new entropy
s_ssl = PolarSSL::SSL.new
s_ssl.set_endpoint PolarSSL::SSL::SSL_IS_CLIENT
s_ssl.set_rng ctr_drbg
s_ssl.set_socket tcp
s_ssl.handshake
http = SimpleHttp.new("https", endpoint)
# Code from da_funk
def self.main_image
if adapter.respond_to?(:main_image) &&
File.exists?("./shared/#{adapter.main_image}")
adapter.main_image
else
MAIN_BMP
end
end
def self.send_at_command(serial, command)
3.times do
result = serial.command("#{command}\r", 200)
if result.to_s.match(/\OK/)
break [true, ""]
else
[false, result]
end
end
end
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
typedef struct message {
int len;
char data[4096];
struct message *front;
struct message *rear;
} message ;