Skip to content

Instantly share code, notes, and snippets.

View yorickdewid's full-sized avatar

Yorick de Wid yorickdewid

  • Between two vertices
  • 20:57 (UTC +01:00)
View GitHub Profile
import io
import cv2
import os
import numpy as np
def display_image(data):
buffer = np.frombuffer(data, dtype="u1")
jpeg = cv2.imdecode(buffer, cv2.IMREAD_COLOR)
cv2.imshow("jpeg", jpeg)
@yorickdewid
yorickdewid / tasks.json
Last active August 17, 2023 11:37
Visual Studio Code PostgreSQL Development Tasks
{
"version": "2.0.0",
"tasks": [
{
"label": "PostgreSQL: Clean",
"type": "shell",
"command": "/usr/bin/make",
"args": [
"clean"
],
@yorickdewid
yorickdewid / .nanorc
Last active December 5, 2020 21:03
Nano runtime configuration
set tabsize 4
set linenumbers
set titlecolor blue,white
@yorickdewid
yorickdewid / container_layout.h
Created November 26, 2017 22:20
C++ container layout to implement iterators
template <class T, class A = std::allocator<T> >
class X {
public:
typedef A allocator_type;
typedef typename A::value_type value_type;
typedef typename A::reference reference;
typedef typename A::const_reference const_reference;
typedef typename A::difference_type difference_type;
typedef typename A::size_type size_type;
@yorickdewid
yorickdewid / bruteforce.py
Last active March 2, 2021 22:36
OpenCart bruteforce
#!/usr/bin/python
from __future__ import division
import urllib
import urllib2
import cookielib
import threading
import os
import sys
import time
import signal
@yorickdewid
yorickdewid / djb2a.c
Created January 30, 2016 17:12
djb2a hash algorithm
#include <stdio.h>
unsigned long hash(unsigned char *str) {
unsigned long hash = 5381;
int c;
while ((c = *str++))
hash = hash * 33 ^ c;
return hash;
}
@yorickdewid
yorickdewid / strange.c
Created November 16, 2015 20:15
Strange C
#include <stdio.h>
#include <stdlib.h>
int main() {
int i = 1;
switch(i) {
case 1:
for(; i<3; ++i)
printf("i : %d\n", i);
default:
@yorickdewid
yorickdewid / blaster.c
Created November 16, 2015 19:55
Blaster worm source
/*
DECOMPILED SOURCE FOR MS RPC DCOM BLASTER WORM
<http://robertgraham.com/journal/030815-blaster.c>
This file contains source code for the "msblast.exe" worm
that was launched against the Internet on August 10, 2003.
This "source-code" was decompiled using "IDApro", an
"interactive disassembler". IDA is the most popular tool
@yorickdewid
yorickdewid / keywords.txt
Created November 1, 2015 13:35
List of keywords used by the Twitter search API
##################################################################
##
## List of keywords used by the Twitter search API
##
##################################################################
ddos
hacked
cyberthreat
phising
spam
@yorickdewid
yorickdewid / tcpev.c
Created September 18, 2015 14:10
TCP echo client and server
/*
* ------------------------------- tcpev.c ---------------------------------
*
* Copyright (c) 2015, Yorick de Wid <yorick17 at outlook dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,