Skip to content

Instantly share code, notes, and snippets.

View pkorotkov's full-sized avatar

Pavel Korotkov pkorotkov

View GitHub Profile
@pkorotkov
pkorotkov / spectre.c
Created January 4, 2018 21:13 — forked from ErikAugust/spectre.c
Spectre example code
#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
@pkorotkov
pkorotkov / gist:200a72abec0478d12df9
Last active August 29, 2015 14:04
Seelog SMTP writer test
package main
import (
sl "github.com/cihub/seelog"
"os"
)
var config = `<seelog>
<outputs>
<smtp senderaddress="XXX@XXX.XXX" sendername="Notification service" hostname="smtp.XXX.XXX" hostport="587" username="XXX" password="XXX">
@pkorotkov
pkorotkov / gist:8087262
Created December 22, 2013 19:33
[C] How to write Russian characters to Windows console
// Tested on Windows 7 X86-64 with MinGW-w64 GCC.
...
#include <windows.h>
#include <locale.h>
#include <wchar.h>
...
// Make sure you have Lucida Console or Consolas font installed and choose it as the console font.
// Set the specified system locale to 'Russian_Russia.1251'.
setlocale(LC_ALL, "Russian");