Skip to content

Instantly share code, notes, and snippets.

View ollie314's full-sized avatar

Mehdi Lefebvre ollie314

View GitHub Profile
@ollie314
ollie314 / step-by-step-gatling-idea.md
Created March 31, 2016 09:46 — forked from groovybayo/step-by-step-gatling-idea.md
Gatling: Step by step guide to IntelliJ integration

Step by step guide to setting up IDEA to write gatling simulations

Prerequisites:

Have [SBT plugin][sbt-plugin] installed

Begin

  • [Create a new project][create-project] in IDEA ( File > New Project ...)
    • Make sure you select a maven module
@ollie314
ollie314 / pi.c
Created May 29, 2016 13:11
bellard's algorithm for pi calculation (slow version)
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#ifdef HAS_LONG_LONG
#define mul_mod(a,b,m) (( (long long) (a) * (long long) (b) ) % (m) )
#else
#define mul_mod(a,b,m) fmod( (double) (a) * (double) (b), m )
#endif
@ollie314
ollie314 / 2arg_func.c
Created June 13, 2016 11:38 — forked from mikesmullin/2arg_func.c
C to Linux x86-64 Assembly (ASM) examples
#include <stdio.h>
int example(int a, int b) {
return a + b + 3;
}
int main(void) {
printf("%i\n", example(1, 2));
return 0;
}
@ollie314
ollie314 / sshpub-to-rsa
Created August 11, 2016 06:13 — forked from thwarted/sshpub-to-rsa
converts an openssh RSA public key into a format usable by openssl rsautl (if you don't have openssh 5.6 or later with ssh-keygen PEM export format)
#!/usr/bin/env python
# with help and inspiration from
# * ASN1_generate_nconf(3) (specifically the SubjectPublicKeyInfo structure)
# * http://www.sysmic.org/dotclear/index.php?post/2010/03/24/Convert-keys-betweens-GnuPG%2C-OpenSsh-and-OpenSSL
# * http://blog.oddbit.com/2011/05/converting-openssh-public-keys.html
import sys
import base64
import struct
@ollie314
ollie314 / hbase-indexing-solr.md
Created August 23, 2016 17:27 — forked from abajwa-hw/hbase-indexing-solr.md
Hbase indexing to solr in HDP 2.3

Hbase indexing to solr in HDP 2.3

  • Background:

The HBase Indexer provides the ability to stream events from HBase to Solr for near real time searching. The HBase indexer is included with HDPSearch as an additional service. The indexer works by acting as an HBase replication sink. As updates are written to HBase, the events are asynchronously replicated to the HBase Indexer processes, which in turn creates Solr documents and pushes them to Solr.

@ollie314
ollie314 / hash.c
Created September 7, 2016 04:12 — forked from tonious/hash.c
A quick hashtable implementation in c.
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>
struct entry_s {
char *key;
char *value;
@ollie314
ollie314 / c_hashs.md
Created September 7, 2016 04:27
Shyni algorithms in c for hash caclulation

=hash.h=

typedef unsigned long ulong_t;
typedef unsigned int uint_t;

=djb2= this algorithm (k=33) was first reported by dan bernstein many years ago in comp.lang.c. another version of this algorithm (now favored by bernstein) uses xor: hash(i) = hash(i - 1) * 33 ^ str[i]; the magic of number 33 (why it works better than many other constants, prime or not) has never been adequately explained.

unsigned long hash(unsigned char *str)
{
@ollie314
ollie314 / fnv_hash_example.cpp
Created September 28, 2016 09:46 — forked from filsinger/fnv_hash_example.cpp
C++11 : FNV-1 and FNV-1a compile-time string hashing
// C++11 32bit FNV-1 and FNV-1a string hasing (Fowler–Noll–Vo hash)
//
// Requires a compiler with C++11 support
// See main(...) for examples
#include <iostream>
#include <cassert>
namespace hash
{

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@ollie314
ollie314 / API.md
Created October 25, 2016 06:04 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method: