Skip to content

Instantly share code, notes, and snippets.

# $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
@mekkanizer
mekkanizer / parse.py
Created August 1, 2017 04:48
the re.sub 'JS dict => valid JSON' transition
with open('/home/mekkanizer/proj/chili/feature.json') as data_file:
string = data_file.read().replace('\n', '')
string = string.replace(r"\'",'`')
string = re.sub(r"keywords: '.*?,\W+","",string)
pattern = re.compile(r"([0-9]|description|notes|title): '(.*?)'")
match = pattern.search(string) # fucking 's all over the place
while match is not None:
s = match.group(1) + ': "' + match.group(2).translate(str.maketrans({'"': r'\"'})) + '"'#,"\'":"'"
string = string.replace(match.group(),s)
match = pattern.search(string,match.end())
@mekkanizer
mekkanizer / main.cpp
Created January 26, 2017 02:51
Mr. Dobos: N-GRAMS
#include <iostream>
#include <fstream>
#include <string>
#include <unordered_map>
using namespace std;
void ljust(string &str, const size_t num, const char pch = 'X') {
if(num > str.size())
str.insert(str.size(), num - str.size(), pch);