This file contains 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 <iostream> | |
int main(int argc, char *argv[]) | |
{ | |
char buf[4096]; | |
while (std::cin.good()) { | |
std::cin.read(buf, sizeof(buf)); | |
std::cout.write(buf, std::cin.gcount()); | |
} |
This file contains 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 <iostream> | |
int main(int argc, char *argv[]) | |
{ | |
std::cout << std::cin.rdbuf(); | |
} |
This file contains 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
import json | |
from collections import defaultdict | |
class D(defaultdict): | |
def __init__(self, *args, **kwargs): | |
if args and len(args) == 1 and isinstance(args[0], dict): | |
for k, v in args[0].items(): | |
if isinstance(v, dict): | |
self[k] = self.__class__(v) |
This file contains 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
def foobar(): | |
stmt = ( | |
"select * from foobar" | |
" where x > 3" | |
" and y < 3" | |
" and z = 3" | |
) | |
return stmt | |
print(foobar()) |
This file contains 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
File system | |
* Preferably something without a journal | |
* Use ext4 or xfs | |
* Mount filesystems with 'noatime' | |
* Separate disk for xlog and data | |
Tools | |
* iotop | |
* iozone | |
* mpstat |
This file contains 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 file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by goaccess configure 0.9.4, which was | |
generated by GNU Autoconf 2.69. Invocation command line was | |
$ ./configure | |
## --------- ## | |
## Platform. ## |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Template Test</title> | |
<style> | |
h1 { font-family: Georgia; } | |
#editor { max-width: 600px; } | |
.editable { background-color: #eeeeee; } | |
</style> |
This file contains 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
DEBUG:amqp:using channel_id: 1 | |
DEBUG:amqp:Channel open | |
DEBUG:amqp:heartbeat_tick : for connection cf6b5602c69a4de5aaaac06b0cda63d8 | |
DEBUG:amqp:heartbeat_tick : for connection cf6b5602c69a4de5aaaac06b0cda63d8 | |
DEBUG:amqp:heartbeat_tick : for connection cf6b5602c69a4de5aaaac06b0cda63d8 | |
DEBUG:amqp:heartbeat_tick : for connection cf6b5602c69a4de5aaaac06b0cda63d8 | |
DEBUG:amqp:heartbeat_tick : for connection cf6b5602c69a4de5aaaac06b0cda63d8 | |
DEBUG:amqp:heartbeat_tick : for connection cf6b5602c69a4de5aaaac06b0cda63d8 | |
DEBUG:amqp:heartbeat_tick : for connection cf6b5602c69a4de5aaaac06b0cda63d8 | |
DEBUG:amqp:heartbeat_tick : for connection cf6b5602c69a4de5aaaac06b0cda63d8 |
This file contains 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
from django.http import HttpResponse | |
class ApiResponse(HttpResponse): | |
def __init__(data, **kwargs): | |
kwargs.setdefault("content_type", "application/json") | |
content = json.dumps(data) | |
super(ApiResponse, self).__init__(content=data, **kwargs) |
This file contains 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
from flask import Flask | |
from flask import json, Response | |
""" | |
From: https://youtu.be/1ByQhAM5c1I | |
""" | |
class ApiResult(object): | |
""" |
OlderNewer