# This script requires to have some basic Python skills | |
# - Install python dependencies (thanks to TitwitMuffbiscuit on reddit) : | |
# pip install nltk beautifulsoup4 googlesearch-python trafilatura wolframalpha | |
# | |
# If you get this error "Resource punkt not found", it's because Punkt sentence tokenizer for Natural Language Toolkit is missing. | |
# Edit the file and add this before | |
# from nltk.tokenize import word_tokenize , | |
# it will download the necessary english.pickle: | |
# import nltk | |
# nltk.download('punkt') |
Various search databases and backends as alternatives to Elasticsearch.
- Sonic - github.com/valeriansaliou/sonic - lightweight & schema-less search backend
- Tantivy - github.com/quickwit-oss/tantivy - full-text search engine library inspired by Apache Lucene
- Toshi - github.com/toshi-search/Toshi - search engine built on top of Tantivy
- Bayard - github.com/mosuka/bayard - search engine built on top of Tantivy
- Meilisearch - github.com/meilisearch/meilisearch - fast and full-featured search engine
⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,
/* | |
* Quill 1.* cannot next block elements inside <li> including nested <ul>,<ol>. | |
* To achieve nested lists it uses flat linear lists with CSS class `ql-indent-\d+` on <li>. | |
* Nesting <ul> inside <ol> or vice-versa cause topmost list to break in two adjacent lists. | |
* | |
* There is the only solution: fix bad HTML after getting it from Quill and break it back before | |
* passing to Quill again for editing. | |
*/ | |
const mkNode = (tagName = 'div') => document.createElement(tagName); |
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam' | |
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes' | |
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no' |
""" | |
Pull movie metadata from the https://www.themoviedb.org API. | |
Requires an API key stored in a .config file | |
The code is currently restricted to the movie category. To get it to run with | |
other categories, update the constants | |
(CATEGORY_SPECIFIC_CALLS, JSON_COLUMNS, KEYS_TO_DROP) | |
and delete the movie specific section of the export_data() function. |
.col-xs-offset-right-12 { | |
margin-right: 100%; | |
} | |
.col-xs-offset-right-11 { | |
margin-right: 91.66666667%; | |
} | |
.col-xs-offset-right-10 { | |
margin-right: 83.33333333%; | |
} | |
.col-xs-offset-right-9 { |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
# Download latest archlinux bootstrap package, see https://www.archlinux.org/download/ | |
wget 'ftp://ftp.nluug.nl/pub/os/Linux/distr/archlinux/iso/latest/archlinux-bootstrap-*-x86_64.tar.gz' | |
# Make sure you'll have enough entropy for pacman-key later. | |
apt-get install haveged | |
# Install the arch bootstrap image in a tmpfs. | |
mount -t tmpfs none /mnt | |
cd /mnt | |
tar xvf ~/archlinux-bootstrap-*-x86_64.tar.gz --strip-components=1 |