Skip to content

Instantly share code, notes, and snippets.

@roninhack
roninhack / smtp.js
Created July 21, 2018 14:18 — forked from btoews/smtp.js
node.js SMTP Server
/*
smtpd.js is SMTP server written for node.js
#Changes#
-made to work with 0.6.2 (replaced sys.print with console.log)
-a few bug fixes
sudo node smtpd.js
@roninhack
roninhack / gist:7a0b278d87c10ed05ea8ed27d6e28c90
Created July 21, 2018 14:18 — forked from asinbow/gist:3329926
nodejs socket programming
// server
var net = require('net');
var HOST = '127.0.0.1';
var PORT = 6969;
// Create a server instance, and chain the listen function to it
// The function passed to net.createServer() becomes the event handler for the 'connection' event
// The sock object the callback function receives UNIQUE for each connection
net.createServer(function(sock) {
@roninhack
roninhack / review.md
Created August 1, 2018 15:09 — forked from doctorevil/review.md
NXT Crypto Review of Curve25519.java & Crypto.java

Crypto Review of Curve25519.java & Crypto.java

By DoctorEvil on Nextcoin.org

Sponsored by MSIN on BitcoinTalk.org

TL;DR

NXT's Crypto.java and Curve25519.java look kosher aside from a signing bug that is currently being worked around.

General Methodology

@roninhack
roninhack / Main.java
Created August 2, 2018 17:24 — forked from psqq/Main.java
[Java] File encrypt/decrypt with AES 128
package ru.psqq;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.io.*;
import java.security.Key;
import java.security.MessageDigest;
import java.util.Base64;
@roninhack
roninhack / _README.md
Created August 14, 2018 16:17 — forked from mauriciopoppe/_README.md
Generic Makefile example for a C++ project
@roninhack
roninhack / devices.c
Created August 20, 2018 03:07 — forked from courtneyfaulkner/devices.c
List OpenCL platforms and devices
#include <stdio.h>
#include <stdlib.h>
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
#endif
int main() {
/**
* purzi's Count up script V.1
Don't copy this part :D
donations for idk memes
Btc: DCJ1S92joR9uZfujkxo8utadCEZoWCSBv
ETH: 0x6158e8A6574EdCAa6d229D3b67b726f70C704911
BCH: qq0yjc8ts8uvt75y2f7kmk3yme2jlhsxwy9w5ua5v2
you can tip me on bustadice or bustabit "/tip purzi"
*/
@roninhack
roninhack / socket-io-emit-async.js
Created September 1, 2018 12:58 — forked from reggi/socket-io-emit-async.js
Socket.io emit async
var io = require('socket.io-client')("http://localhost:3001")
var Promise = require("bluebird")
io.emitAsync = Promise.promisify(io.emit)
io.emitAsync("report", {
"name": "thomas"
}).then(function(data){
console.log(data)
}).catch(function(e){
console.log(e.message)
@roninhack
roninhack / CryptGenRandom.cpp
Created September 4, 2018 13:48 — forked from kbjorklu/CryptGenRandom.cpp
Sample code for the CryptGenRandom function.
#include <iostream>
#include <windows.h>
#pragma comment(lib, "advapi32.lib")
int main()
{
HCRYPTPROV hProvider = 0;
if (!::CryptAcquireContextW(&hProvider, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT))
return 1;
@roninhack
roninhack / genrandom.c
Created September 4, 2018 13:48 — forked from pmachapman/genrandom.c
A simple example for CryptGenRandom
#include <stdio.h>
#include <windows.h>
#include <Wincrypt.h>
int main(int argc, char *argv[])
{
/* Declare variables */
HCRYPTPROV hCryptProv;
BYTE pbData[16];