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
CMAKE_MINIMUM_REQUIRED(VERSION 3.5) # not sure what the minimum actually is. this is locally installed. | |
PROJECT(example C) # C says to find C compilers. Ignore that. | |
# or from git or read from a file or whatever | |
SET(VERSION "1.0.0") | |
set(CPACK_PACKAGE_VERSION ${VERSION}) | |
set(CPACK_GENERATOR "RPM") | |
set(CPACK_PACKAGE_NAME "koti") | |
set(CPACK_PACKAGE_RELEASE 1) |
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 tornado.ioloop | |
import tornado.web | |
#import htmlboilerplate as html | |
from bs4 import BeautifulSoup, Tag | |
import htmlboilerplate2 as html | |
class MainHandler(tornado.web.RequestHandler): | |
def get(self): | |
soup = BeautifulSoup('', 'html5lib') |
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 alpine | |
RUN true \ | |
&& sed -i -e 's/v[[:digit:]]\.[[:digit:]]/edge/g' /etc/apk/repositories \ | |
&& apk upgrade --update-cache --available \ | |
# | |
# Add font, otherwise firefox draws garbage "tofu". | |
# Noto is a Google-created open source font (Open Font License) | |
&& apk add --no-cache font-noto \ | |
# | |
# It seems only ESR is in alpine's package list. |
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
#!/usr/bin/env bash | |
# https://www.shellcheck.net/ || https://github.com/koalaman/shellcheck | |
# Use of undefined variables is an error. | |
set -u | |
# Any process in a pipeline reporting a failure is an error. | |
set -o pipefail | |
# Stop the script on errors. |
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
extern "C" { | |
#include <sys/types.h> // fork(), open() | |
#include <sys/stat.h> // open() | |
#include <sys/wait.h> // waitpid() | |
#include <unistd.h> // fork(), fcntl(), read(), execve() | |
#include <fcntl.h> // fcntl(), open() | |
#include <signal.h> // signal() | |
} // extern "C" | |
#include <iostream>// std::cerr |
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
struct file_descriptor | |
{ | |
// implementation goes here | |
int read(char * destination, int count); | |
int write(char * source, int count); | |
}; | |
struct disk_file : public file_descriptor | |
{ | |
// route requests to disk I/O functions |
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
diff --git a/CMakeLists.txt b/CMakeLists.txt | |
index a082038..f4455c0 100644 | |
--- a/CMakeLists.txt | |
+++ b/CMakeLists.txt | |
@@ -124,7 +124,7 @@ include_directories(${YAML_CPP_SOURCE_DIR}/include) | |
### General compilation settings | |
### | |
set(yaml_c_flags ${CMAKE_C_FLAGS}) | |
-set(yaml_cxx_flags ${CMAKE_CXX_FLAGS}) | |
+set(yaml_cxx_flags "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer") |
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
sshi() { | |
if [ $# -eq 0 ] | |
then | |
ssh | |
return $? | |
fi | |
username=$(echo -n "${1}" | grep -oP "^.*@") | |
if [ "${username}" == "" ] | |
then |