Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I wonder if I can brute-force learning... probably shouldn't.

Dracovian

💭
I wonder if I can brute-force learning... probably shouldn't.
View GitHub Profile
@Dracovian
Dracovian / atkin.c
Created Oct 9, 2020
Sieve of Atkin in C
View atkin.c
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
uint64_t SieveOfAtkin(uint64_t limit) {
bool sieve[limit];
for (uint64_t i = 0; i < limit; ++i)
sieve[i] = 0;
@Dracovian
Dracovian / hotp.java
Created Sep 19, 2020
The Java code from the RFC for HOTP.
View hotp.java
import java.lang.reflect.UndeclaredThrowableException;
import java.security.GeneralSecurityException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.math.BigInteger;
import java.util.TimeZone;
@Dracovian
Dracovian / scan.c
Last active Oct 11, 2020
All in one port scanner in C.
View scan.c
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
typedef struct {
union {
@Dracovian
Dracovian / videos.md
Last active Nov 18, 2020
Programming Stream Links
View videos.md

Title: [NodeJS] Discord Build-a-Bot Library

Description: A stream where I attempt to create a bot in NodeJS.

Stream Date: October 2, 2020

Upload Date: November 10, 2020

Length: 4h 4m 29s

@Dracovian
Dracovian / autoclick.cc
Last active Oct 29, 2020
C++ Autoclicker
View autoclick.cc
#include <cstdio>
#include <cstdlib>
#define WINVER 0x500
#include <Windows.h>
#define VK_X 88
#define VK_Z 90
int x, y;
@Dracovian
Dracovian / Makefile
Last active Sep 13, 2020
Little hello world
View Makefile
c=/usr/bin/gcc
rm=/bin/rm
cflags_x64=-O2 -no-pie -march=native -nostdlib -fomit-frame-pointer
cflags_x86=${cflags_x64} -m32
infiles_exit_x86=hello.c hello_exit_x86.s
infiles_exit_x64=hello.c hello_exit_x64.s
infiles_x86=hello.c hello_x86.s
@Dracovian
Dracovian / Makefile
Created Aug 4, 2020
Merging C with Assembly.
View Makefile
c=/usr/bin/gcc
rm=/bin/rm
cflags=-O2 -no-pie
infiles=test.c test.s
outfiles=test
all:
${c} ${cflags} -o ${outfiles} ${infiles}
View Makefile
C=gcc
RM=/bin/rm
FLAGS=-O2
CGIDIR=/var/www/html
SRCDIR=${CGIDIR}/private
SRC=${SRCDIR}/index.c
CGI=${CGIDIR}/index.cgi
@Dracovian
Dracovian / C_LANGUAGE.md
Created Jul 31, 2020
Lessons in programming.
View C_LANGUAGE.md

Data Types:

Basic data type: int, char, float, double

  • Can have the following modifiers prepended to it:
    • short
    • long
    • signed
    • unsigned
    • long long
View fw_error.h
#pragma once
#include <map>
#include <string>
#include <cstdio>
#include <exception>
#include <filesystem>
#define chrstr(a) std::string(a)
You can’t perform that action at this time.