This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@ubuntu:~# ./a.out | |
Reading 40 bytes: | |
Reading at malicious_x = 0xffffffffffdfeba8... Unclear: 0x54='T' score=980 (second best: 0x02 score=706) | |
Reading at malicious_x = 0xffffffffffdfeba9... Unclear: 0x68='h' score=929 (second best: 0x02 score=709) | |
Reading at malicious_x = 0xffffffffffdfebaa... Unclear: 0x65='e' score=973 (second best: 0x02 score=786) | |
Reading at malicious_x = 0xffffffffffdfebab... Unclear: 0x20=' ' score=928 (second best: 0x02 score=784) | |
Reading at malicious_x = 0xffffffffffdfebac... Unclear: 0x4D='M' score=746 (second best: 0x02 score=730) | |
Reading at malicious_x = 0xffffffffffdfebad... Unclear: 0x61='a' score=978 (second best: 0x02 score=749) | |
Reading at malicious_x = 0xffffffffffdfebae... Success: 0x67='g' score=39 (second best: 0x02 score=17) | |
Reading at malicious_x = 0xffffffffffdfebaf... Unclear: 0x69='i' score=972 (second best: 0x02 score=748) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#ifdef _MSC_VER | |
#include <intrin.h> /* for rdtscp and clflush */ | |
#pragma optimize("gt",on) | |
#else | |
#include <x86intrin.h> /* for rdtscp and clflush */ | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Here is an extremely simple version of work scheduling for multiple | |
// processors. | |
// | |
// The Problem: | |
// We have a lot of numbers that need to be math'ed. Doing this on one | |
// CPU core is slow. We have 4 CPU cores. We would thus like to use those | |
// cores to do math, because it will be a little less slow (ideally | |
// 4 times faster actually). | |
// | |
// The Solution: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is how you add a Jenkins slave | |
# On master: | |
sudo -u jenkins -H ssh-keygen | |
# On slave | |
adduser --system --group --home=/var/lib/jenkins-slave --no-create-home --disabled-password --quiet --shell /bin/bash jenkins-slave | |
install -d -o jenkins-slave -g jenkins-slave /var/lib/jenkins-slave |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Place this code to your .profile, .bashrc, .bash_profile or whatever | |
# | |
program_exists () { | |
type "$1" &> /dev/null ; | |
} | |
if program_exists go; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <uthash.h> | |
// this is an example of how to do a LRU cache in C using uthash | |
// http://uthash.sourceforge.net/ | |
// by Jehiah Czebotar 2011 - jehiah@gmail.com | |
// this code is in the public domain http://unlicense.org/ | |
#define MAX_CACHE_SIZE 100000 |