Skip to content

Instantly share code, notes, and snippets.

View CarlEkerot's full-sized avatar

Carl Ekerot CarlEkerot

  • Recorded Future
  • Malmö
View GitHub Profile

Keybase proof

I hereby claim:

  • I am carlekerot on github.
  • I am carlekerot (https://keybase.io/carlekerot) on keybase.
  • I have a public key ASCk869AntLItT4_aFeh6TIfLEqBli-cyOO4OkAypkJ1WQo

To claim this, I am signing this object:

@CarlEkerot
CarlEkerot / ssl_bio.c
Created January 14, 2016 15:35
SSL BIO example
#include <openssl/ssl.h>
/**
* This example demonstrates how to set up a simple SSL BIO filter on an
* existing connect BIO. This is useful in sutiations where cleartext
* communication is upgraded to ciphertext communication.
*
* Compile with:
* gcc ssl_bio.c -lcrypto -lssl -o ssl_bio
*/
@CarlEkerot
CarlEkerot / .vimrc
Created February 10, 2014 07:16
.vimrc
" Fix vim compability + arrow keys
set nocompatible
" Allow for large undo-history
set history=2000
" Fix backspace
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
@CarlEkerot
CarlEkerot / proxy.py
Last active December 14, 2015 01:49
Minimal webproxy
#! /usr/bin/env python
from flask import Flask, Response, url_for, request
import requests
PROXY_URL = "http://www.aftonbladet.se"
app = Flask(__name__)
@app.route('/<path:path>')
set backspace=indent,eol,start " Allow backspace in insert mode
set history=1000 " Store lots of :cmdline history
set autoread " Reload files changed outside vim
set incsearch " Find the next match as we type the search
set viminfo='100,f1 " Save up to 100 marks, enable capital marks
set noswapfile
set nobackup
set nowb
private class ParticipantListListener implements MouseListener {
private JList list;
private JPopupMenu menu;
public ParticipantListListener(JList list) {
this.list = list;
this.menu = new JPopupMenu();
JMenuItem pm = new JMenuItem("Send Private Message");
pm.addActionListener(new ActionListener() {
@CarlEkerot
CarlEkerot / FileClient.java
Created May 14, 2012 10:43
Simple java file transfer
package client;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.Socket;
public class FileClient {
private Socket s;
@CarlEkerot
CarlEkerot / fib_multi1.c
Created May 5, 2012 09:37
Recursive fibonacci with openmp
/* Produces correct result */
#include <stdio.h>
long long fib(long long n)
{
if (n < 2) {
return 1;
}
return fib(n - 2) + fib(n - 1);
}