Skip to content

Instantly share code, notes, and snippets.

View jozadaquebatista's full-sized avatar
🙃

Jozadaque Batista jozadaquebatista

🙃
View GitHub Profile
@jozadaquebatista
jozadaquebatista / index.html
Created October 12, 2016 23:05
A sample mask for textfields
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>MaskField</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" media="screen" title="no title">
</head>
<body>
<h1>Simple Form</h1>
<input class="form-control" id="btnSend" type="text" name="name" value="" maxlength="4" placeholder="00,00%" />
@jozadaquebatista
jozadaquebatista / syn-poc.rb
Created August 12, 2016 01:54 — forked from KINGSABRI/syn-poc.rb
Build TCP/IP packet from scratch by ruby , and send syn(or whatever you want) packet
#!/usr/bin/env ruby
# Full Contol on Ethnet, IP & TCP headers. Play with it ;)
# to test it: nc -lvp 4444
# as root: tcpdump -nvvvv 'tcp port 4444' -i wlan0 # change wlan0 to your interface
# or use packetfu to monitor as tcpdump
## cap = PacketFu::Capture.new(:iface => 'wlan0' , :promisc=> true)
## cap.show_live(:filter => 'tcp and port 4444')
# libpcap should be installed
# gem install pcaprub packetfu
/* [ TCP header ]
============ */
struct set {
uint8_t data_offset:(1<<2);
uint8_t reserved:(3<<1);
_Bool urg;
_Bool ack;
_Bool psh;
_Bool rst;
_Bool syn;
@jozadaquebatista
jozadaquebatista / newsletter-box.js
Last active August 11, 2016 02:54
Adds a newsletter section in a website.
/*
* _Jozadaque Batista,
* Os comentários neste documento são meramente para fins de esclarecimento de seu funcionamento,
* e tem como objetivo, tirar eventuais dúvidas em relação ao seu funcionamento no contexto do Teste.
* Numa situação real, comentários num site apenas aumentariam o valor de tamanho em bytes, visto que,
* 1 'caracter'('a', 'b', 'c'...) é equivalente a 1 byte, e o tornaria mais custoso para a aplicação cliente carrega-lo.
*
* Instruções de uso, vá até o site http://www.marisa.com.br/, espere o carregamento da página.
* abra o console e simplesmente copie > cole > <ENTER>;
*
#include <stdio.h>
#if defined(SMALL)
#define SIZE 30
#endif
#if defined(LARGE)
#define SIZE 3000
#endif
@jozadaquebatista
jozadaquebatista / tcp_server.c
Last active September 18, 2015 19:58
Simple socket server in C using threads (pthread library) Compiles on linux
/*
C socket server example, handles multiple clients using threads
Compile
gcc server.c -lpthread -o server
*/
#include<stdio.h>
#include<string.h> //strlen
#include<stdlib.h> //strlen
#include<sys/socket.h>
@jozadaquebatista
jozadaquebatista / How to make HDMI audio work on Slackware 14.1?
Last active August 29, 2015 14:28
how to make audio hdmi work on slackware
+++++++++++++++++++++++++++++ How to get HDMI audio working in Slackware 14.1?
Here is the answer:
https://github.com/jozadaquebatista/Slackware14.1-Tips-and-Tricks
@jozadaquebatista
jozadaquebatista / LoopsExperimentError
Last active August 29, 2015 14:27
I'm was trying to do a recursive function inside other class, but this gives me an error. =(
/*
*
* This file has errors, if fix them cut off this comment.
* UPDATE: Now Fixed
*
*/
class Recursive
{
public Recursive(){}